SAP BAPI_TRIP_GET_DETAILS Function Module for Print Detail Tables For Trip (Receipt Entry)
BAPI_TRIP_GET_DETAILS is a standard bapi trip get details SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Print Detail Tables For Trip (Receipt Entry) 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 get details FM, simply by entering the name BAPI_TRIP_GET_DETAILS 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_GET_DETAILS 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_GET_DETAILS'"Print Detail Tables For Trip (Receipt Entry).
EXPORTING
EMPLOYEENUMBER = "Employee's Personnel Number
TRIPNUMBER = "Trip Number
* LANGUAGE = SY-LANGU "Language for Table Entries
* CALCULATE_AMOUNTS = 'X' "
* GET_TRIP_FROM_MEMORY = ' ' "
* PERIODNUMBER = '000' "Number of Trip Period
IMPORTING
RETURN = "Return Value (Instead of Exceptions)
FRAMEDATA = "General Trip Data
STATUS = "Trip Status
TABLES
* RECEIPTS = "Receipts
* COSTDIST_RECE = "Cost Distribution for Receipts
* COSTDIST_MILE = "Cost Distribution for Miles/Kms Distribution
* AMOUNTS = "Table of Different Trip Amounts
* EMP_INFO = "Employee Data
* ADDINFO = "Additional Receipt Information
* TEXT = "Trip Text
* MILEAGE = "Miles/Km Distribution
* STOPOVER = "Stopovers
* DEDUCTIONS = "Deductions
* TRANSPORT = "Local Public Transport, Journey
* COSTDIST_TRIP = "Cost Distribution for Entire Trip
* COSTDIST_STOP = "Cost Distribution for Stopovers
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_GET_DETAILS
EMPLOYEENUMBER - Employee's Personnel Number
Data type: BAPIEMPL-PERNROptional: No
Call by Reference: No ( called with pass by value option)
TRIPNUMBER - Trip Number
Data type: BAPITRIP-TRIPNOOptional: No
Call by Reference: No ( called with pass by value option)
LANGUAGE - Language for Table Entries
Data type: BAPITRVXXX-LANGUDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
CALCULATE_AMOUNTS -
Data type: BAPITRVXXX-BOOLEANDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
GET_TRIP_FROM_MEMORY -
Data type: BAPITRVXXX-BOOLEANDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PERIODNUMBER - Number of Trip Period
Data type: BAPITRVXXX-PERIODDefault: '000'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_TRIP_GET_DETAILS
RETURN - Return Value (Instead of Exceptions)
Data type: BAPIRETURNOptional: No
Call by Reference: No ( called with pass by value option)
FRAMEDATA - General Trip Data
Data type: BAPITRMAINOptional: No
Call by Reference: No ( called with pass by value option)
STATUS - Trip Status
Data type: BAPITRSTAOOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_TRIP_GET_DETAILS
RECEIPTS - Receipts
Data type: BAPITRVREOOptional: Yes
Call by Reference: No ( called with pass by value option)
COSTDIST_RECE - Cost Distribution for Receipts
Data type: BAPITRVCOROptional: Yes
Call by Reference: No ( called with pass by value option)
COSTDIST_MILE - Cost Distribution for Miles/Kms Distribution
Data type: BAPITRVCOMOptional: Yes
Call by Reference: No ( called with pass by value option)
AMOUNTS - Table of Different Trip Amounts
Data type: BAPITRVSUMOptional: Yes
Call by Reference: No ( called with pass by value option)
EMP_INFO - Employee Data
Data type: BAPITRVEMPOptional: Yes
Call by Reference: No ( called with pass by value option)
ADDINFO - Additional Receipt Information
Data type: BAPITRADDIOptional: Yes
Call by Reference: No ( called with pass by value option)
TEXT - Trip Text
Data type: BAPITRTEXTOptional: Yes
Call by Reference: No ( called with pass by value option)
MILEAGE - Miles/Km Distribution
Data type: BAPITRVMILOptional: Yes
Call by Reference: No ( called with pass by value option)
STOPOVER - Stopovers
Data type: BAPITRVSTOOptional: Yes
Call by Reference: No ( called with pass by value option)
DEDUCTIONS - Deductions
Data type: BAPITRVDEDOptional: Yes
Call by Reference: No ( called with pass by value option)
TRANSPORT - Local Public Transport, Journey
Data type: BAPITRVTRNOptional: Yes
Call by Reference: Yes
COSTDIST_TRIP - Cost Distribution for Entire Trip
Data type: BAPITRVCOTOptional: Yes
Call by Reference: No ( called with pass by value option)
COSTDIST_STOP - Cost Distribution for Stopovers
Data type: BAPITRVCOSOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAPI_TRIP_GET_DETAILS 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: | ||||
| lv_return | TYPE BAPIRETURN, " | |||
| lt_receipts | TYPE STANDARD TABLE OF BAPITRVREO, " | |||
| lv_employeenumber | TYPE BAPIEMPL-PERNR, " | |||
| lt_costdist_rece | TYPE STANDARD TABLE OF BAPITRVCOR, " | |||
| lt_costdist_mile | TYPE STANDARD TABLE OF BAPITRVCOM, " | |||
| lt_amounts | TYPE STANDARD TABLE OF BAPITRVSUM, " | |||
| lt_emp_info | TYPE STANDARD TABLE OF BAPITRVEMP, " | |||
| lt_addinfo | TYPE STANDARD TABLE OF BAPITRADDI, " | |||
| lv_framedata | TYPE BAPITRMAIN, " | |||
| lv_tripnumber | TYPE BAPITRIP-TRIPNO, " | |||
| lt_text | TYPE STANDARD TABLE OF BAPITRTEXT, " | |||
| lv_status | TYPE BAPITRSTAO, " | |||
| lv_language | TYPE BAPITRVXXX-LANGU, " SY-LANGU | |||
| lt_mileage | TYPE STANDARD TABLE OF BAPITRVMIL, " | |||
| lv_calculate_amounts | TYPE BAPITRVXXX-BOOLEAN, " 'X' | |||
| lt_stopover | TYPE STANDARD TABLE OF BAPITRVSTO, " | |||
| lv_get_trip_from_memory | TYPE BAPITRVXXX-BOOLEAN, " SPACE | |||
| lt_deductions | TYPE STANDARD TABLE OF BAPITRVDED, " | |||
| lv_periodnumber | TYPE BAPITRVXXX-PERIOD, " '000' | |||
| lt_transport | TYPE STANDARD TABLE OF BAPITRVTRN, " | |||
| lt_costdist_trip | TYPE STANDARD TABLE OF BAPITRVCOT, " | |||
| lt_costdist_stop | TYPE STANDARD TABLE OF BAPITRVCOS. " |
|   CALL FUNCTION 'BAPI_TRIP_GET_DETAILS' "Print Detail Tables For Trip (Receipt Entry) |
| EXPORTING | ||
| EMPLOYEENUMBER | = lv_employeenumber | |
| TRIPNUMBER | = lv_tripnumber | |
| LANGUAGE | = lv_language | |
| CALCULATE_AMOUNTS | = lv_calculate_amounts | |
| GET_TRIP_FROM_MEMORY | = lv_get_trip_from_memory | |
| PERIODNUMBER | = lv_periodnumber | |
| IMPORTING | ||
| RETURN | = lv_return | |
| FRAMEDATA | = lv_framedata | |
| STATUS | = lv_status | |
| TABLES | ||
| RECEIPTS | = lt_receipts | |
| COSTDIST_RECE | = lt_costdist_rece | |
| COSTDIST_MILE | = lt_costdist_mile | |
| AMOUNTS | = lt_amounts | |
| EMP_INFO | = lt_emp_info | |
| ADDINFO | = lt_addinfo | |
| TEXT | = lt_text | |
| MILEAGE | = lt_mileage | |
| STOPOVER | = lt_stopover | |
| DEDUCTIONS | = lt_deductions | |
| TRANSPORT | = lt_transport | |
| COSTDIST_TRIP | = lt_costdist_trip | |
| COSTDIST_STOP | = lt_costdist_stop | |
| . " BAPI_TRIP_GET_DETAILS | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_TRIP_GET_DETAILS
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 PERNR FROM BAPIEMPL INTO @DATA(ld_employeenumber). | ||||
| "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 BOOLEAN FROM BAPITRVXXX INTO @DATA(ld_calculate_amounts). | ||||
| DATA(ld_calculate_amounts) | = 'X'. | |||
| "SELECT single BOOLEAN FROM BAPITRVXXX INTO @DATA(ld_get_trip_from_memory). | ||||
| DATA(ld_get_trip_from_memory) | = ' '. | |||
| "SELECT single PERIOD FROM BAPITRVXXX INTO @DATA(ld_periodnumber). | ||||
| DATA(ld_periodnumber) | = '000'. | |||
Search for further information about these or an SAP related objects