Ansicht
Dokumentation

SAPBC415_RFCASYNC_D2B - Asynchr. RFC: SET/AT USER-COMMAND, CALL SCREEN --> Problems ...

SAPBC415_RFCASYNC_D2B - Asynchr. RFC: SET/AT USER-COMMAND, CALL SCREEN --> Problems ...

RFUMSV00 - Advance Return for Tax on Sales/Purchases   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

Description

This program demonstrates remote function call techniques.

A function module is called asynchronously from a DO loop. The number of times that the system runs throught the loop can be set with the help of a parameter.
The call is programmed in such a way that results can be received from function modules that are running asynchronously (PERFORMING addition). In the corresponding subroutine, all function modules that return results are kept track of by a counter (COUNT_FORM). These function modules also trigger the AT USER-COMMAND event with SET USER-COMMAND. In the meantime, another tally is being kept by a counter in the AT USER-COMMAND processing block (COUNT_AT). One would expect that both of these counters would have the same value at the end of the program. This is, however, not the case, since the event AT USER-COMMAND cannot be triggered in certain processing situations (due to the fact that the processing occuring at that time is not allowed to be interrupted).
A CALL SCREEN command directly follows the DO loop. As long as this CALL is open, returning function modules cannot trigger the AT USER-COMMAND event from the form routine.
You can avoid any problems by giving the function module being called numerous items to process and then rapidly clicking away the screen called at runtime (before the first function module returns and triggers the form routine). This means that AT USER-COMMAND should be executed for each function module called.
Logical conclusion: Use utmost caution when using SET/AT USER-COMMAND to handle the results of asynchronous RFCs.
On the other hand, this is the only way to dynamically refresh your list.

Requirements

Output

Example






BAL_S_LOG - Application Log: Log header data   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 1878 Date: 20240531 Time: 190118     sap01-206 ( 52 ms )