Passing parameters to onUIEvents

In the following example, we will pass some parameters to the onUIEvents command with the 'using' option. To demonstrate this, please do the following.

  1. Open the Easy Access script file (SAPLSMTR_NAVIGATION.E0100.sjs) and enter the following code:
    onUIEvents['Enter']={"fcode":"/nva02","process":test_UIEvent, "using":{param_1:15965}};
    text([4,1],'This example includes the execution of UI action Enter. Hit Enter to execute process');
    			
    Note: The parameter we will pass is the value '15965'.
  2. Now create a function that will actually do the work of passing the parameter. An example is shown below:
    function test_UIEvent(param){
    	onscreen 'SAPMV45A.0102'
    		set("F[Order]" , param.param_1);
    	enter();
    	onscreen 'SAPMV45A.4001'
    	enter();
    }
    			
  3. Save your changes.
  4. Launch SAP and navigate to the Easy Access screen. Then press the enter key to initiate the process.

The function will execute and the VA0s screen will now appear as shown below: