Retrieving values in GuiXT table cells.
There are several possible values that can be retrieved from a table. These values are as follows:
These are demonstrated as follows:
To retieve the first or last visible values in a GuiXT table, please do the following:
Open then script file (SAPLSMTR_NAVIGATION.E0100.sjs) and enter the following code:
println(" firstvisiblerow " + <'T[All items]'>.firstvisiblerow);
To return the first visible row in the table, change the code to the following:
println(" lastvisiblerow " + <'T[All items]'>.lastvisiblerow);
To retieve the values in a particular cell of a GuiXT table, please do the following:
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]);
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]);
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.
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]);
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]);