Selecting radiobuttons

In the following example, we have two radiobuttons on the Easy Access screen, each containing a unique value but with the same variable name. In the target screen, we have corresponding radiobuttons, which will be selected based on the user's action on the initial screen. Therefore we will set the state of the target radiobuttons based on which radiobutton the user selects on the initial screen.

  1. Go to the VA01 screen in SAP.
  2. Open the script file (SAPMV45A.E0101.sjs) and enter the following code to create the radiobuttons. Create the file if it does not already exist.
    pushbutton([TOOLBAR],"Movement Type","/nmb1c",{"process":z_test});
            radiobutton([1,25],"Indvidual Slip" , {"name":"z_radio", "value":"A"});
            radiobutton([2,25],"Collective Slip" , {"name":"z_radio", "value":"B"});
            
  3. Add the function code that will actually pass and assign the values on the overview screen. An example is shown below:
    function z_test() {
            onscreen 'SAPMM07M.0400'
            if(z_radio=="A") {
              set("R[Individual Slip]","X");
              }
              if(z_radio=="B") {
                set("R[Collective Slip]","X");
              }
            }
            
  4. Save your changes and refresh the SAP screen.

    The screen will display as shown below:



Click the toolbar button to initiate the process. When the process has run, the target screen will appear as shown below::