onscreen

The onscreen command specifies screen blocks used for combining operations from multiple screens or transactions.

The onscreen command is used to specify the screen blocks that are used when combining operations from multiple screens into a single script. This command is especially useful for executing operations that are initiated on a different screen as it is possible to initiate an action in one transaction and have it take place in a different transaction. This command is also used to write a single script that contains actions that take place on all necessary screens of a single transaction. The syntax is as follows:

onscreen 'SAP Dynpro Name'

Options

The onscreen command does not take any options.

Example

In the following example, we will use the onscreen command to initiate an action from the Easy Access screen that will then execute in the VA01 transaction. Specifically, we will set certain fields on the SAPMV45A.0101 and SAPMV45A.E4001 screens in a script that is entirely housed in the SAPLSMTR_NAVIGATION.E0100.sjs script file. We will trigger this action with an onUIEvents command and use the onscreen command to specify what actions occur on which screens.

  1. In the Easy Access screen script file, enter the following code:

    onUIEvents['Enter']{"fcode":"/nva01","process":z_test};
  2. Now create a function that will execute the process. An example is shown below:

    function z_test() {
    onscreen 'SAPMV45A.0101'
    	set("F[Order Type]", "OR);
    	set("F[Sales Organization]", "1000");
    	set("F[Sales Distribution]", "10");
    	set("F[Division]", "00");
    	enter();
    onscreen 'SAPMV45A.4001'
    	set("F[Sold-to party]", "1460");
    	enter();
    }
    					
  3. Click Enter on the Easy Access screen. The function will execute and the results will appear as follows: