Liquid UI - WS Reference Library

getfieldattribute() example


Purpose

The getfieldattribute() command can be used to return pushbutton attributes.

This example explains on how to display icon ID, tooltip and label values of a pushbutton using the name option of the getfieldattribute(). The properties of the field object can also be used as options in the field name command. Please do the following:

Script Details

  1. Open the script file for the Easy Access screen (SAPLSMTR_NAVIGATION.E0100.sjs).
  2. Enter the following code:
    del("X[IMAGE_CONTAINER]");
    pushbutton([5,25], "@01\\QHELLO@Pushbutton attributes",{"process":printbutton});
     function printbutton(buttonName)
     {
     getfieldattribute("P[Pushbutton attributes]", {"name.icon":"fbuttonicon","name.tip":"fbuttontip", "name.label":"fbuttontext"});
     println("\t fbuttonicon = " + fbuttonicon);
     println("\t fbuttontip = " + fbuttontip);
     println("\t fbuttontext = " + fbuttontext);
     }
  3. Add an onscreen pushbutton or an enter command to trigger the process. We will use a pushbutton and the code is as follows:
    pushbutton([5,25], "@01\\QHELLO@Pushbutton attributes",{"process":printbutton});
  4. Save the file and launch SAP.
  5. Go to the Easy Access screen and press the pushbutton.


User Interface

The following output appears on the Console screen, as shown:


 

Note: To display output on the screen, use the message command.