1. synchronous call from Program There are two ways to call other ABAP programs synchronously: 1. The calling program is interrupted. After the called program is executed, the calling program continues to run. For example, call function <function> submit <program> and returncall transaction <tcode> When the call function 'aaa' is used to call FM, the corresponding function group is loaded to the internal session of the calling program. When the FM execution is complete, run the calling program. Function Group and its global data are stored in this internal session until the calling program ends. When the caller calls the FM again, the corresponding function group is not loaded again. The global data of this functon group is the same as that of the first call to it.
When submit <program> and return or call transaction <tcode> is used, a new internal session is inserted. After the called program is executed, the newly inserted internal session will be deleted and the calling program will be executed. You can use the leave Program Statement to end the program.
2. The called program is ended and executed by the called program. For example, submit <program> Leave to transaction <tcode>. after the submit statement is used, the calling program is deleted from the internal session, and the called program is loaded to this internal session. After leave to transaction <tcode> is used, all internal sessions in the current external session will be deleted and a new internal session will be generated, the called tcode is loaded into the new internal session. Note that, after using this statement, ABAP memory will be initialized, meaning that you cannot pass a value to the called tcode through ABAP memory. 2. Call the function 'aaa' starting new task asynchronously by the function module <taskname>
Discovery Ming <subroutine>On End Of Task Exporting ..... After the preceding statement is used, AAA runs in parallel with the program that calls it. You can use the receive results from function 'aaa' statement in <subroutine> to obtain the function running result. It is worth noting that the processing type of FM in the form of starting new task must be the remote-capable module. 3. Logical Memory A user session can have multiple external sessions. You can understand that when you open several sap windows, there are several external sessions, which are generally set to 6. An external session can have multiple internal sessions (up to 20, think about why the list lsind cannot exceed 20 ). A program is generally processed in an internal session. You can use ABAP memory (export/import) and SAP memory (get/set) to transmit data between different programs. A user session has an SAP memory. All sessions in this user session can access sap memory. However, SAP memory is generally used to transmit values between internal sessions of different external sessions. Each external session contains an ABAP memory. The internal session of this external session can access this ABAP memory. ABAP memory is suitable for transferring values between different internal sessions of an external session. When the external session ends, its ABAP memory is automatically released.