column

The column command is used to define and modify column controls in WS.

This command can both add columns to an existing table and change existing columns in a given table. You can specify the column headings, widths, positions within the table and other options for new columns. The syntax is as follows:

column("heading", {"size":x, "name":"column_name", "option":value…});

In addition to being capable of operating on a native SAP table control, the column command also can be used in conjunction with the WS table command to create new columns in a user-created table, as shown in the following example. First we will use the table command to create a new table:

table([2,1], [20,50], {"name":"va01_lnitms", "title":"All Items", "rows":100});

Then we will use the column command to add columns to our new table control as follows:

column('Item', {"table":"[All items]", "size":5, "name":"va01_clitm", "position":1});
column('Material', {"table":"[All items]", "size":18, "name":"va01_clitm", "position":2});
column('Quantity', {"table":"[All items]", "size":10, "name":va01_clitm", "position":3});
column('Item Category', {"table":"[All items]", "size":10, "name":va01_clitm", "position":4});

Please note that users should always specify the table name when adding columns to a GuiXT table as in the preceding example. Users can employ either the name value or the title value in the table option - both are supported from the XXX release. However, when using the table option in the column command, Synactive recommends using the value of the 'name' option instead of the value from the 'title' option as that will eliminate the possibility of confusion.

Options

The column command takes the following options:

alignright

The field value will be aligned to the right if this is set to 'true'. This option only works if the field is also in readonly mode. The syntax is:

{"alignright":true}
checkbox

The column value will be displayed as a checkbox if this option is set true. Possible values are X and ' '. The syntax is:

{"checkbox":true}
intensified

The field value is displayed in a color other than black if this option is set to 'true'. The default color is red. The syntax is:

{"intensified":true}
Note: This option cannot be used with the 'readonly' option
keycolumn

If the user adds or deletes rows in a SAP table, the 'absrow' row number can change. The matching index will also disappear in this case, so the 'keycolumn' option is used to relate the new column to another column in order to create a consistent reference. If this option is used, automatic indexing of the custom column will be based on the value of the assigned keycolumn, meaning that when you scroll, a one-to-one reference is created between your new column and the keycolumn. The syntax is:

{"keycolumn":"XYZ"}
Note: The 'XYZ' value is the label of the existing SAP column. This option can only be used with native SAP tables.
name

Specifies the name of the column. This is not the label visible to the user but rather the internal name of the column by which scripts may refer to it. The syntax is as follows:

{"name":"xxx"}
numerical

Only numerical input is allowed if this option is set to 'true'. The syntax is:

{"numerical":true}
Note: This option cannot be used with the 'uppercase' option.
position

Specifies the position of the column within the table. If the position option is left unspecified, the new column will be the last column in the table. The syntax is:

{"position":x}
readonly

Specifies that the new column will be non-editable and no input will be allowed. The syntax is:

{"readonly":true}
Note: This option cannot be used with the 'intensified' option
size

Specifies the size in number of characters where 'x' will be replaced by a number. The syntax is:

{"size":x}
searchhelp

Defines the searchhelp (F4) for the new column. The syntax is as shown below:

{"searchhelp":"value"}
table

Specifies the table in which the column will be created. This option is only necessary if more than one table are present on the given screen. The syntax is:

{"table":"T[table_name]"}
techname

Defines the technical name of the column. The syntax is as follows:

{"techname":"table_tech_name"}
uppercase

Only uppercase input is allowed for the column if this option is set 'true'. The syntax is shown below:

{"uppercase":true}
Note: This option cannot be used with the 'numerical' option.