CLASS zct_cct_generate_fed_data DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .

  PUBLIC SECTION.
    INTERFACES if_oo_adt_classrun.
  PROTECTED SECTION.
  PRIVATE SECTION.
ENDCLASS.



CLASS zct_cct_generate_fed_data IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
    DATA itab TYPE TABLE OF zcct_fedstate.

*   fill internal travel table (itab)
    itab = VALUE #(
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D300' NAME ='Baden-Württemberg' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D301' NAME ='Bayern' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D302' NAME ='Berlin' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D303' NAME ='Brandenburg' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D304' NAME ='Bremen' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D305' NAME ='Hamburg' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D306' NAME ='Hessen' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D307' NAME ='Mecklenburg-Vorpommern' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D308' NAME ='Niedersachsen' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D309' NAME ='Nordrhein-Westfalen' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D310' NAME ='Rheinland-Pfalz' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D311' NAME ='Saarland' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D312' NAME ='Sachsen' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D313' NAME ='Sachsen-Anhalt' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D314' NAME ='Schleswig-Holstein' COUNTRYID ='DE' IMAGEURL ='')
    ( CLIENT ='100' ID ='02DE1D2CB38E1EEB8C9420F2C5A4D315' NAME ='Thüringen' COUNTRYID ='DE' IMAGEURL ='')
    ).

*   delete existing entries in the database table
    DELETE FROM zcct_fedstate.

*   insert the new table entries
    INSERT zcct_fedstate FROM TABLE @itab.

*   output the result as a console message
    out->write( |{ sy-dbcnt } federal states entries inserted successfully!| ).

  ENDMETHOD.
ENDCLASS.
