Files
abap-llm/tasks_gen/train/G1100/seed/seed_berth.clas.abap
2026-10-05 18:02:52 +02:00

37 lines
2.1 KiB
ABAP

CLASS {{p}}seed_berth DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS {{p}}seed_berth IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
DATA lt_pier TYPE STANDARD TABLE OF {{p}}pier WITH EMPTY KEY.
DATA lt_berth TYPE STANDARD TABLE OF {{p}}berth WITH EMPTY KEY.
DELETE FROM {{p}}berth.
DELETE FROM {{p}}pier.
lt_pier = VALUE #( ( pier_code = 'A' base_fee = '20.00' rate_per_m = '3.00' power_fee = '5.00' )
( pier_code = 'B' base_fee = '10.00' rate_per_m = '1.55' power_fee = '2.00' )
( pier_code = 'C' base_fee = '40.00' rate_per_m = '5.00' power_fee = '8.00' ) ).
lt_berth = VALUE #( ( berth_id = 'B1' boat_name = 'SEAGULL' length_m = '7.50' pier_code = 'A' shore_power = 'N' stay_days = 2 )
( berth_id = 'B2' boat_name = 'MARLIN' length_m = '8.00' pier_code = 'A' shore_power = 'Y' stay_days = 3 )
( berth_id = 'B3' boat_name = 'OTTER' length_m = '15.00' pier_code = 'B' shore_power = 'N' stay_days = 1 )
( berth_id = 'B4' boat_name = 'PELICAN' length_m = '15.01' pier_code = 'B' shore_power = 'Y' stay_days = 2 )
( berth_id = 'B5' boat_name = 'DOLPHIN' length_m = '9.99' pier_code = 'B' shore_power = 'N' stay_days = 3 )
( berth_id = 'B6' boat_name = 'SKUA' length_m = '9.99' pier_code = 'B' shore_power = 'Y' stay_days = 3 )
( berth_id = 'B7' boat_name = 'TERN' length_m = '12.34' pier_code = 'C' shore_power = 'N' stay_days = 4 )
( berth_id = 'B8' boat_name = 'GULL' length_m = '6.00' pier_code = 'Z' shore_power = 'N' stay_days = 1 )
( berth_id = 'B9' boat_name = 'HERON' length_m = '20.00' pier_code = 'C' shore_power = 'Y' stay_days = 1 ) ).
INSERT {{p}}pier FROM TABLE @lt_pier.
INSERT {{p}}berth FROM TABLE @lt_berth.
out->write( |Seed data inserted: { lines( lt_berth ) } berth bookings| ).
ENDMETHOD.
ENDCLASS.