SAP BAPI_TRIP_REPORT_GET_DATA Function Module for Weekly Report Detail (Output of Tables)









BAPI_TRIP_REPORT_GET_DATA is a standard bapi trip report get data SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Weekly Report Detail (Output of Tables) processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for bapi trip report get data FM, simply by entering the name BAPI_TRIP_REPORT_GET_DATA into the relevant SAP transaction such as SE37 or SE38.

Function Group: HRTR
Program Name: SAPLHRTR
Main Program: SAPLHRTR
Appliation area: P
Release date: 09-Aug-1997
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_TRIP_REPORT_GET_DATA pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'BAPI_TRIP_REPORT_GET_DATA'"Weekly Report Detail (Output of Tables)
EXPORTING
EMPLOYEENUMBER = "Employee's Personnel Number
TRIPNUMBER = "Trip Number
* LANGUAGE = SY-LANGU "Language Key
* GET_TRIP_FROM_MEMORY = ' ' "

IMPORTING
STARTDATE = "Beginning Date of Weekly Report
REASON = "Reason (if Any)
DESTINATION = "Destination for Week (if Any)
STATUS = "Trip Status
RETURN = "Return Value (Instead of Exceptions)

TABLES
* EMP_INFO = "Employee Data
WEEK = "Table of Daily Data (Date, Reason, Customer, Miles/Km)
RECEIPTS = "Receipts for Week
* ADDINFO = "Additional Receipt Information
* TEXT = "Text Table
* AMOUNTS = "Table of Different Trip Amounts
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLHRTRV_STAT_001
EXIT_SAPLHRTRV_STAT_002

IMPORTING Parameters details for BAPI_TRIP_REPORT_GET_DATA

EMPLOYEENUMBER - Employee's Personnel Number

Data type: BAPIEMPL-PERNR
Optional: No
Call by Reference: No ( called with pass by value option)

TRIPNUMBER - Trip Number

Data type: BAPITRIP-TRIPNO
Optional: No
Call by Reference: No ( called with pass by value option)

LANGUAGE - Language Key

Data type: BAPITRVXXX-LANGU
Default: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)

GET_TRIP_FROM_MEMORY -

Data type: BAPITRVXXX-BOOLEAN
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for BAPI_TRIP_REPORT_GET_DATA

STARTDATE - Beginning Date of Weekly Report

Data type: BAPITRIP-DEP_DATE
Optional: No
Call by Reference: No ( called with pass by value option)

REASON - Reason (if Any)

Data type: BAPITRIP-CUSTOMER
Optional: No
Call by Reference: No ( called with pass by value option)

DESTINATION - Destination for Week (if Any)

Data type: BAPITRIP-LOCATION
Optional: No
Call by Reference: No ( called with pass by value option)

STATUS - Trip Status

Data type: BAPITRSTAO
Optional: No
Call by Reference: No ( called with pass by value option)

RETURN - Return Value (Instead of Exceptions)

Data type: BAPIRETURN
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for BAPI_TRIP_REPORT_GET_DATA

EMP_INFO - Employee Data

Data type: BAPITRVEMP
Optional: Yes
Call by Reference: No ( called with pass by value option)

WEEK - Table of Daily Data (Date, Reason, Customer, Miles/Km)

Data type: BAPITRWEEK
Optional: No
Call by Reference: No ( called with pass by value option)

RECEIPTS - Receipts for Week

Data type: BAPITRVREO
Optional: No
Call by Reference: No ( called with pass by value option)

ADDINFO - Additional Receipt Information

Data type: BAPITRADDI
Optional: Yes
Call by Reference: No ( called with pass by value option)

TEXT - Text Table

Data type: BAPITRTEXT
Optional: Yes
Call by Reference: No ( called with pass by value option)

AMOUNTS - Table of Different Trip Amounts

Data type: BAPITRVSUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for BAPI_TRIP_REPORT_GET_DATA Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lt_emp_info  TYPE STANDARD TABLE OF BAPITRVEMP, "   
lv_startdate  TYPE BAPITRIP-DEP_DATE, "   
lv_employeenumber  TYPE BAPIEMPL-PERNR, "   
lt_week  TYPE STANDARD TABLE OF BAPITRWEEK, "   
lv_reason  TYPE BAPITRIP-CUSTOMER, "   
lv_tripnumber  TYPE BAPITRIP-TRIPNO, "   
lv_language  TYPE BAPITRVXXX-LANGU, "   SY-LANGU
lt_receipts  TYPE STANDARD TABLE OF BAPITRVREO, "   
lv_destination  TYPE BAPITRIP-LOCATION, "   
lv_status  TYPE BAPITRSTAO, "   
lt_addinfo  TYPE STANDARD TABLE OF BAPITRADDI, "   
lv_get_trip_from_memory  TYPE BAPITRVXXX-BOOLEAN, "   ' '
lt_text  TYPE STANDARD TABLE OF BAPITRTEXT, "   
lv_return  TYPE BAPIRETURN, "   
lt_amounts  TYPE STANDARD TABLE OF BAPITRVSUM. "   

  CALL FUNCTION 'BAPI_TRIP_REPORT_GET_DATA'  "Weekly Report Detail (Output of Tables)
    EXPORTING
         EMPLOYEENUMBER = lv_employeenumber
         TRIPNUMBER = lv_tripnumber
         LANGUAGE = lv_language
         GET_TRIP_FROM_MEMORY = lv_get_trip_from_memory
    IMPORTING
         STARTDATE = lv_startdate
         REASON = lv_reason
         DESTINATION = lv_destination
         STATUS = lv_status
         RETURN = lv_return
    TABLES
         EMP_INFO = lt_emp_info
         WEEK = lt_week
         RECEIPTS = lt_receipts
         ADDINFO = lt_addinfo
         TEXT = lt_text
         AMOUNTS = lt_amounts
. " BAPI_TRIP_REPORT_GET_DATA




ABAP code using 7.40 inline data declarations to call FM BAPI_TRIP_REPORT_GET_DATA

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
"SELECT single DEP_DATE FROM BAPITRIP INTO @DATA(ld_startdate).
 
"SELECT single PERNR FROM BAPIEMPL INTO @DATA(ld_employeenumber).
 
 
"SELECT single CUSTOMER FROM BAPITRIP INTO @DATA(ld_reason).
 
"SELECT single TRIPNO FROM BAPITRIP INTO @DATA(ld_tripnumber).
 
"SELECT single LANGU FROM BAPITRVXXX INTO @DATA(ld_language).
DATA(ld_language) = SY-LANGU.
 
 
"SELECT single LOCATION FROM BAPITRIP INTO @DATA(ld_destination).
 
 
 
"SELECT single BOOLEAN FROM BAPITRVXXX INTO @DATA(ld_get_trip_from_memory).
DATA(ld_get_trip_from_memory) = ' '.
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!