SAP TRIP_CREATE_FROM_DATA Function Module for
TRIP_CREATE_FROM_DATA is a standard trip create from data SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 trip create from data FM, simply by entering the name TRIP_CREATE_FROM_DATA into the relevant SAP transaction such as SE37 or SE38.
Function Group: HRTR
Program Name: SAPLHRTR
Main Program: SAPLHRTR
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function TRIP_CREATE_FROM_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 'TRIP_CREATE_FROM_DATA'".
EXPORTING
EMPLOYEENUMBER = "
FRAMEDATA = "
* STATUS = "
* BATCH_SESSION_NAME = "
* CHANGE = "
* BATCH_INPUT_ONLY = "
IMPORTING
RETURN = "
EMPLOYEENUMBER = "
TRIPNUMBER = "
TABLES
* RECEIPTS = "
* COSTDIST_STOP = "
* COSTDIST_RECE = "
* COSTDIST_MILE = "
* RECEIPTS_JURCODES = "
* RECEIPTS_SERVICE_PROVIDER = "
* ADDINFO = "
* ADVANCE = "
* TEXT = "
* MILEAGE = "
* STOPOVER = "
* DEDUCTIONS = "
* TRANSPORT = "
* COSTDIST_TRIP = "
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 TRIP_CREATE_FROM_DATA
EMPLOYEENUMBER -
Data type: BAPIEMPL-PERNROptional: No
Call by Reference: No ( called with pass by value option)
FRAMEDATA -
Data type: BAPITRMAINOptional: No
Call by Reference: No ( called with pass by value option)
STATUS -
Data type: BAPITRVSTAOptional: Yes
Call by Reference: No ( called with pass by value option)
BATCH_SESSION_NAME -
Data type: APQI-GROUPIDOptional: Yes
Call by Reference: No ( called with pass by value option)
CHANGE -
Data type: BAPITRVHISOptional: Yes
Call by Reference: No ( called with pass by value option)
BATCH_INPUT_ONLY -
Data type: BAPITRVXXX-BOOLEANOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for TRIP_CREATE_FROM_DATA
RETURN -
Data type: BAPIRETURNOptional: No
Call by Reference: No ( called with pass by value option)
EMPLOYEENUMBER -
Data type: BAPIEMPL-PERNROptional: No
Call by Reference: No ( called with pass by value option)
TRIPNUMBER -
Data type: BAPITRIP-TRIPNOOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for TRIP_CREATE_FROM_DATA
RECEIPTS -
Data type: BAPITRVRECOptional: Yes
Call by Reference: Yes
COSTDIST_STOP -
Data type: BAPITRVCOSOptional: Yes
Call by Reference: Yes
COSTDIST_RECE -
Data type: BAPITRVCOROptional: Yes
Call by Reference: Yes
COSTDIST_MILE -
Data type: BAPITRVCOMOptional: Yes
Call by Reference: Yes
RECEIPTS_JURCODES -
Data type: BAPIJURCODEOptional: Yes
Call by Reference: Yes
RECEIPTS_SERVICE_PROVIDER -
Data type: BAPIRECPAYOTOptional: Yes
Call by Reference: Yes
ADDINFO -
Data type: BAPITRADDIOptional: Yes
Call by Reference: Yes
ADVANCE -
Data type: BAPITRVSCHOptional: Yes
Call by Reference: Yes
TEXT -
Data type: BAPITRTEXTOptional: Yes
Call by Reference: Yes
MILEAGE -
Data type: BAPITRVMILOptional: Yes
Call by Reference: Yes
STOPOVER -
Data type: BAPITRVSTOOptional: Yes
Call by Reference: Yes
DEDUCTIONS -
Data type: PTK04Optional: Yes
Call by Reference: Yes
TRANSPORT -
Data type: BAPITRVTRNOptional: Yes
Call by Reference: Yes
COSTDIST_TRIP -
Data type: BAPITRVCOTOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for TRIP_CREATE_FROM_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: | ||||
| lv_return | TYPE BAPIRETURN, " | |||
| lt_receipts | TYPE STANDARD TABLE OF BAPITRVREC, " | |||
| lv_employeenumber | TYPE BAPIEMPL-PERNR, " | |||
| lt_costdist_stop | TYPE STANDARD TABLE OF BAPITRVCOS, " | |||
| lt_costdist_rece | TYPE STANDARD TABLE OF BAPITRVCOR, " | |||
| lt_costdist_mile | TYPE STANDARD TABLE OF BAPITRVCOM, " | |||
| lt_receipts_jurcodes | TYPE STANDARD TABLE OF BAPIJURCODE, " | |||
| lt_receipts_service_provider | TYPE STANDARD TABLE OF BAPIRECPAYOT, " | |||
| lt_addinfo | TYPE STANDARD TABLE OF BAPITRADDI, " | |||
| lv_framedata | TYPE BAPITRMAIN, " | |||
| lv_employeenumber | TYPE BAPIEMPL-PERNR, " | |||
| lv_status | TYPE BAPITRVSTA, " | |||
| lt_advance | TYPE STANDARD TABLE OF BAPITRVSCH, " | |||
| lv_tripnumber | TYPE BAPITRIP-TRIPNO, " | |||
| lt_text | TYPE STANDARD TABLE OF BAPITRTEXT, " | |||
| lv_batch_session_name | TYPE APQI-GROUPID, " | |||
| lv_change | TYPE BAPITRVHIS, " | |||
| lt_mileage | TYPE STANDARD TABLE OF BAPITRVMIL, " | |||
| lt_stopover | TYPE STANDARD TABLE OF BAPITRVSTO, " | |||
| lv_batch_input_only | TYPE BAPITRVXXX-BOOLEAN, " | |||
| lt_deductions | TYPE STANDARD TABLE OF PTK04, " | |||
| lt_transport | TYPE STANDARD TABLE OF BAPITRVTRN, " | |||
| lt_costdist_trip | TYPE STANDARD TABLE OF BAPITRVCOT. " |
|   CALL FUNCTION 'TRIP_CREATE_FROM_DATA' " |
| EXPORTING | ||
| EMPLOYEENUMBER | = lv_employeenumber | |
| FRAMEDATA | = lv_framedata | |
| STATUS | = lv_status | |
| BATCH_SESSION_NAME | = lv_batch_session_name | |
| CHANGE | = lv_change | |
| BATCH_INPUT_ONLY | = lv_batch_input_only | |
| IMPORTING | ||
| RETURN | = lv_return | |
| EMPLOYEENUMBER | = lv_employeenumber | |
| TRIPNUMBER | = lv_tripnumber | |
| TABLES | ||
| RECEIPTS | = lt_receipts | |
| COSTDIST_STOP | = lt_costdist_stop | |
| COSTDIST_RECE | = lt_costdist_rece | |
| COSTDIST_MILE | = lt_costdist_mile | |
| RECEIPTS_JURCODES | = lt_receipts_jurcodes | |
| RECEIPTS_SERVICE_PROVIDER | = lt_receipts_service_provider | |
| ADDINFO | = lt_addinfo | |
| ADVANCE | = lt_advance | |
| TEXT | = lt_text | |
| MILEAGE | = lt_mileage | |
| STOPOVER | = lt_stopover | |
| DEDUCTIONS | = lt_deductions | |
| TRANSPORT | = lt_transport | |
| COSTDIST_TRIP | = lt_costdist_trip | |
| . " TRIP_CREATE_FROM_DATA | ||
ABAP code using 7.40 inline data declarations to call FM TRIP_CREATE_FROM_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 PERNR FROM BAPIEMPL INTO @DATA(ld_employeenumber). | ||||
| "SELECT single PERNR FROM BAPIEMPL INTO @DATA(ld_employeenumber). | ||||
| "SELECT single TRIPNO FROM BAPITRIP INTO @DATA(ld_tripnumber). | ||||
| "SELECT single GROUPID FROM APQI INTO @DATA(ld_batch_session_name). | ||||
| "SELECT single BOOLEAN FROM BAPITRVXXX INTO @DATA(ld_batch_input_only). | ||||
Search for further information about these or an SAP related objects