SAP BAPI_TRIP_GET_OPTIONS Function Module for Import Personal Data and Travel Expense Tables









BAPI_TRIP_GET_OPTIONS is a standard bapi trip get options SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Import Personal Data and Travel Expense 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 get options FM, simply by entering the name BAPI_TRIP_GET_OPTIONS 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_OPTIONS 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_OPTIONS'"Import Personal Data and Travel Expense Tables
EXPORTING
EMPLOYEENUMBER = "Employee's Personnel Number
* DATE = SY-DATUM "Date of Entries: Authorization Check
* LANGUAGE = SY-LANGU "Language of Rel. Table Entries
* SELECT_LAST = ' ' "Scan Last Trips (X)/Read All Tables
* SCAN_X_TRIPS = 10 "Number of Trips to Be Scanned

IMPORTING
RETURN = "Return Value (Instead of Exceptions)

TABLES
* EMP_INFO = "Infos for Personnel Number
* VEHICLE_CLASS = "Vehicle Classes
* COST_OBJECTS = "Cost Objects for Travel Expenses
* TRIP_SCHEMAS = "Trip Schema: BAPI Structure
* SERVICE_PROVIDER_CATEGORIES = "Travel Service Providers - Categories
* SERVICE_PROVIDERS = "Travel Service Providers
* FIELD_SELECTION_GENERAL = "Travel Field Selection Control
* FIELD_SELECTION_TRIP_CA = "Cost Assignment for Trip
* FIELD_SELECTION_RECEIPT_CA = "Receipt Cost Assignment
* FIELD_SELECTION_STOPOVER_CA = "Stopover Cost Assignment
* FIELD_SELECTION_MILEAGE_CA = "Miles/Km Cost Assignment
DEFAULTS = "Default Values for Travel Expenses
* TAX_CODES = "Input Tax Code
EXPENSE_TYPES = "Expense Types
* COUNTRIES = "Trip Countries
* CURRENCIES = "Currencies
* TRIP_TYPES_STATUATORY = "Statutory Trip Types
* TRIP_ACTIVITIES = "Trip Activity Types
* TRIP_TYPE_COMSP = "Enterprise-Spec. Trip Types
* VEHICLE_TYPES = "Vehicle Types
.




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_OPTIONS

EMPLOYEENUMBER - Employee's Personnel Number

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

DATE - Date of Entries: Authorization Check

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

LANGUAGE - Language of Rel. Table Entries

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

SELECT_LAST - Scan Last Trips (X)/Read All Tables

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

SCAN_X_TRIPS - Number of Trips to Be Scanned

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

EXPORTING Parameters details for BAPI_TRIP_GET_OPTIONS

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_GET_OPTIONS

EMP_INFO - Infos for Personnel Number

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

VEHICLE_CLASS - Vehicle Classes

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

COST_OBJECTS - Cost Objects for Travel Expenses

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

TRIP_SCHEMAS - Trip Schema: BAPI Structure

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

SERVICE_PROVIDER_CATEGORIES - Travel Service Providers - Categories

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

SERVICE_PROVIDERS - Travel Service Providers

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

FIELD_SELECTION_GENERAL - Travel Field Selection Control

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

FIELD_SELECTION_TRIP_CA - Cost Assignment for Trip

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

FIELD_SELECTION_RECEIPT_CA - Receipt Cost Assignment

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

FIELD_SELECTION_STOPOVER_CA - Stopover Cost Assignment

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

FIELD_SELECTION_MILEAGE_CA - Miles/Km Cost Assignment

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

DEFAULTS - Default Values for Travel Expenses

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

TAX_CODES - Input Tax Code

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

EXPENSE_TYPES - Expense Types

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

COUNTRIES - Trip Countries

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

CURRENCIES - Currencies

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

TRIP_TYPES_STATUATORY - Statutory Trip Types

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

TRIP_ACTIVITIES - Trip Activity Types

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

TRIP_TYPE_COMSP - Enterprise-Spec. Trip Types

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

VEHICLE_TYPES - Vehicle Types

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

Copy and paste ABAP code example for BAPI_TRIP_GET_OPTIONS 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_emp_info  TYPE STANDARD TABLE OF BAPITRVEMP, "   
lv_employeenumber  TYPE BAPIEMPL-PERNR, "   
lt_vehicle_class  TYPE STANDARD TABLE OF BAPITR706W, "   
lt_cost_objects  TYPE STANDARD TABLE OF BAPIPSREF, "   
lt_trip_schemas  TYPE STANDARD TABLE OF BAPITR706S, "   
lt_service_provider_categories  TYPE STANDARD TABLE OF BAPITRVSPCAT, "   
lt_service_providers  TYPE STANDARD TABLE OF BAPITRVSP, "   
lt_field_selection_general  TYPE STANDARD TABLE OF BAPITRVFSEL, "   
lt_field_selection_trip_ca  TYPE STANDARD TABLE OF BAPITRVFSEL_TRIP_CA, "   
lt_field_selection_receipt_ca  TYPE STANDARD TABLE OF BAPITRVFSEL_RECEIPT_CA, "   
lt_field_selection_stopover_ca  TYPE STANDARD TABLE OF BAPITRVFSEL_STOPOVER_CA, "   
lt_field_selection_mileage_ca  TYPE STANDARD TABLE OF BAPITRVFSEL_MILEAGE_CA, "   
lv_date  TYPE BAPITRIP-DEP_DATE, "   SY-DATUM
lt_defaults  TYPE STANDARD TABLE OF BAPITRVDEF, "   
lt_tax_codes  TYPE STANDARD TABLE OF BAPITRVTAX, "   
lv_language  TYPE BAPITRVXXX-LANGU, "   SY-LANGU
lt_expense_types  TYPE STANDARD TABLE OF BAPITR706B, "   
lt_countries  TYPE STANDARD TABLE OF BAPITR706O, "   
lv_select_last  TYPE BAPITRVXXX-BOOLEAN, "   SPACE
lt_currencies  TYPE STANDARD TABLE OF BAPITRCURR, "   
lv_scan_x_trips  TYPE BAPITRVXXX-SCAN_TRIPS, "   10
lt_trip_types_statuatory  TYPE STANDARD TABLE OF BAPITR706G, "   
lt_trip_activities  TYPE STANDARD TABLE OF BAPITR706R, "   
lt_trip_type_comsp  TYPE STANDARD TABLE OF BAPITR706X, "   
lt_vehicle_types  TYPE STANDARD TABLE OF BAPITR706E. "   

  CALL FUNCTION 'BAPI_TRIP_GET_OPTIONS'  "Import Personal Data and Travel Expense Tables
    EXPORTING
         EMPLOYEENUMBER = lv_employeenumber
         DATE = lv_date
         LANGUAGE = lv_language
         SELECT_LAST = lv_select_last
         SCAN_X_TRIPS = lv_scan_x_trips
    IMPORTING
         RETURN = lv_return
    TABLES
         EMP_INFO = lt_emp_info
         VEHICLE_CLASS = lt_vehicle_class
         COST_OBJECTS = lt_cost_objects
         TRIP_SCHEMAS = lt_trip_schemas
         SERVICE_PROVIDER_CATEGORIES = lt_service_provider_categories
         SERVICE_PROVIDERS = lt_service_providers
         FIELD_SELECTION_GENERAL = lt_field_selection_general
         FIELD_SELECTION_TRIP_CA = lt_field_selection_trip_ca
         FIELD_SELECTION_RECEIPT_CA = lt_field_selection_receipt_ca
         FIELD_SELECTION_STOPOVER_CA = lt_field_selection_stopover_ca
         FIELD_SELECTION_MILEAGE_CA = lt_field_selection_mileage_ca
         DEFAULTS = lt_defaults
         TAX_CODES = lt_tax_codes
         EXPENSE_TYPES = lt_expense_types
         COUNTRIES = lt_countries
         CURRENCIES = lt_currencies
         TRIP_TYPES_STATUATORY = lt_trip_types_statuatory
         TRIP_ACTIVITIES = lt_trip_activities
         TRIP_TYPE_COMSP = lt_trip_type_comsp
         VEHICLE_TYPES = lt_vehicle_types
. " BAPI_TRIP_GET_OPTIONS




ABAP code using 7.40 inline data declarations to call FM BAPI_TRIP_GET_OPTIONS

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 DEP_DATE FROM BAPITRIP INTO @DATA(ld_date).
DATA(ld_date) = SY-DATUM.
 
 
 
"SELECT single LANGU FROM BAPITRVXXX INTO @DATA(ld_language).
DATA(ld_language) = SY-LANGU.
 
 
 
"SELECT single BOOLEAN FROM BAPITRVXXX INTO @DATA(ld_select_last).
DATA(ld_select_last) = ' '.
 
 
"SELECT single SCAN_TRIPS FROM BAPITRVXXX INTO @DATA(ld_scan_x_trips).
DATA(ld_scan_x_trips) = 10.
 
 
 
 
 


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!