Retrieve travel expense history

REPORT  ztest.

*--------------------------------------------------------------------*
*  INTERNAL TABLE AND VARIABLE
*--------------------------------------------------------------------*
DATA: itab_trips TYPE TABLE OF ptrv_trips WITH HEADER LINE,
      aend TYPE TABLE OF ptk11 WITH HEADER LINE,
* data definitions for database import pcl1(te)
      tekey TYPE ptp00.

*--------------------------------------------------------------------*
*  START-OF-SELECTION
*--------------------------------------------------------------------*
START-OF-SELECTION.

  CALL FUNCTION 'PTRV_GET_MY_TRIPS'
    EXPORTING
      employeenumber = '00030165' "Personnel Number
    TABLES
      trips          = itab_trips.

  READ TABLE itab_trips WITH KEY reinr = '1200000460'.  "Trip Number
  CONCATENATE itab_trips-pernr itab_trips-reinr itab_trips-perio
              itab_trips-pdvrs INTO tekey.
  IMPORT aend TO aend FROM DATABASE pcl1(te) ID tekey.
  LOOP AT aend.
    WRITE: / aend.
  ENDLOOP.

你可能感兴趣的:(history)