Author Topic: returnvalues Command  (Read 6489 times)

Benjamin Dasari

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 96
    • View Profile
returnvalues Command
« on: October 13, 2016, 10:20:16 AM »
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 the below 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!

Liquid UI Code:

//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('?');
}   


See attachments for code samples!
« Last Edit: October 13, 2016, 11:09:31 AM by Benjamin Dasari »