cancel
Showing results for 
Search instead for 
Did you mean: 

Function Module or BAPI for chaging the destination in travel expense

Former Member
0 Kudos

Hi Experts,

I have a requirement to create trip travel expense report using ABAP program or BAPI. We have created a BAPI which creates the travel expense statement properly. However in this I have a requirement to change the destination while creating the expense report. E.g. when the Trip was created, the destination planned are Bangalore and Chennai. However the user has visited Goa and Mumbai. Though we can change the destinations in the trip itself so that the same then can be carried forward to expense report, but customer requirement is to measure the deviation against the plan and hence we do not want to change the destinations in trip. Is there any function module or BAPI available to change the destinations in expense report ?

Thanks in advance

Regards

Sandeep

Accepted Solutions (0)

Answers (2)

Answers (2)

Lukas_Weigelt
Active Contributor
0 Kudos

Hi Sandeep,

if I understand your requirement correctly, it's not possible like that, because the data foundation of the travel request and the expense sheet are the same.

Let me restate in my words what I understood that you want to do to rule out I misunderstood: The employee enters certain information in the destination fields --> the destinations the employee actually visits during the trip are different from the entered information in the request so the information needs to be changed --> however if you change the information the audit possibility is gone because the data foundation is the same and the old entered information will be overwritten and hence be lost. Is this your problem? If yes, a workaround would be creating extra custom fields in Structure PTK99 and shift the information from the entered destinations in the travel request in there as a means of a "shadow entry". This way it would be possible to then change the standard destination field with the actually visited destinations and you would have a possibility to check this new data against the "shadow entries" in your PTK99 custom fields. If you want more technical information for this approach, I have written a doc about it:

In case I completely misunderstood and you simply want to change the expense sheet data, you can either try Mathieu's approach or try using FM HRTRV_IF_MODIFY_TRIP which is simpler and has less dependencies. Both FMs are not officially released for customers, though.

Cheers, Lukas

manou_manou
Explorer
0 Kudos

Hi all,

the Request & Plan details are saved on Table : 'FTPT_REQUEST' , 'FTPT_REQ_HEAD' , 'FTPT_REQ_ACCOUNT'. according with R or P on the field (PLAN_REQUEST).

The expense details are saved on Table & Cluster.

PTRV_HEAD , PCL1-TE.

the first destination of the trip are on  PTRV_HEAD and the add destination are on cluster table ZIEL.

Now if you change your destination on Expense phase (schema not 'PL') you will change only PTRV_HEAD and PCL1-TE-ZIEL and not FTPT_REQUEST.

so i think no need to add new field on cluster table.

Thanks

Best Regards,

Emmanuel Levy

Lukas_Weigelt
Active Contributor
0 Kudos
the Request & Plan details are saved on Table : 'FTPT_REQUEST' , 'FTPT_REQ_HEAD' , 'FTPT_REQ_ACCOUNT'. according with R or P on the field (PLAN_REQUEST).

The rough way you put it, it's bad information.

Requests and Expense Sheets are technically the same thing. Most of the data of these processes is saved in PCL1-TE (as you correctly said). Some data, i.e. transport and accommodations from the request-mode are indeed saved in FTPT_REQUEST (as you correctly said) but merely as means as templates for the Plan Items, but that's because this particular bit of information is intertwined with the FI-TV-PL submodule which is entirely held in transparent tables.

If the OP is refering to ZORT1, ZLAND in PRTV_HEAD then the problem remains. Guess we'll have to wait for the OP's reply to clarify this, though.

Cheers, Lukas

Former Member
0 Kudos

Hello

Did you try  PTRA_WEB_EXPENSE_REPORT_SAVE_2 ? importing table it_itinerary

This FM is used in the standard Web Dynpro ABAP for any modifications of expense report

Hope this help

Mathieu