cancel
Showing results for 
Search instead for 
Did you mean: 

How can I not wait for a RFC response

Former Member
0 Kudos

Hi everyone, i want to execute an RFC and not wait for the response, i don´t care, so, is there a way to achieve this ? thanks

Accepted Solutions (1)

Accepted Solutions (1)

Abhinav_Sharma
Contributor
0 Kudos

Hello Isaac,

If you are calling the RFC from WebDynpro then you have to wait for the RFC response. However, there is a way that you can get early response from a RFC.

Suppose you are using RFC1 in your program and it contains business logic. Now, don't directly call the RFC1, instead, write another RFC2 which calls RFC1 asyncronously. This way, when you call RFC2 it automatically call RFC1 and does not wait for any response for RFC1

You can call RFC1 from RFC2 asynchronously:

CALL FUNCTION RFC1 STARTING NEW TASK taskName

Your WD application will immediately get a response from RFC2 while RFC1 still executing.

To know more about asynchronous RFC refer [Parallel Processing with Asynchronous RFC |http://help.sap.com/saphelp_nwpi71/helpdata/en/22/0425c6488911d189490000e829fbbd/content.htm]

Hope this helps

Abhinav

Former Member
0 Kudos

Hi Abhinav thanks a lot for your response , so if I understand, when my WD app execute the model (RFC1), the Bapi i called needs to have the CALL FUNCTION RFC2 STARTING NEW TASK taskName instruction, and the RFC1 response while the bapi really is executing rfc2..... its like the concept of creating a child thread ?

thanks

Abhinav_Sharma
Contributor
0 Kudos

Hi Isaac,

Please see my comments for your queries:

The Bapi i called needs to have the CALL FUNCTION RFC2 STARTING NEW TASK taskName instruction

--- Yes, this BAPI should call RFC2 which you were calling directly from your WD application before.

RFC1 response while the bapi really is executing rfc2

--- Yes, as RFC2 starts executing independently of RFC1. RFC1 will not wait for the response from RFC2 and can be executed to completion

its like the concept of creating a child thread ?

--- Not exactly as child thread can not be in execution if parent threads terminated. It is the comcept of parallel processing where you are calling RFC2 asycnhronously. RFC1 will be executed irrespective of the outcome of RFC2. So you should take care of error/exception handling.

Hope this answer your queries.

Abhinav

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks you a lot, now i get it .