getfieldattribute

The getfieldattribute command is used primarily to get the attributes both of a given native SAP screen element and of a user-created GuiXT screen element. The getfieldattribute command uses the following syntax:

getfieldattribute(fieldName, {"option":value…);

The fieldname is the name of the element. For example, if we have a field 'F[Materials]', the field name would be 'F[Materials]'. This is used to define which screen element's attributes are being returned.

Options

The getfieldattribute command takes the following options:

column

Specifies the column number of a text area for the text field. The syntax is as follows:

{"column":"column_number"}
Note: This option can only be used with tables.
columnnumber

Specifies the ID of a given column in a table. The syntax is as follows:

{"columnnumber":"number"}
Note: This option can only be used with tables.
displaycolumnnumber

Specifies the screen display number for columns in a table. The syntax is as follows:

{"displaycolumnnumber":"number"}
Note: This options can only be used with tables.
header

Specifies the header if the element is a table column. The syntax is as follows:

{"header":"header_name"}
Note: This option can only be used with tables.
isprotected

Specifies if a given screen element is active or not. For edit fields, radiobuttons and checkboxes, '1' equals read-only and '0' equals editable. For pushbuttons, '1' equals inactive and '0' equals active. For all elements, 'null' equals not found. The syntax is as follows:

{"isprotected":1,0}
name

Specifies the onscreen label for a given screen element. The syntax is as follows:

{"name":"element_name"}
row

Specifies the row number of the text area for the given text field. The syntax is as follows:

{"row":"row_number"}
size

Specifies the number of characters a text field can contain. The syntax is as follows:

{"size":"size"}
techname

Specifies the technical name of a screen element (eg. VBKD-BSTKD). The syntax is as follows:

{"techname":"technical_name"}
textcolumn

Specifies the column number of a screen element's label. The syntax is as follows:

{"textcolumn":"text_column_number"}
textrow

Specifies the row number of a screen element's label. The syntax is as follows:

{"textcolumn":"text_row_number"}
width

Specifies the width for columns in a table. The syntax is as follows:

{"width":"width"}

The properties of the field object can also be used as options in the fieldname command. For excample, the name property has several sub-properties, which are as follows:

name.label
Specifies the onscreen label of a given pushbutton or other screen element. Columns in a table are excluded.
name.icon
For pushbuttons, this specifies the icon ID.
name.tip
For pushbuttons, this specifies the tooltip.

Please see the examples for additional information.