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 Return>parameter. 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. |