Liquid UI - WS Reference Library

column()


Purpose

With column(), you can add table column. You can use column() command with both native SAP tables and Liquid UI tables.

Note: You cannot modify Native SAP table column with column().


Syntax

  • For Native SAP tables
    column('heading',{"table":"[tablename]","name":value,"size":value,"option":value..});
    
  • For Liquid UI tables
    table([startrow,startcol],[endrow,endcol],{"name":"table name","title":"table title","rows":number});
    column('heading',{"table":"[tablename]","name":value,"size":value,"option":value..});
    


Properties

  • heading - column heading


Available Options

You can use the following options with the textbox:

"alignright":".."

"alignright":true - This option will align field value to the right, if it is set to 'true'.

"checkbox":".."

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

"intensified":".."

"intensified":true - The field value is displayed in red color, if this option is set to 'true'. 

"keycolumn":".."

"keycolumn":SAPColumnName - 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 with the SAP column in order to create a consistent reference for the rows. If this option is used, automatic indexing of the rows with the custom column will be based on the value of the assigned keycolumn.

"name":".."

"name":string - This option specifies the name of the column. This label is the internal name of the column by which scripts may refer to it and is not visible to the user.

"numerical":".."

"numerical":true - This option allows only numerical input, if it is set to 'true'.

"position":".."

"position":value - Specifies the position of the column within the table. If the position option is not specified, the new column will be the last column in the table.

"readonly":".."

"readonly":true - Specifies that the new column will be non-editable and no input will be allowed.

"size":".."

"size":value - Specifies the size in number of characters.

"searchhelp":".."

"searchhelp":true - Defines the searchhelp (F4) for the new column.

"table":".."

"table":tabname - Specifies the table name in which the column will be created. This option is only necessary if more than one table is present on the given screen.

"techname":".."

"techname": SAPcolname - Defines the technical name of the column.

"uppercase":".."

"uppercase":true - Converts lowercase characters to uppercase, if this option is set 'true'.


Options Detail

Navigate to the VA03 Overview screen in SAP and create the 'SAPMV45A.E4001.sjs' file under Liquid UI script folder. All additions will be made to this file. The VA03 overview screen appears as follows for the following options.

alignright

  1. This option will align a field value to right hand side of the cell.

  2. column('Material type',{"table":"[All items]","name":"z_mycol","size":17,"alignright":true});
    
  3. The alignright option assigns column values to the right hand side of the table.

checkbox

  1. This checkbox option lets the user to place a checkbox in each cell of the column. The checkbox selection values are X and ' '.

  2. column('Verified',{"table":"[All Items]","name":"va01_clitm","size":15,"checkbox":true});
  3. The Material type column has checkbox option. The user can either check or uncheck the column.

intensified

  1. This option will make cell values appear in a color other than black. The default color is red.

  2. column('Material type',{"table":"[All Items]","name":"va01_clitm","size":15,"intensified":true});
  3. The intensified option turns Material type column values into red color.
    Note: This option cannot be used with the 'numerical' and 'readonly' option.

keycolumn

  1. 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 with the SAP column in order to create a consistent reference for the rows. If this option is used, automatic indexing of the rows with the custom column will be based on the value of the assigned keycolumn.
  2. column('Tax',{"table":"[All Items]","name":"va02_tax","size":15,"keycolumn":"Item"});
  3. The keycolumn option adds the newly added column to the native SAP table. If the keycolumn is not added, then the column acts independently to a table irrespective of the action applied, like delete etc.

name

  1. This option lets you specify the technical name of a column. The name is for Liquid UI scripts reference and do not appear on screen. Column heading appears on the table.

  2. column('Item name',{"table":"[All Items]","size":10,"name":"va01_clitm"});
  3. As per the code, the column name is Material type and technical name is va01_clitm.

