Liquid UI - WS Reference Library

Retrieving values from tables


Retrieving values in GuiXT table cells.

There are several possible values that can be retrieved from a table. These values are as follows:

  • First and last visible rows
  • Column cell values
  • Selected rows and columns

These are demonstrated as follows:

Retrieving first and last visible rows

To retieve the first or last visible values in a GuiXT table, please do the following:

  1. Go to the table we previously createrd on the Easy Access screen.
  2. Open then script file (SAPLSMTR_NAVIGATION.E0100.sjs) and enter the following code:

                println(" firstvisiblerow " + <'T[All items]'>.firstvisiblerow);
  3. This code will return the last visible row of the tqable in the Console window.
  4. To return the first visible row in the table, change the code to the following:

                println(" lastvisiblerow " + <'T[All items]'>.lastvisiblerow);
  5. The value will be displayed in the Console.

Retrieving column cell values

To retieve the values in a particular cell of a GuiXT table, please do the following:

  1. Go to the table we previously createrd on the Easy Access screen.
  2. Open then script file (SAPLSMTR_NAVIGATION.E0100.sjs) and enter the following code:

                var i,j;
    for(i=0; i < proj.matnr.length; i++)
    println("proj.matnr.[" + i + "] " + proj.matnr[i]); 
  3. This code will return all values in the 'Material' column of our table.
  4. To return the values in the 'Quantity' column, enter the following code:

                var i,j;
    for(j=0; j < proj.qty.length; j++)
    println("proj.qty.[" + j + "] " + proj.qty[j]);
  5. The values contained in the column cells will be displayed in the Console.

Retrieving selected rows and columns

To retrieve the values in a specified row or column of a GuiXT table, please do the following. Here we are retrieving the values of any rows and columns that we previously marked as being selected. We are using a for loop to iterate through the rows and columns.

  1. Go to the table we previously createrd on the Easy Access screen.
  2. Open then script file (SAPLSMTR_NAVIGATION.E0100.sjs) and enter the following code:

                var k,l;
    
    for(k=0; k < proj.selectedrows.length; k++)
    println("-----proj.selectedrows.[" + k + "] " + proj.selectedrows[k]);
  3. This code will return the values in the specified row of the table. The values will be displayed in the Console window.
  4. To retrieve the values in a particular column, change the for loop code to the following:

                for(l=0; l < proj.selectedcols.length; l++)
    println("-----proj.selectedcols.[" + l + "] " + proj.selectedcols[l]);
  5. The column values will be displayed in the Console.