Fonction SAP BAPI_TRIP_REPORT_CREATE - Create Simple Weekly Report (PR04)

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
CHANGE BAPITRVHIS u 66 X Entries in Table AEND, Structure for BAPI Interface
DESTINATION BAPITRWEEK-DAY_DEST C 17 X General Week Destination
EMPLOYEENUMBER BAPIEMPL-PERNR N 8 Employee's Personnel Number
REASON BAPITRWEEK-CUSTOMER C 17 X General Trip Reason for Entire Week
STARTDATE BAPITRIP-DEP_DATE D 8 Beginning Date of Weekly Report
STATUS BAPITRVSTA u 2 X Trip Status To Be Set

Paramètre Reférence Type Long. Description
EMPLOYEENUMBER BAPIEMPL-PERNR N 8 Employee's Personnel Number
RETURN BAPIRETURN u 452 Return Value (Instead of Exceptions)
TRIPNUMBER BAPITRIP-TRIPNO N 10 Trip Number Return Value

Paramètre Reférence Long. Facultatif Description
ADDINFO BAPITRADDI 376 X Additional Receipt Information
ADVANCE BAPITRVSCH 36 X Advance
RECEIPTS BAPITRVREC 67 X Receipts for Week
TEXT BAPITRTEXT 76 X Text for Week
WEEK BAPITRWEEK 57 Table for Week

Functionality
Simplified weekly reports for travel expenses (transaction PR04) can becreated using the method EmployeeTrip.CreateFromDataWeekly.
The required data can be transferred to the tables Week,Receipts, Addinfo, and Text.
The parameter Startdate specifies the beginning date of theweekly report here (take parameter FDW of feature TRVPA into accountbecause it specifies the first day of the week).
If the weekly report is created without errors, the trip number assignedby the SAP system is returned in the TripNumber field (internaltrip number assignment is a requirement here). Otherwise, any errorsduring data import (from dialog) are returned in the Returnparameter.
Technical details:
The weekly report was created through a call transaction for transactionPR01. The call transaction ensures that weekly reports created in thisway are consistent, since all entry checks are performed within the calltransaction that are performed within a normal entry dialog.
The structure of the individual transfer tables can be found in the DataDictionary. Note that the fields of the Addinfo table may requiremandatory fields or initial values depending on the expense type in theReceipts table (1:1 relationship).

Further information
See the documentation on function module BAPI_TRIP_REPORT_INIT and thestructures BAPITRWEEK, BAPITRVREC, BAPITRADDI, and BAPITRTEXT.

Description
Personnel number

Description
Personnel number

Description
In the table ADDINFO, additional information on receipts in tableRECEIPTS can be recorded.
Do not forget that the number of additional fields available depends onthe expense type (SPKZL field of table RECEIPTS).

Description
In the table RECEIPTS of the method EmployeeTrip.CreateFromDataWeekly,the receipts are passed on for weekly reports which are to be created.
The receipt number is entered in the BELNR field, the expense type inthe SPKZL field, the amount of the individual receipt in the AMOUNTSfield, the relevant currency in the WAERS field and the receipt date inthe BLDAT field. These fields are required as a minimum to create areceipt.
In addition, the exchange rate is specified in the RATE field forforeign currencies. If this field starts with 0 or blank, the exchangerate for the current date (BLDAT field) is taken from the currencytable of the R/3 System.
The MWSKZ field contains the sales tax code for the receipt. If it isnot specified, the VAT indicator stored in customizing is used, as intransaction PR04.
Finally, the BTEXT field is a short text field that can contain up to10 characters. Longer texts can be recorded either in the table ADDINFOor the table TEXT.
The values available for the SPKZL field (expense type) can be foundvia the methode EmployeeTrip.GetOptionsWeekly. (See documentation.)

Description
In the table TEXT, an additional text regarding the weekly report to becreated can be recorded.
Do not forget that, due to upward compatibility, the value "TEXT" mustbe included in the TEXTID field.

Description
In the table WEEK of the method EmployeeTrip.CreateFromDataWeekly, theindividual weekdays of a weekly report (transaction PR04) are passed onin the system.
In the DAYDATE field the current date is entered, in the
CUSTOMER field the trip reason or customer for this day, in theDAY_DEST field the location or city, and in the KMGES field, the numberof miles/kms traveled. The KMTOTAL field is not used in this method.