Author Topic: Using getfieldattribute for Liquid UI field  (Read 2031 times)

Sai Siddhartha

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 47
    • View Profile
Using getfieldattribute for Liquid UI field
« on: August 03, 2017, 08:50:45 AM »
Purpose:
To get Liquid UI field attributes using getfieldattribute command.

This example is to use getfieldattribute command for Liquid UI Inputfield.
By using command, it returns the field name, field row, field text row, field column, field text column, field techname, field size and isprotected value.

Liquid UI code:
//on SAPLSMTR_NAVIGATION.E0100.sjs script file

Step 1: Create Liquid UI inputfield on screen
Clearscreen();
inputfield( [6,1], "Liquid UI Field", [6,15],{ "name":"z_field", "size":50,"readonly":true});
 
Step2: Create function to get inputfield attributes
function printInfo(){
    getfieldattribute("F[Liquid UI Field]",
    {"name":"fname", "textrow":"ftextrow",
    "textcolumn":"ftextcolumn",  "row":"frow",
    "column":"fcol", "techname":"ftechname",
    "size":"fsize", "isprotected":"fprotected",
    "header":"fheader",  "columnnumber":"fcolumnnumber",
    "displaycolumnnumber":"fdisplaycolumnnumber",
    "width":"fwidth"});
    println("Printing Field attributes!");
    println("\t fname = " + fname);
    println("\t ftextrow = " + ftextrow);
    println("\t ftextcolumn = " + ftextcolumn);
    println("\t frow = " + frow);
    println("\t fcol = " + fcol);
    println("\t ftechname = " + ftechname);
    println("\t fsize = " + fsize);
    println("\t isprotected = " + fprotected);
}

After execution these values can be checked in cornelius window by using println statements.

Note: getfieldattribute can also be used to fetch attributes of SAP native fields and other Liquid UI elements such as radiobutton,checkbox,pushbutton,textfileld and groupbox.

See attachment for screenshots