Liquid UI - WS Reference Library

radiobutton()


Purpose

With radiobutton(), you can add or modify radiobuttons on a SAP screen. Radiobutton has the following two states:

  • Selected: When set to 'X', application trigger an event.
  • Unselected: When set to '' or null, no action occurs.

The states can be used to determine the value to pass. You can use radiobuttons to replace a set of inputfields with default data sets, to select fields and values that will populate on user selection.


Syntax

radiobutton([startrow,startcol],"Label name",{"option":value…});

To refer to a field on the same screen, use the field in the radiobutton as shown below:

radiobutton([startrow,startcol],"Label name",{"F[field_name]":"value"}); 


Properties

  • startrow,startcol – row & column co-ordinates
  • Label name – label for radiobutton
  • @0Y@Label name - name of the field with icon
  • @4V\\Qlabel Tip@Label name - name of the field with tool tip and icon


Available Options

You can use the following options with the radiobutton:

"default":".."

"default":true - Sets the radiobutton on which this option is used.

"name":".."

"name":"z_radiobutton" - Enables users to assign a Liquid UI name to the radiobutton.

"readonly":".."

"readonly":true - Specifies that a radiobutton is not editable.

"value":".."

"value":"value" - Assigns value to a radiobutton.


Options Detail

default

  1. This option will make a radiobutton pre-selected. The default option automatically deactivates the other checkboxes or radiobutton in that group.

  2. radiobutton([1,10],"Current Version",{"name":"z_mm01_ver","value":"CV","default":true});
  3. As per the code the radiobutton is selected by default.

name

  1. This option assign technical name to the radiobutton name for Liquid UI scripts. A technical name does not appear on the screen.

  2. radiobutton([1,10],"London",{"name":"z_VA0X_salesOrg"});
  3. As per the Liquid UI scripts, we define radiobutton name as {"name":"z_radiobutton"}.

readonly

  1. The readonly option makes a radiobutton unavailable for selection. You can use the option for a radiobutton not intended for use.

  2. radiobutton([1,10],"Return Via Truck (YE)",{"name":"z_va0x_shipCond","value":"YE","readonly":true});
  3. When readonly is set to true, the user cannot make any selection on the radiobutton.

value

  1. The value option assign a value to a given radiobutton. This is very useful when assigning field values to radiobuttons or for passing parameters to other screens.

  2. radiobutton([1,10],"Canada",{"name":"z_VA0X_salesOrg","value":"9400"});
  3. The value option for radiobutton is used for assigning field value.


Example

The following examples demonstrate the usage of radiobutton options:


Script

radiobutton([11,19],"Non Foods",{"[Material Type]":"NOF1"});
radiobutton([10,19],"Product Catalogs",{"[Material Type]":"WERB"});
radiobutton([9,19],"Packaging",{"[Material Type]":"VERP"});
radiobutton([8,19],"Finished Product",{"[Material Type]":"FERT"});

Script Details


Tips and Tricks

  • Restricting User Input with Radiobutton

    Many times, when developing a more efficient design for an SAP screen, we want to restrict the user input to only a few options.

    radiobutton([7,45,],"Finished product",{"[Material Type]":"FERT"});

    Learn more about Restricting User Input with Radiobutton in MM01 transaction.

  • Radiobutton with inputfields

    You can assign multiple inputfields for single radiobutton. When you click on this radiobutton, the corresponding values are passed to inputfields.

    radiobutton([2,50],"Get Details",{"name":"z_get_details","[Order Type]":"OR","[Sales Organization]":1000","value":"10"});

    As per the code, the values are passed to inputfields on clicking radiobutton. User has to just hit enter to navigate to next screen.