Passing values on a different screen

In the following example, we will use a set of radiobuttons to pass values from the VA01 Initial Screen to the VA01 Overview Screen. We will employ the set and the onscreen commands to assign values. Once you select a radiobutton and press enter, the associated value will be placed in the Order Type field.

  1. Go to the VA01 screen in SAP.
  2. Open the script file (SAPMV45A.E0101.sjs) and enter the following code. Create the file if it does not already exist.
    				radiobutton([12,0],"Customer 1460" , {"name":"z_cust", "value":1460});
    radiobutton([13,0],"Customer 1480" , {"name":"z_cust", "value":1480});
    				
  3. Add the code that will actually pass and assign the values on the overview screen:
    				onscreen 'SAPMV45A.4001'
    	set("F[Sold-to party]", "&V[z_cust]");
    	set("F[Ship-to party]", "&V[z_cust]");
       enter();
    				
  4. Save your changes and refresh the SAP screen.

    The screen will display as shown below:



Once you select a radiobutton and press Enter, the value associated with the radiobutton you selected will be passed to the designated field on the Overview screen as shown below: