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-PERNR
Optional: No
Call by Reference: No ( called with pass by value option)

FRAMEDATA -

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

STATUS -

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

BATCH_SESSION_NAME -

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

CHANGE -

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

BATCH_INPUT_ONLY -

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

EXPORTING Parameters details for TRIP_CREATE_FROM_DATA

RETURN -

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

EMPLOYEENUMBER -

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

TRIPNUMBER -

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

TABLES Parameters details for TRIP_CREATE_FROM_DATA

RECEIPTS -

Data type: BAPITRVREC
Optional: Yes
Call by Reference: Yes

COSTDIST_STOP -

Data type: BAPITRVCOS
Optional: Yes
Call by Reference: Yes

COSTDIST_RECE -

Data type: BAPITRVCOR
Optional: Yes
Call by Reference: Yes

COSTDIST_MILE -

Data type: BAPITRVCOM
Optional: Yes
Call by Reference: Yes

RECEIPTS_JURCODES -

Data type: BAPIJURCODE
Optional: Yes
Call by Reference: Yes

RECEIPTS_SERVICE_PROVIDER -

Data type: BAPIRECPAYOT
Optional: Yes
Call by Reference: Yes

ADDINFO -

Data type: BAPITRADDI
Optional: Yes
Call by Reference: Yes

ADVANCE -

Data type: BAPITRVSCH
Optional: Yes
Call by Reference: Yes

TEXT -

Data type: BAPITRTEXT
Optional: Yes
Call by Reference: Yes

MILEAGE -

Data type: BAPITRVMIL
Optional: Yes
Call by Reference: Yes

STOPOVER -

Data type: BAPITRVSTO
Optional: Yes
Call by Reference: Yes

DEDUCTIONS -

Data type: PTK04
Optional: Yes
Call by Reference: Yes

TRANSPORT -

Data type: BAPITRVTRN
Optional: Yes
Call by Reference: Yes

COSTDIST_TRIP -

Data type: BAPITRVCOT
Optional: 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



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!