Fonction SAP BAPI_TRIP_GET_OPTIONS - Import Personal Data and Travel Expense Tables

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
DATE BAPITRIP-DEP_DATE D 8 SY-DATUM X Date of Entries: Authorization Check
EMPLOYEENUMBER BAPIEMPL-PERNR N 8 Employee's Personnel Number
LANGUAGE BAPITRVXXX-LANGU C 1 SY-LANGU X Language of Rel. Table Entries
SCAN_X_TRIPS BAPITRVXXX-SCAN_TRIPS b 1 10 X Number of Trips to Be Scanned
SELECT_LAST BAPITRVXXX-BOOLEAN C 1 SPACE X Scan Last Trips (X)/Read All Tables

Paramètre Reférence Type Long. Description
RETURN BAPIRETURN u 452 Return Value (Instead of Exceptions)

Paramètre Reférence Long. Facultatif Description
COST_OBJECTS BAPIPSREF 359 X Cost Objects for Travel Expenses
COUNTRIES BAPITR706O 33 X Trip Countries
CURRENCIES BAPITRCURR 71 X Currencies
DEFAULTS BAPITRVDEF 26 Default Values for Travel Expenses
EMP_INFO BAPITRVEMP 201 X Infos for Personnel Number
EXPENSE_TYPES BAPITR706B 87 Expense Types
FIELD_SELECTION_GENERAL BAPITRVFSEL 77 X Travel Field Selection Control
FIELD_SELECTION_MILEAGE_CA BAPITRVFSEL_MILEAGE_CA 31 X Miles/Km Cost Assignment
FIELD_SELECTION_RECEIPT_CA BAPITRVFSEL_RECEIPT_CA 31 X Receipt Cost Assignment
FIELD_SELECTION_STOPOVER_CA BAPITRVFSEL_STOPOVER_CA 31 X Stopover Cost Assignment
FIELD_SELECTION_TRIP_CA BAPITRVFSEL_TRIP_CA 31 X Cost Assignment for Trip
SERVICE_PROVIDERS BAPITRVSP 34 X Travel Service Providers
SERVICE_PROVIDER_CATEGORIES BAPITRVSPCAT 31 X Travel Service Providers - Categories
TAX_CODES BAPITRVTAX 52 X Input Tax Code
TRIP_ACTIVITIES BAPITR706R 31 X Trip Activity Types
TRIP_SCHEMAS BAPITR706S 107 X Trip Schema: BAPI Structure
TRIP_TYPES_STATUATORY BAPITR706G 31 X Statutory Trip Types
TRIP_TYPE_COMSP BAPITR706X 26 X Enterprise-Spec. Trip Types
VEHICLE_CLASS BAPITR706W 28 X Vehicle Classes
VEHICLE_TYPES BAPITR706E 31 X Vehicle Types

Functionality
The method EmployeeTrip.GetOptions designates all tables andparameters which could be required for creating a trip usingtransaction PR01 or PR05.
The import parameter EmployeeNumber determines the personnelnumber for which the local work space is to be created, Datedetermines the date for which the table entries should be read and theLanguage parameter determines the language for the tableentries.
By means of the import parameter Select_Last, you can determinewhether the values in tables Countries and Currencies areread from the Customizing tables (Select_Last = Space), or whether thevalues in these tables are determined from the last trips (Select_Last= "X"). In the latter case, parameter Scan_X_Trips determinesthe number of trips to be searched.
The table Cost_Objects is only filled if the Select_Lastparameter has the value "X" and, in this case, contains the last costobjects posted to by the employee.
The Select_Last parameter especially gives you the possibilityto prepare a kind of short F4-Help for these fields, since the completecountry and currency tables can be very lengthy.
The status of the method call can be determined from the returnparameter Return after the method has been performed.

Notes
Most of the return tables are Travel Management Customizing tables.Although it would be possible to read these tables via BAPIF4-Help, some of these tables also contain additional authorizationfields that are employee-specific. Consequently, the use of generalBAPI-F4-Help would lead to many more table entries and make calling themethod EmployeeTrip.CreateFromData more difficult.

Further information
For more information, especially concerning individual table fields,see the structure documentation for the tables DEFAULTS, EXPENSE_TYPESand COST_OBJECTS or the relevant structures for the tables in the DataDictionary.

Description
Personnel number

Description
The table Cost_Objects contains the account assignment objectslast used by the employee and is only filled if the parameterScan_Last is set.

Description
The table Defaults contains the parameters

  • Firstday (not needed to create via PR01 and PR05)

  • CCCParam (TRVPA, switch CCC; see feature documentation),

  • Rec_F_PD (TRVCT, F line, position 1; see documentation on
  • feature TRVCT),
    • Rec_U_PD (TRVCT, U line, position 1; see above)

    • Rec_V_PD (TRVCT, V line, position 1; see above)

    • Tac_Code_0 (Table T706D, MWAUS) and

    • Mileage_PD (Reimbursement amount per mile/kilometer for the
    • first mile/km of the trip in the employee's local currency; If mile/kmaccumulation is not active, this rate applies for the entire trip,otherwise it can vary!).

      Description
      The table Expense_Types contains the trip expense types whichare valid at the date for the specified employee.
      The table has the following fields:

      • PR04_Sort: Sorting sequence of trip expense types in the weekly
      • report (is only needed to display trip expense types in spreadsheetsbut has no effect if one of the create methods is called)
        • EXP_Type: Key for trip expense type

        • TAX_CODE: Default sales tax indicator for domestic receipts

        • EXP_CATE: Key for trip expense category

        • "M" and "V" for meals receipts
          "U" for accommodations receipts
          "F" for travel costs receipts
          "S" for other receipts
          • PAID_COM: Indicator for receipt paid by company

          • MAX_AMOUNT: Maximum receipt amount according to customizing
          • (capping limit)
            • CURRENCY: Currency of maximum receipt amount

            • MESS_FLAG: No longer used as of 4.0!

            • SCDV1: Field control for start date

            • The values for field control can have the following characteristics(these values are also valid for the other field control parameters):
              "+" : This field is a mandatory entry field
              "-" : This field is not visible (suppressed and not ready for input)
              "." : This field is ready for input
              SPACE: This field is only displayed
              • SCDB1: Field control for end date

              • SCANZ: Field control for number

              • ANZCA: Calculation of a default value for the number field

              • SPACE: No calculation of default value
                "0" : Difference in dates, but at least 1 day
                "1" : Difference in dates plus 1 day
                • SCLND: Field control for country and region

                • SCRAU: Field control for enterprise-specific trip type

                • SCFRF: Field control for number of breakfasts

                • SCDEC: Field control for description

                • SCPLA: Field control for location

                • SCBPU: Field control for reason for receipt

                • SCBRE: Field control for business partner

                • SCEDT: Field control for editor (not yet supported!)

                • EXP_TEXT: Name of trip expense type

                • The parameters for field control determine especially whether certainreceipt information is absolutely necessary when the methodEmployeeTrip.CreateFromData is used or whether it can beomitted. The method above returns an error message if a mandatory fieldwas not supplied with a value.