Advertisement
Jaehoon

EXT201_3.3.4

Feb 11th, 2020
1,343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 1.90 KB | None | 0 0
  1. CLASS zcl_generate_travel_data_xxx DEFINITION
  2.  PUBLIC
  3.  FINAL
  4.  CREATE PUBLIC .
  5.  
  6.  PUBLIC SECTION.
  7.    INTERFACES if_oo_adt_classrun.
  8.  PROTECTED SECTION.
  9.  PRIVATE SECTION.
  10. ENDCLASS.
  11.  
  12.  
  13. CLASS ZCL_GENERATE_TRAVEL_DATA_XXX IMPLEMENTATION.
  14.  
  15.  METHOD if_oo_adt_classrun~main.
  16.    DATA:itab TYPE TABLE OF ztravel_xxx.
  17.  
  18. *   read current timestamp
  19.    GET TIME STAMP FIELD DATA(zv_tsl).
  20.  
  21. *   fill internal travel table (itab)
  22.    itab = VALUE #(
  23.  ( travel_id = '00000022' agency_id = '070001' customer_id = '000077' begin_date = '20190624' end_date = '20190628' booking_fee = '60.00' total_price =  '750.00' currency_code = 'USD'
  24.    description = 'mv' overall_status = 'A' created_by = 'MUSTERMANN' created_at = '20190612133945.5960060' last_changed_by = 'MUSTERFRAU' last_changed_at = '20190702105400.3647680'  )
  25.  ( travel_id = '00000106' agency_id = '070005' customer_id = '000005' begin_date = '20190613' end_date = '20190716' booking_fee = '17.00' total_price = '650.00' currency_code = 'AFN'
  26.    description = 'Enter your comments here' overall_status = 'A' created_by = 'MUSTERMANN' created_at = '20190613111129.2391370' last_changed_by = 'MUSTERMANN' last_changed_at = '20190711140753.1472620' )
  27.  ( travel_id = '00000103' agency_id = '070010' customer_id = '000011' begin_date = '20190610' end_date = '20190714' booking_fee = '17.00' total_price = '800.00' currency_code = 'AFN'
  28.    description = 'Enter your comments here' overall_status = 'X' created_by = 'MUSTERFRAU' created_at = '20190613105654.4296640' last_changed_by = 'MUSTERFRAU' last_changed_at = '20190613111041.2251330' )
  29. ).
  30.  
  31. *   delete existing entries in the database table
  32.    DELETE FROM ztravel_xxx.
  33.  
  34. *   insert the new table entries
  35.    INSERT ztravel_xxx FROM TABLE @itab.
  36.  
  37. *   check the result
  38.    SELECT * FROM ztravel_xxx INTO TABLE @itab.
  39.    out->write( sy-dbcnt ).
  40.    out->write( 'Travel data inserted successfully!').
  41.  
  42.  ENDMETHOD.
  43. ENDCLASS.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement