Ansicht
Dokumentation

OFTV_MOD_BADI_05 - BAdI: Assign Portions of a Trip to Alternative Wage Types

OFTV_MOD_BADI_05 - BAdI: Assign Portions of a Trip to Alternative Wage Types

BAL Application Log Documentation   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

This Business Add-In (BAdI) is used in the SAP Travel Management (FI-TV) component.

Using this BAdI, you can change a chain of recurring trip destinations of an employee created by the system and convert the wage type for an outstanding travel expense report or expense report.

You can use the chain of recurring trip destinations per employee in order the change the accounting and taxation procedure after a certain period of time (for example, three months). The system always sets up a chain, or adds to an existing chain, if the travel expense reports or expense reports of the employee contain the same destination.

If you have activated chaining, the system stores the destinations of all trips in the Table of All Trip Destinations for Processing Recurring Destinations (PTRV_TRIP_CHAIN). If the system finds a destination for which the accounting and taxation method must be changed starting on a specific date, it saves that date in table PTRV_TRIP_CHAIN for all affected destinations in the field ACTION_DATE_REQ.

The BAdI contains the following methods:

  • SET_DIFFERENT_WAGETYPE
The system executes this method when a travel expense report or expense report is presented for settlement. Using this method, you can assign a different wage type for settlement amounts that are after the calculated date in the field ACTION_DATE_REQ of table PTRV_TRIP_CHAIN (and thereby change the taxation method).
  • ADJUST_TRIPS_FOR_CHAIN
The system executes this method after it has made a trip chain based on the address, but before it determines the date on which the accounting or taxation method is to be changed.
Using this method, you can remove individual destinations from the chain (table parameter DKE_KETTE), which are assigned, for instance, to another account assignment object other than that of the current trip.
  • CHECK_ORIGINAL_CHAIN
The system executes this method before it deletes the trip chain(s). You can use this method to valuate the current cost assignment (table parameters KONTI, KOSTR, and KOSTZ) and decide which changed chains must be deleted (table parameter AEND_DATEN).
You can find an example of how to fill AEND_DATEN correctly in function module FITV_RD_START_TABLEMOD, just before calling the BAdI method.
  • COMPARE_DESTINATIONS
The system executes this method to compare different destinations, according to the letter added to the travel expense law 2014 by the German Federal Finance Ministry. With this method, you can determine whether different addresses belong to the same destination and therefore need to be evaluated together when the system creates the trip chains for taxation of per diems.

You have activated automatic trip chaining of recurring destinations in the Customizing activity Travel Expenses Control (Expert View), row Other Settlement, item 18, by choosing a different value for item 18 other than the default value of 0.

In the Customizing activity Check Travel Expense Constants, you have set the constants for recurring destinations (for example, REIDD, REIDM, REIMD, REIGP). With these constants, you define the time period after which the ACTION_DATE_REQ is to be set.

In the Customizing activity Define Schema and Individual Field Control or Schema and Single Field Control for Web Dynpro, you have set the Enter Addresses for Trip Destinations indicator for each trip provision variant and trip schema. In the table PTRV_TRIP_CHAIN, the system identifies a destination based on the entry of the city and street. The system chains the destinations only if these entries are exactly the same.

The BAdI is not active in the standard system.

For example, the implementation of the method SET_DIFFERENT_WAGETYPE could look like this:

method IF_EX_TRIP_RECURRENT_DEST~SET_DIFFERENT_WAGETYPE.
data date_req type ptrv_trip_chain-action_date_req.
  if t702n_r18 ne 0
    and not zikey is initial
    and wage_type_tax_free eq 'MJ20'.
* recurrent destination is active and this is meal per diem
* search for a required action date in PTRV_TRIP_CHAIN....
    select single action_date_req from ptrv_trip_chain
      into date_req
      where pernr eq wa_perio-pernr
      and reinr eq wa_perio-reinr
      and hdvrs eq wa_perio-hdvrs
      and perio eq wa_perio-perio
      and pdvrs eq wa_perio-pdvrs
      and rule_tag eq '3'
      and zikey eq zikey.
    if sy-subrc is initial and "entry found
       not date_req is initial and "chain detected
       date_req LE datum. "action necessary
* current date is behind trigger date: taxation is taking place!
* put meal per diem on wage type 3042
      wage_type_tax_free = 'MJXX'.
    endif.
  endif.
endmethod.






rdisp/max_wprun_time - Maximum work process run time   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 6180 Date: 20240523 Time: 194957     sap01-206 ( 97 ms )