Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Function module PTRA_WEB_EXPENSE_REPORT_GET_2 not working when used in loop

Former Member
0 Kudos

Hi All,

I have used a function module PTRA_WEB_EXPENSE_REPORT_GET_2 in a custom fumction module which i am developing fetch the travel expense data . The function module PTRA_WEB_EXPENSE_REPORT_GET_2 returns the travel expense data based on the employee and the trip number. I want to fetch the travel expense data for a given set of employees and trip number and hence i have used this function module inside a loop statement.

The function module returns the travel expense data for the employee and trip in the first loop pass. From the second loop passs it doesn't return the value. I have also checked this in se37 and the same thing happens. Value is returned for the fist employee but for the next employee we have to go to initial screen of se37 and execute the Func. module again.

I debugged this function module and found that the value of the employee and the trip number is stored in the global variable. The value passed for the employee and trip is compared with the correspomding value in the global variable and if they are not same an error message is returned. Since we are using in a loop , each time a different value is passed for the employee and trip and the check fails .

Is there any way to clear the value in the global parameters or is there any other function module which can be used to clear the values of the global variables?

Thanks!

Regards

Manipal Parkala

1 REPLY 1

Former Member
0 Kudos

Hello Archana,

May be we can try several ways...

1) can you try calling function module BUFFER_REFRESH_ALL ??

   after each call...

2) May be u can call Function module "PTRA_WEB_EXPENSE_REPORT_GET_2 " in background task or seperate task , it will load the function group everytime when u call it in loop.

***DO let us know if it does not work.

thanks

~Raj