Mentor SAP

Synchronous Program Calls

You have the following two options when calling another program synchronously:

 

Complete programs can only run in a sequence within a single user session. This is referred to as sequential calls. To run activities in parallel (known as asynchronous processing), you must use function modules.

 

Note: More information on asynchronous execution is available in other training courses and in the ABAP keyword documentation for the CALL FUNCTION ... STARTING NEW TASK ... statement.

 

 

Synchronous Calls of Executable Programs

To call an executable (type 1) program, use the SUBMIT statement. If you use the VIA SELECTION-SCREEN addition, the system displays the standard selection screen.

If you use the AND RETURN addition, the system resumes processing with the first statement of the calling program after the SUBMIT statement, once the execution of the called program finishes.

 

Note: For more information, see the ABAP keyword documentation for the SUBMIT statement.

 

 

Passing Data Using the Program Interface

When you call ABAP programs that have a standard selection screen, you can pass data for the input fields in the call.

Data for input fields can be passed in the following ways:

 

 

Pre-assignment of Input Fields

The WITH addition in the SUBMIT statement allows you to assign values to the fields on a standard selection screen. The relational operators such as EQ, NE, and so on, and the inclusion operators I and E have the same meaning as when they are used with SELECT-OPTIONS.

 

If you want to provide several values for a select option, use the RANGE type instead of individual WITH additions. Using the RANGE type creates a selection table that you can fill, as though it were a select option. Then pass the table to the executable program.

 

Synchronous Transaction Calls

If you use the LEAVE TO TRANSACTION 'T_CODE' statement, the system terminates the current program and starts the transaction with transaction code T_CODE. This statement is the equivalent of entering /NT_CODE in the command field.

 

With the CALL TRANSACTION ‘T_CODE’ statement, execution of the calling program is paused until the called program finishes its execution.

 

You can use the LEAVE PROGRAM statement to force the termination of a program. For cases in which this statement executes in a program called by CALL TRANSACTION 'T_CODE' or SUBMIT prog_name AND RETURN, the calling program will continue with the next statement after the original call. In all other cases, the system returns to the application menu from which the user started the program.

 

If you use the ... AND SKIP FIRST SCREEN addition, the system does not display the contents of the first screen in the transaction.

 

Caution: However, the flow logic of this first screen is processed.

 

 

Passing Data when Calling a Transaction

When you call a transaction using the CALL TRANSACTION 'T_CODE' USING gt_bdcdata statement, you can run transaction T_CODE using the values from internal table gt_bdcdata in the screen fields.

 

This internal table must have the global structure type BDCDATA, and you should fill it accordingly.