Purpose
With the column(), you can add a column in both native SAP tables and the Liquid UI tables.
Furthermore, you can add checkboxes, and push buttons within the column. In this article, you will learn various options to use the column command.
Syntax
You can add columns to the tables with the required functionalities using the following formats.
Format 1:
Adds a column to the specified native SAP table
column('heading',{"table":"[tablename]","name":value,"size":value,"option":value..});
Format 2:
Adds a column to the table on the screen; here, the size option is mandatory to create a column.
column('heading',{"name":value,"size":value,"option":value..}); // size option is mandatory to create a column column('heading',{"size":value});
Note: You can create a column in the SAP tables using various options. Learn more about this format.
Format 3:
Adds a column to the mentioned table at the specified row and column.
table([startrow,startcol],[endrow,endcol],{"name":"table name","title":"table title","rows":number}); column('heading',{"table":"[tablename]","name":value,"size":value,"option":value..});
Note: You can create a column in the Liquid UI table using various options. Learn more about this format.
Properties
- heading - column heading
Available Options
You can use the following 16 options in the column command:
"alignright": true - This option will align the field value to the right when set to 'true'. |
|
"checkbox": true - The column value will be displayed as a checkbox if this option is set to true. Possible values are X and ' '. |
|
"intensified": true - The field value is displayed in red color if this option is set to 'true'. |
|
"keycolumn": SAPColumnName - When you add or delete rows in an SAP table, the row number 'absrow' can change, and the corresponding index may disappear. To maintain consistent row references, you can use the 'keycolumn' option, which relates the new column with the SAP column. This allows automatic indexing of rows with the custom column based on the value of the assigned keycolumn. |
|
"label": push button name - This option shows an icon with text on the push button using the notation "@iconid@text" |
|
"name": string - This option defines the column's internal name, allowing scripts to refer to it. The label remains invisible to the user. |
|
"numerical": true - This option allows only numeric input when set to 'true'. |
|
"position": value - This option determines the column number within the table. If not specified, the new column will be created as the last column in the table. |
|
"pushbutton": true - The column value is displayed as a push button when set to true. |
|
"process": process name - This option applies only to the push button and determines the function to be executed when set to true. |
|
"readonly": true - This option designates the new column as non-editable. |
|
"size": value - This option sets the size of the column in terms of the number of characters. It is essential to use the size option when creating a column in the SAP table. |
|
"searchhelp": true - Defines the searchhelp (F4) for the new column. |
|
"table": table name - This option defines the table name where the column will be created. It is particularly useful when multiple tables are present on the screen. |
|
"techname": SAPcolname - Defines the technical name of the column. |
|
"uppercase": true - Converts lowercase characters to uppercase when set to true. |
Options Detail
All the mentioned options are demonstrated on the VA02 Overview screen in SAP. To implement them, create the SAPMV45A.E4001.sjs file in the Liquid UI script folder, and all additions will be made to this file.
The table displaying all items in the VA02 Overview screen is shown below for the selected options.
Example
The usage of the column command is demonstrated on the existing All items table of the VA02 Overview screen, as shown in Figure 1:
Figure 1: Scenarios of column() command
Script
//Changes the position of column and make it as readonly option column('MaterialType',{"table":"[All Items]","name":"va01_material","size":10,"position":1,"readonly":true}); //Adds techname and intensified to the column column('Taxname',{"table":"[All items]","size":10,"name":"va02_tax1","position":2,"techname":"VBAP-WERKS","intensified":true}); //Adds keycolumn and checkbox option column('Tax1',{"table":"[All items]","size":5,"name":"va02_tax","checkbox":true,"keycolumn":"Item","position":3}); //Adds searchhelp and alignright option column('Material Tested',{"table":"All items","size":10,"name":"z_testcol","position":4,"alignright":true,"searchhelp":"S_MAT1","shname":"MATNR","shname1":"VBAB_MATNR","shdest1":"V[z_testcol_desc]"}); //Sets name and size to the column column('SU1',{"table":"[All Items]","name":"va02_SU1","size":5,"numerical":true,"position":5}); //Sets uppercase and name option to the column column('Material Description',{"table":"[All items]","size":10,"name":"va01_clitm","position":6,"uppercase":true});