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: 

Call FM remotely in Background task

former_member761178
Discoverer
0 Kudos

Hello,

I need some help regarding calling function modules through RFC call in background task in 4.6C.

We are calling some standard FMs in our Z program to perform some actions in a remotely called system and based on the return value from the RFC call we are deciding further processing steps in our program. The Z program takes lot of execution time (due to huge data) and hence is executed in background and when the RFC call is made to the standard FM, the FM also is taking long execution time. Because of the long execution time in the remote system (which also is 4.6C SAP system), a TIME_OUT dump is occuring and due to this the original job (Zprogram) also gets cancelled.

As a solution we are trying to implement the RFC call as a background task, so that both the zprogram and the RFC call happen in background and get executed successfully.

But, while calling the RFC FM in background it is not allowing us to fetch any return values (which is in accordance with the standard SAP behaviour). For us to proceed further in our program we need the return value and hence want an idea to approach this issue.

Please suggest any means to solve this problem.

Many thanks,

Chaithanya.

2 REPLIES 2

Former Member
0 Kudos

You can divide your program into two parts. Whatever part of the program is based on the return code, copy that into a separate remote function module. lets call it as FM1.

Inside the RFC that gets executed as a background task, you can call function module FM1 and pass back all the values including the return code.

Thanks.

Ganesh.

0 Kudos

Hi Ganesh,

Thanks for the reply.

We already have an alternate solution to adjust the design of the Z program but we want to try out any possible solutions from SAP standard (any flag to be set or any settings to be done) instead of changing the design of our Z program.

We would be really glad to have such a solution as the design change would take a lot of effort and is similar to developing a new program.

Regards,

Chaithanya.