numerical

  1. This option will restrict a column to accept only numerical values, if it is set to “true”.

  2. column('Material number',{"table":"[All Items]","name":"va01_clitm","size":10,"numerical":true});
  3. The Material column allows only numerical characters. It doesn't take alpha characters as input.
  4. Note: This option cannot be used with the 'uppercase' option.

position

  1. This option specifies the position of the column within the table. This option lets the column to change its position in the table. If this option is not specified, then that column appears at the end of the table.

  2. column('Material type',{"table":"[All Items]","name":"va01_clitm","size":14,"position":4});
  3. As per the code, Material type column is at fourth position.

readonly

  1. This option will make a new column non-editable and prevent from adding new values to the column.

  2. column('Item name',{"table":"[All Items]","name":"va01_clitm","size":15,"readonly":true});
  3. The Material type column cannot be edited as it is set to readonly:true.
    Note: This option cannot be used with the 'intensified' option.

searchhelp

  1. With this option, you can define a search help (F4 matchcode) for the newly created Liquid UI column using the search help option details of the existing SAP standard field or table column.
  2. To add searchhelp to an user-created column in the All items table, please add the following code to the script file:
  3. column('Material Type',{"table":"[All Items]","size":15,"name":"z_testcol","searchhelp":"S_MAT1"});
  4. Through the above column command, you can create a searchhelp option for the column named Item Number.
    Note: This option cannot be used with the 'numerical' option.

size

  1. This option sets the width of a column. Based on the size value, the column accommodates number of characters (x) for each cell.

  2. column('Material type',{"table":"[All Items]","size":20,"name":"va01_clitm"});
  3. The Material type column can take up to 20 characters, as the size value in the above script is 20.

table

  1. This option specifies the table name in which the column will be created.

  2. column('Material type',{"table":"[All Items]","size":15,"name":"va02_type"});
  3. The table option is more useful in adding columns to a particular table.

techname

  1. This option is used to uniquely identify the name of the table. The techname of the table doesn’t appear on the screen.

  2. column('Material type',{"table":"[All items]","size":15,"name":"va02_tax","techname":"VBAP-WERKS"});
  3. The techname option for a column provides a search help.

uppercase

  1. This option converts the lowercase characters to uppercase.

  2. column('Material type',{"table":"[All items]","size":15,"name":"va01_clitm","uppercase":true});
    
  3. Here the uppercase option converts the lowercase characters entered in the Material type coulmn to uppercase.

Note: This option cannot be used with numerical option.


Example

To show the usage of column() command, we will use an existing table from VA01 Create Standard Order: Overview section that shows various scenarios of this command, as shown in Figure 1:

Figure 1: Scenarios of column()command


Script

//position and readonly option 
column('MaterialType',{"table":"[All Items]","name":"va01_material","size":10,"position":1,"readonly":true});
//techname and intensified
column('Taxname',{"table":"[All items]","size":10,"name":"va02_tax1","position":2,"techname":"VBAP-WERKS","intensified":true});
//keycolumn and checkbox option
column('Tax1',{"table":"[All items]","size":5,"name":"va02_tax","checkbox":true,"keycolumn":"Item","position":3});
//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]"});
//name and size option
column('SU1',{"table":"[All Items]","name":"va02_SU1","size":5,"numerical":true,"position":5});
//uppercase and name option
column('Material Description',{"table":"[All items]","size":10,"name":"va01_clitm","position":6,"uppercase":true});


Tips and Tricks

  • Liquid UI Column for Liquid UI Table

    This example illustrates how to assign values to a Liquid UI column when the column is being used by a Liquid UI table.

    Learn more about Liquid UI Column for Liquid UI Table.

  • Hiding SAP Columns

    To hide a native SAP column in a table, the columnwidth command is used.

    Learn about Hiding SAP Columns using cloumnwidth.

  • Liquid UI Column inside SAP Table

    This example shows how to create a Liquid UI column in a SAP Table.

    Learn more about Liquid UI Column inside SAP Table.