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

Calling Synchronous RFC Function Module in Background

Former Member
0 Likes
2,299

Hi all,

Currently we are working on some requirement where in we have to retrieve data from one system(CRM) and update the same into another system(ECC). We have developed a RFC Function in CRM system and it is being called from ECC system as in synchronous mode via a batch program.

Now since all sychronous call to a RFC function will be dialog there is a constraint on the runtime which is being set by maximum run time for each dialog work process. So my question is there an option to call an RFC function synchronously in background (background task) so there is no runtime performance.

The standard TRFC, QRFC calls in background runs asynchronously and so I am trying to check with the SDN world as whether has anyone tried SRFC(Synchronous) call in background?

Thanks in advance,

Jagath

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,489

So my question is there an option to call an RFC function synchronously in background (background task) so there is no runtime performance.

One solution would be to increase the value of the "time out" parameter defined the CRM system. This i feel is not a fool-proof solution as the run-times cannot be predicted. Check this thread:

For me a better solution would be to implement tRFC call instead of a synchronous call. Any reasons why you don't want to implement a tRFC ?

BR,

Suhas

Edited by: Suhas Saha on Jun 26, 2010 8:52 AM

6 REPLIES 6
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,490

So my question is there an option to call an RFC function synchronously in background (background task) so there is no runtime performance.

One solution would be to increase the value of the "time out" parameter defined the CRM system. This i feel is not a fool-proof solution as the run-times cannot be predicted. Check this thread:

For me a better solution would be to implement tRFC call instead of a synchronous call. Any reasons why you don't want to implement a tRFC ?

BR,

Suhas

Edited by: Suhas Saha on Jun 26, 2010 8:52 AM

Read only

Former Member
0 Likes
1,489

Thanks Suhas for your inputs.

Well my requirement is to retreive the transaction data from CRM system into ECC system and update the same into corresponding tables in ECC at the same instance. so if I have to run the RFC call in TRFC mode then the calling program will proceed and complete processing without the called program being complete or incomplete. The called program might get triggered based on the commit work being executed by the called program.

Read only

0 Likes
1,489

> (Jagath:) is there an option to call an RFC function synchronously in background \[...\]

> \[...\] has anyone tried SRFC(Synchronous) call in background?

and

> (Suhas:) a better solution would be to implement tRFC

Any RFC processing (sRFC, aRFC, tRFC, qRFC, etc.) is done in the dialog workprocesses, so there is always a timeout (the one of profile parameter indicated by Suhas). Launching RFC from a background workprocess doesn't change anything

Jagath, you need to do several RFCs so that each of them don't take too much time. If you're not sure about the maximum amount of data that can be processed by each RFC call, enter the amount in a customizing table so that you can adjust it to best fit the system capacity.

Read only

Former Member
0 Likes
1,489

Thanks Sandra..

Well this was helpful, as I was trying to look whether is there a way to call a RFC suign background work process. But this is interesting given the fact we have all batch job functionality, RFC's in dialog is kind of lag back in approach when we need to process bulk data and that we have to split the interval.. SAP must provide some work around with this one.

Read only

0 Likes
1,489

In that case, you must trigger a background job (I don't speak about *RFC of course) and scan the job status via RFC until the job ends.

Note that if you were able to split the process in small chunks, instead of calling the RFC several times, you might call the RFC once and avoid the timeout by calling TH_REDISPATCH function module as explained in [note 25528 - rdisp/max_wprun_time|http://service.sap.com/sap/support/notes/25528]. Note that a database commit is also triggered.

Read only

Former Member
0 Likes
1,489

HI Sandra,

Do you have an example of your solution how to verify the status of a remote FM ?