Liquid UI - WS Reference Library

returnvalues


Prerequisites


Runs On

  SAP GUI Android iOS WM Web
Direct Connect          
Liquid UI Server Connect        

Purpose

To read data by opening a new session and continue processing in the old session using the data read from the new session.
In this example, when the ‘Test - returnvalues’ toolbar pushbutton is clicked, transaction code VA02 is opened in a new session and the PO Number is read and the new session is exited and the PO Number is displayed in the old session. This is extremely useful when data has to be passed or returned from a new session while processing data in the old session.

NOTE - Available from WS Version 1.2.295.0 and Liquid UI Server Version 3.5.522.0 onwards!

User Interface

Log into SAP and on the SAP Easy Access Screen click on the ‘Test – returnvalues’ TOOLBAR pushbutton.


Liquid UI Script

//ESESSION.SJS

load('functions.sjs'); 


// SAPLSMTR_NAVIGATION.E0100.sjs

clearscreen();
inputfield([1,0], "PO Number", [1,16], {"size":18, "name":"z_ponum", "readonly":true});   
pushbutton([TOOLBAR], "Test - returnvalues", "/oVA02", {"process":readPONum, 'using':{'l_order':'5004'}});      


//functions.sjs

function readPONum(param){
   onscreen 'SAPMV45A.0102'
      set('F[Order]',param.l_order);
      enter();
   
   onscreen 'SAPMSDYP.0010'
      enter();
      
   onscreen 'SAPMV45A.4001'
      set('V[z_va02_ponum]','&F[PO Number]');
      returnvalues({'fcode':'?','process':processOldSession,'using':{'l_ponum':z_va02_ponum}});
                enter('/i');   
}
 
function processOldSession(param){
   onscreen 'SAPLSMTR_NAVIGATION.0100'
      set('V[z_ponum]',param.l_ponum);
      message('S: Read PO Number successful!');
      enter('?');
}