SAP Function Modules

GET_TRIP_SCHEMA SAP Function module







GET_TRIP_SCHEMA is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name GET_TRIP_SCHEMA into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: FITP_INTEGRATION
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM GET_TRIP_SCHEMA - GET TRIP SCHEMA





CALL FUNCTION 'GET_TRIP_SCHEMA' "
  EXPORTING
    morei =                     " ptrv_head-morei  Trip Provision Variant
*   employee =                  " ptrv_head-pernr  Personnel Number
*   date =                      " ptrv_head-datv1  Start Date of Trip Segment
    plan_activity =             " ta20r-acticity  Trip Activity Type Planning
*   sw_portal =                 " char1         Single-Character Indicator
  IMPORTING
    schem =                     " ptrv_head-schem  Trip Schema
    trip_type =                 " ta22b-planart
    homeland =                  " t005-land1    Home Country
    trip_activity =             " ptrv_head-kztkt
  TABLES
    items =                     " ftpt_item
  EXCEPTIONS
    NOT_FOUND = 1               "
    INFOTYPE_NOT_FOUND = 2      "
    NO_ENTRY_IN_TABLE = 3       "
    .  "  GET_TRIP_SCHEMA

ABAP code example for Function Module GET_TRIP_SCHEMA





The ABAP code below is a full code listing to execute function module GET_TRIP_SCHEMA including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_schem  TYPE PTRV_HEAD-SCHEM ,
ld_trip_type  TYPE TA22B-PLANART ,
ld_homeland  TYPE T005-LAND1 ,
ld_trip_activity  TYPE PTRV_HEAD-KZTKT ,
it_items  TYPE STANDARD TABLE OF FTPT_ITEM,"TABLES PARAM
wa_items  LIKE LINE OF it_items .


SELECT single MOREI
FROM PTRV_HEAD
INTO @DATA(ld_morei).


SELECT single PERNR
FROM PTRV_HEAD
INTO @DATA(ld_employee).


SELECT single DATV1
FROM PTRV_HEAD
INTO @DATA(ld_date).


SELECT single ACTICITY
FROM TA20R
INTO @DATA(ld_plan_activity).

DATA(ld_sw_portal) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_items to it_items. . CALL FUNCTION 'GET_TRIP_SCHEMA' EXPORTING morei = ld_morei * employee = ld_employee * date = ld_date plan_activity = ld_plan_activity * sw_portal = ld_sw_portal IMPORTING schem = ld_schem trip_type = ld_trip_type homeland = ld_homeland trip_activity = ld_trip_activity TABLES items = it_items EXCEPTIONS NOT_FOUND = 1 INFOTYPE_NOT_FOUND = 2 NO_ENTRY_IN_TABLE = 3 . " GET_TRIP_SCHEMA
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_schem  TYPE PTRV_HEAD-SCHEM ,
ld_morei  TYPE PTRV_HEAD-MOREI ,
it_items  TYPE STANDARD TABLE OF FTPT_ITEM ,
wa_items  LIKE LINE OF it_items,
ld_trip_type  TYPE TA22B-PLANART ,
ld_employee  TYPE PTRV_HEAD-PERNR ,
ld_homeland  TYPE T005-LAND1 ,
ld_date  TYPE PTRV_HEAD-DATV1 ,
ld_trip_activity  TYPE PTRV_HEAD-KZTKT ,
ld_plan_activity  TYPE TA20R-ACTICITY ,
ld_sw_portal  TYPE CHAR1 .


SELECT single MOREI
FROM PTRV_HEAD
INTO ld_morei.


"populate fields of struture and append to itab
append wa_items to it_items.

SELECT single PERNR
FROM PTRV_HEAD
INTO ld_employee.


SELECT single DATV1
FROM PTRV_HEAD
INTO ld_date.


SELECT single ACTICITY
FROM TA20R
INTO ld_plan_activity.

ld_sw_portal = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name GET_TRIP_SCHEMA or its description.