Liquid UI - WS Reference Library

onscreen()


Purpose

With onscreen() command, you can specify screen blocks that are used for combining operations from multiple screens or transactions 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.


Syntax

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 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 in which screens.

  1. In the Easy Access screen script file, SAPLSMTR_NAVIGATION.E0100.sjs, and enter the following code:

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

    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. On the Easy Access screen, press Enter key.

The function executes and the Sales Order screen appears, as shown: