Liquid UI - Documentation - 19.15 Return values from new session

19.15 Return values from new session


Prerequisites


Purpose

This article guides you on how to pass field values from a new session to an old session using returnvalues() to increase data accuracy and reduce data entry steps. The following steps will guide you through the process.

  1. Delete unnecessary elements on the SAP Easy Access screen
  2. Add an input field to display the value
  3. Add a push button to read the values into an input field
  4. Add a function to return values from a new session to an old session.
 
Note:Available from WS Version 1.2.295.0 and Liquid UI Server Version 3.5.522.0 onwards!


User Interface

//Create this file inside your script folder for customizing the SAP Easy Access screen, SAPLSMTR_NAVIGATION.E0100.sjs

//Now, let's add the Liquid UI script to the above file and save it.


Customization

  1. Delete unnecessary elements on the SAP Easy Access screen.
     
    //Deletes all elements on the screen
    clearscreen();
    
     
     
  2. Add a non-editable input field labeled PO Number to display the PO Number of a Sales Order.
     
    //Creates an non-editable input field  with a label as PO Number 
    inputfield([1,0], "PO Number", [1,16], {"size":18, "name":"z_ponum", "readonly":true});  
    
     
     
  3. Add a toolbar push button labeled Test - returnvalues to open the Change Sales Order: Initial Screen in a new session. Upon clicking, execute the 'readPONum' function with the 'l_order' parameter set to 5004.
     
    //Creates a push button with a label as Test-returnvalues and executes the va01_test function on click
    pushbutton([TOOLBAR], "Test - returnvalues", "/oVA02", {"process":readPONum, 'using':{'l_order':'5004'}});   
    
     
  4. Add a file named function.sjs in your script folder to store and access multiple functions from a script file.
     
    //Create a script file called function.sjs which includes two functions readPONum and processOldSession  to return values from a new session to old session
    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('?');
    }  
    
     

SAP Process

  1. Refresh the SAP Easy Access screen. Click the Test - returnvalues toolbar push button to open the Change Sales Order: Initial Screen, where the Order input field is pre-populated with PO Number 5004, as shown below.
     
     
  2. Hit enter, and the system retrieves the PO Number, exits the new session, and displays the corresponding purchase order number in the old session's PO Number input field, as shown below.
     
     


Next Steps

Attach VB script to SAP
Learn how to attach a script file to your SAP Liquid UI

10 min.

This article is part of the Invoking functions tutorial.

Validate Japanese Half-Width(Hankaku) Katakana Character
Learn how to validate and display the katakana character range.

10 min.

This article is also a part of the Javascript functions tutorial.


Can't find the answers you're looking for?