Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
32 lines
1.7 KiB
ABAP
32 lines
1.7 KiB
ABAP
CLASS {{p}}seed_data DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
|
PUBLIC SECTION.
|
|
INTERFACES if_oo_adt_classrun.
|
|
ENDCLASS.
|
|
|
|
|
|
CLASS {{p}}seed_data IMPLEMENTATION.
|
|
METHOD if_oo_adt_classrun~main.
|
|
DATA lt_station TYPE STANDARD TABLE OF {{p}}station WITH EMPTY KEY.
|
|
DATA lt_session TYPE STANDARD TABLE OF {{p}}session WITH EMPTY KEY.
|
|
lt_station = VALUE #(
|
|
( station_id = 'S1' city = 'Berlin' capacity_kw = '22.0' )
|
|
( station_id = 'S2' city = 'Munich' capacity_kw = '50.0' )
|
|
( station_id = 'S3' city = 'Hamburg' capacity_kw = '11.0' )
|
|
).
|
|
lt_session = VALUE #(
|
|
( session_id = 'T1' station_id = 'S1' start_date = '20240101' start_time = '080000' energy_kwh = '10.50' status = 'C' )
|
|
( session_id = 'T2' station_id = 'S1' start_date = '20240101' start_time = '120000' energy_kwh = '5.25' status = 'C' )
|
|
( session_id = 'T3' station_id = 'S1' start_date = '20240102' start_time = '090000' energy_kwh = '3.00' status = 'A' )
|
|
( session_id = 'T4' station_id = 'S2' start_date = '20240101' start_time = '100000' energy_kwh = '20.00' status = 'C' )
|
|
( session_id = 'T5' station_id = 'S2' start_date = '20240102' start_time = '110000' energy_kwh = '8.00' status = 'R' )
|
|
( session_id = 'T6' station_id = 'S3' start_date = '20240103' start_time = '140000' energy_kwh = '4.50' status = 'C' )
|
|
( session_id = 'T7' station_id = 'S3' start_date = '20240103' start_time = '160000' energy_kwh = '1.00' status = 'A' )
|
|
).
|
|
DELETE FROM {{p}}station.
|
|
DELETE FROM {{p}}session.
|
|
INSERT {{p}}station FROM TABLE @lt_station.
|
|
INSERT {{p}}session FROM TABLE @lt_session.
|
|
out->write( 'Seed data inserted.' ).
|
|
ENDMETHOD.
|
|
ENDCLASS.
|