Purpose
With gettableattribute() command, you can attain the attributes from both native SAP or Liquid UI tables. You can display both the attributes and the properties of a selected table using this command.
Syntax
gettableattribute(T[Table_name],{"option":value…});
Properties
- Table name - Name of the Table.
Available Options
You can use the following options with the gettableattribute:
"firstvisiblerow ":true - This option specifies the first visible row in a given table. |
|
"lastvisiblerow":true - This option specifies the last visible row in a given table. |
|
"lastrow":true - This option specifies the last row in a table. |
|
"selectedrows":true - This option specifies the selected rows in a table. |
Option Details
Note: These options can only be used with tables.
Example
The following scenario demonstrates the usage of gettableattribute() command to display selected number of rows.
- Navigate to VA02 overview screen. Select the required number of rows in the All items table shown below.
- Click Selectedrows toolbar pushbutton. You can view the selected rows displayed in the console window.
Note: To display output on the screen, use the message command.
Script Details
//SAPMV45A.E4001
pushbutton( [TOOLBAR],"Selectedrows","?",{"process": print_selectedrows}); function print_selectedrows()
{ gettableattribute("T[All items]", {"firstvisiblerow":"FVisRow", "lastvisiblerow":"LVisRow", "lastrow":"LastRow","selectedrows":"SelRows"}); //Add some code to trigger the selected rows option. for(i=0;i<LastRow;i++)
{ ROW_NUMBER = i; if(SelRows[ROW_NUMBER]=="X")
{ // adding 1 as SelRows is array which has index begin from 0 selected_row_number = ROW_NUMBER+1; println("Selected row is>> " + selected_row_number); } } }
Usage Details
-
Get data from SAP table using table scrolling logic with gettableattribute()
-
Get required sales order data from SAP table using gettableattribute()
-
Get attributes of an inputfield and table using gettableattribute()
-
Display of pushbuttons relative to table with gettableattribute()
-
Assign values into SAP table from Liquid UI table using gettableattribute()
-
copytext-using variables for line numbers with gettableattribute()