Liquid UI - Documentation - 5.02 checkbox()

5.02 checkbox()


Purpose

Using the checkbox() you can create and customize checkboxes as needed. This command allows you to select one or more options from a list, and assign default values or set them as read-only. Moreover, you can position checkboxes parallel to other screen elements, which makes selecting multiple options within a group easier. In this article, you will learn about various formats to use the checkbox command.

 

Note: You can customize the position of the checkbox in different ways. Learn more about positioning the screen elements.


Syntax

You can create checkboxes at desired locations with the required functionalities using the following formats.

Format 1: Adds a checkbox with a label at a specified row and column on the SAP screen.

checkbox([row,col],"label name",{"option":value…});
 

Note: You can create a checkbox using various options. Learn more about this format.

 

Format 2: Adds a checkbox without a label at the specified row and column on the SAP screen.

checkbox("[row,col]","label name");
//Creates a checkbox without options
checkbox("[10,13]","Verified");
 

Note: You can also create a checkbox without options. Learn more about this format.

 

Format 3: Adds a checkbox with a label at specified row and column coordinates relative to the screen element on the SAP screen.

checkbox("F[screen element]+[row,col]","label name",{"option":value});
//Creates a checkbox with respect to Organization Data groupbox field coordinates
checkbox("G[Organizational Data]+[1,35]","Print repair label",{"name":"print_label","default":" "});

 

Note: You can also create a checkbox with respect to other screen elements on the screen. Learn more about this format.


Properties

  • startrow, startcol – row and column co-ordinates
  • label name – name of the checkbox that appears on the screen
  • @0Y@labelname - name of the checkbox with icon
  • @4V\\Qlable Tip@labelname- name of the checkbox with tooltip and icon
  • screen element - field name


Available Options

You can use the following options that are available with the checkbox:

"default":".."

"default":X - Checkbox is selected by default.
"default":" " - Checkbox can be selected or deselected.

"name":".."

"name":"technical name" - Assigns a technical name to the checkbox for Liquid UI scripts reference.

"offset":".."

"offset":coordinates - The 'offset' option is used to position the checkbox relative to another screen element.

"readonly":".."

"readonly":true - Checkbox cannot be selected.
"readonly":isReadOnly - Checkbox is selected by default just like "default":"X" option.


Options Detail

default

  1. This option allows you to pre-select the checkbox. The default option is depicted on the Create Material (Initial Screen), as shown in the image. 

  2. //Creates a checkbox BulkMaterial  
    checkbox([19,49],"BulkMaterial",{"name":"z_mm01_blkmat","default":"X"});
    
  3. "default":X - Checkbox is selected by default
    "default":" " - Checkbox can be selected or deselected.

name

  1. This option lets you assign a unique technical name to the checkbox for Liquid UI script reference.

  2. //Creates a checkbox Final Confirmation  
    checkbox([13,33],"Final Confirmation",{"name":"z_final"});
    
  3. The name assigned to the checkbox acts as a technical name for the Liquid UI script reference

offset

  1. The offset option allows you to place the checkbox relative to the Notification type screen element. The code is as follows:
  2. //Creates a checkbox parallel to Actual work inputfield
    checkbox({"field":"F[Actual work]","offset":[13,33]},"Final Confirmation");
  3. This offset option enables the position of the Final Confirmation checkbox with respect to the Actual work Input Field, as shown in the image.

readonly

  1. This option lets you make a checkbox unavailable for selection/marking. The code is as follows.

  2. //Creates a checkbox Save to Info Record
    checkbox([2,22],"Save to Info Record ",{"name":"check_&V","readonly":isReadOnly});
    //Creates a checkbox Drop ship o checkbox([2,32],"Drop ship o",{"name":"check_&V","readonly":true});
  3. The Save to Info Record checkbox is automatically selected as it is set to isReadOnly. The Drop Ship O checkbox is unselected as it is set to true.  


Example 1:

In this example, we have added a checkbox labeled Reject the order to the Change Sales Order: Initial Screen. This allows the user to easily reject an order upon selection. 

Script

//Creates a checkbox Reject the Order
checkbox({"field":"F[Order]","offset":[0,25]},"Reject the order",{"name":"z_reject"});

Script Details

Figure: Checkbox for rejecting the Sales Order


Example 2:

In this example, we have added a checkbox labeled Print within the Organizational Data group box of the Create Sales Order: Initial Screen. 

Script

//Creates a checkbox within the group box
checkbox("G[Organizational Data]+[1,35]", "Print",{"name":"print_label", "default":" "});
 


Tips and Tricks

  • Adding tips to Checkbox

    Adding tips to the existing checkbox is depicted on the MB1C transaction of the SAP screen. The Code is as follows. 

    //SAPMM07M.E0400.sjs

     //Adds a tip to the Print checkbox 
    tip("C[Print]","Check this to print");

    As per the code, the checkbox labeled Print will have a tip Check this to print on the mouse over it.

  • Adding a Quick info to the Checkbox

    An icon and tip are added to the checkbox, mousehover checkbox displays quick info about it.

    //SAPLMGMM.E0060.sjs

    //Create a checkbox with a tip and icon
    checkbox([1,24],"@01\\Qplease check it to proceed @I Agree");

    As per the code, the checkbox labeled I Agree will have a tip please check it to proceed on mouseover it.

  • Using set command to select the Checkbox

    With the set command, you can pre-check the checkbox by setting the value to "X". Additionally, the checkbox is set as read-only to restrict from selecting. The code is as follows

    //SAPLMGMM.E0060.sjs

    //Creates a checkbox I Agree
    checkbox([1,24],"I Agree",{"readonly":true});
    set("C[I Agree]","X");

    As per the code, the checkbox labeled I Agree is pre-checked and cannot be marked since it is read-only.

  • Deletes a Checkbox

    Using the del(), you can delete the checkbox on the SAP screen. 

    //SAPLMGMM.E0060.sjs

    //Deletes Bulk Material checkbox 
    del(“C[BulkMaterial]”);


Usage Details


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