Hierarchy

⤷

⤷

IMG Activity
ID | OFTV_MOD_BADI_11 | BAdI: Manipulation of Travel Expense Statement |
Transaction Code | S_P2H_60000002 | (empty) |
Created on | 20030901 | |
Customizing Attributes | OFTV_MOD_BADI_11 | Business Add-In: Manipulation of Travel Expense Statement |
Customizing Activity | OFTV_MOD_BADI_11 | Business Add-In: Manipulation of Travel Expense Statement |
Document
Document Class | SIMG | Hypertext: Object Class - Class to which a document belongs. |
Document Name | FITV_REP_TRAVEL_EXP |
Use
This Business Add-In (BAdI) enables you to customize travel expense statements.
The following methods are available for this purpose:
GET_RATE_PER_MILE
The method GET_RATE_PER_MILE enables you to customize the display of flat rates. For example, if only two decimal places are possible because of the currency, but the reimbursement amount per mile/kilometer has three decimal places, the reimbursement amount was displayed rounded to two places. By implementing the method GET_RATE_PER_MILE, however, you can display the reimbursement amounts with three decimal places.
When implementing the method, make sure that the paufa_idx column of the export table (ET_RATES_PER_MILE) of the BAdI is filled in all lines with the line number (sy-tabix) of the corresponding modified line of the import table (IT_PAUFA). Otherwise, the modified lines might not be displayed.
CHANGE_SUMMARY_LINE
By implementing the CHANGE_SUMMARY_LINE method, you can modify the total amounts area of the travel expense statement or add new lines to it.
This is particularly useful when you have added new result amounts to the results table ROT (TE cluster) using the BAdI Changes to Objects After Trip Settled (AFTER_TRIP_SETTLEMNT) in the travel expenses program RPRTEC00 and you want to display these new lines in the travel expense statement.
Requirements
Standard settings
Activities
Example
Example Implementation for the Method CHANGE_SUMMARY_LINE
Since tax laws in countries such as Norway require that the taxes to be paid on travel allowances must be reported before payout of the actual travel allowances, the following implementation shows the tax to be paid in a separate totals line.
A prerequisite is that you have implemented the method CHANGE_TRV_OBJECTS in the BAdI "AFTER_TRIP_SETTLEMNT". This method contains the parameter IT_ROT. You can add to this table data records that summarize the tax amounts under a separate wage type (such as /44R in the example below).
These amounts are then read and totaled in the method CHANGE_SUMMARY_LINE.
METHOD if_ex_fitv_rep_travel_exp~change_summary_line .
DATA: l_tax LIKE ptk30-betrg,
ls_rot TYPE ptk30,
ls_sumtab TYPE LINE OF fitv2_t_sum.
* Read tax amount stored in cluster table ROT
LOOP AT it_rot INTO ls_rot WHERE lgart = '/44R'.
ADD ls_rot-betrg TO l_tax.
ENDLOOP.
CHECK sy-subrc IS INITIAL AND l_tax NE 0.
* Subtract tax amount from total payable sum
LOOP AT it_sumtab INTO ls_sumtab.
ls_sumtab-summe_fa_gesamt = ls_sumtab-summe_fa_gesamt + l_tax.
ls_sumtab-cs_amount = l_tax.
ls_sumtab-cs_description = 'Tax'.
APPEND ls_sumtab TO et_sumtab.
ENDLOOP.
ENDMETHOD.
Example Implementation for the Method GET_RATE_PER_MILE:
METHOD if_ex_fitv_rep_travel_exp~get_rate_per_mile .
DATA: ls_paufa TYPE ptk21.
DATA: ls_rpm LIKE LINE OF et_rates_per_mile.
LOOP AT it_paufa INTO ls_paufa.
MOVE-CORRESPONDING ls_paufa TO ls_rpm.
ls_rpm-betfz = '325.00'.
ls_rpm-betfa = '325.00'.
ls_rpm-waers = 'USDN'.
ls_rpm-paufa_idx = sy-tabix.
APPEND ls_rpm TO et_rates_per_mile.
ENDLOOP.
ENDMETHOD.
Links
For more information on BadIs, refer to the SAP Library under SAP NetWeaver -> Application Platform (SAP Web Application Server) -> ABAP Technology -> ABAP Workbench (BC-DWB) -> Changing the SAP Standard.
Business Attributes
ASAP Roadmap ID | 153 | Design enhancements |
Mandatory / Optional | 3 | Nonrequired activity |
Critical / Non-Critical | 2 | Non-critical |
Country-Dependency | A | Valid for all countries |
Maintenance Objects
Maintenance object type | E | Business Add-In - Definition |
History
Last changed by/on | SAP | 20050726 |
SAP Release Created in | 500 |