Application Development and Automation 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: 
Read only

CALL function IN BACKGROUND TASK

Former Member
0 Likes
2,926

Hi,

I am calling a FM like as shown below: (this FM is defined as RFC FM)

CALL function IN BACKGROUND TASK

But when the FM gets executed, it is running in one of the dialog process as opposed to background process. Is it how it suppose to work or It should triggered the FM in background process?

Basically we want this function call to be executed in background process. The reason being; for the process this FM is used, sometimes take more time (more that the "timeout" limit). We want the FM to run in background task so the "timeout" limit does not affect this.

Let me know if anyone has the solution.

Thanks,

Pratik

4 REPLIES 4
Read only

naimesh_patel
Active Contributor
0 Likes
1,362

I guess it will run in the background.

Check this help:

http://help.sap.com/saphelp_nw04/helpdata/EN/22/042578488911d189490000e829fbbd/frameset.htm

Help says:

The remote system need not be available at the time when the RFC client program is executing a tRFC. The tRFC component stores the called RFC function together with the corresponding data in the database of the SAP system, including a unique transaction identifier (TID).

If a call is sent, and the receiving system is down, the call remains in the local queue until a later time. The calling dialog program can proceed without waiting to see whether or not the remote call was successful. If the receiving system does not become active within a certain amount of time, the call is scheduled to run in batch.

If it is not running in the background than how it will keep on checking that the target system is on or not.

Regards,

Naimesh Patel

Read only

0 Likes
1,362

Thanks for your reply.

You asked,

If it is not running in the background than how it will keep on checking that the target system is on or not.

I do not think that something needs to be run in background to check if the target system is on or not. It is the tRFC component which store the data in SAP and checks if target system is on. If it is on, it makes the call and if it is not then it waits for some spefic time and then schedule the same to run in batch.

In my case, the target system is always the same system I am making the call from. Which means, I am calling the FM in same system. So it will never happen that the target system is down.

I did not find any documentation which says clearly that IN BACKGROUND TASK execute the FM in background process in target system. So i am confused if it is working fine as is (executing in dialog process) or something nees to be done (either programatically or BASIS has to do sometthing) to make it run in background task.

Thanks,

Pratik

Read only

Former Member
0 Likes
1,362

Hi,

you can create a background job in the IN BACKGROUND TASK FM and let the batch job do the processing..so that it will not have timeout issue.

Ex..

CALL FUNCTION 'Z_TEST' IN BACKGROUND TASK.

FUNCTION Z_TEST.

SUBMIT z_batchjob VIA JOB

WITH vbeln = input_vbeln..

.............

ENDFUNCTION.

Hope this helps..

Thanks

Naren

Read only

Former Member
0 Likes
1,362

Hi Pratik,

I am also facing the same problem.

have you find any solution or anything to make the FM run in background.

If you found any solution or any configuration settings pls let me know

Thanks,

Taj