‎2004 Nov 11 1:04 PM
I need to perform a call to a remote system and receive a response asynchronously (that is the response will be a out of band call back into another RFC). What i need is to synchronize the request and response. That is, i want to be able to make the async call, than wait for an event which be set by the async receiving rfc. The rfc receiving the call should be able to provide me with the response values. How can this be done?
‎2004 Nov 11 1:15 PM
Can you use the statements:
CALL FUNCTION 'RFC_SYSTEM_INFO'
STARTING NEW TASK 'INFO'
PERFORMING RETURN_INFO ON END OF TASK.
FORM RETURN_INFO USING TASKNAME.
RECEIVE RESULTS FROM FUNCTION 'RFC_SYSTEM_INFO'
IMPORTING RFCSI_EXPORT = INFO.
ENDFORM.
Best regards Jack
‎2004 Nov 11 1:19 PM
Hi Neer,
if I understood your problem correctly this is what you can do:
1. call a function via rfc.
2. the called function is doing the requested stuff
3. after all, it is calling a function via rfc and passing the result
4. this called function raises an event and posts teh results into memory
5. a new or your first program reacts on this event
regards
Siggi
‎2004 Nov 11 1:20 PM
Hi,
do you know about these?
<b>CALL FUNCTION func STARTING NEW TASK task DESTINATION ... [{PERFORMING subr}|{CALLING meth} ON END OF TASK].</b>
Asynchronous call of a remote-enabled function module.
The addition specifies either a subroutine <b>subr</b> or, as of release 6.20, a method <b>meth</b> as callback routine, which is executed after terminating the asynchronously called function module. Prerequisite for the execution of the callback routine is that the calling program still exists in its internal mode when the remote function is terminated.
<b>RECEIVE RESULTS FROM FUNCTION func</b>
You can use this statement in a callback routine specified in an asynchronous RFC to receive output parameters of an asynchronously called function module.
<b>WAIT UNTIL log_exp [UP TO sec SECONDS]. </b>
Interrupts program execution for as long as the result of the logical expression log_exp is incorrect. If the result of log_exp is incorrect, the program waits until a callback routine of a previous function that was called asynchronously was executed and then checks the logical expression again.