Using the selectedrows options

To demonstrate the selected rows option, please do the following:

  1. Launch SAP and navigate to the VA01 screen where the All items table resides. Open the script file for the Easy Access screen (SAPLSMTR_NAVIGATION.E0100.sjs).

  2. Enter the following code:

     
    					gettableattribute("T[All items]", {"firstvisiblerow":"FVisRow", "lastvisiblerow":"LVisRow", "lastrow":"LastRow", "selectedrows":"SelRows"});
    				
  3. Add some code to trigger the selected rows option. An example is shown below:

     
    				if(SelRows[ROW_NUMBER]=="X") {
    	println("Selected row is>> " + ROW_NUMBER);
    }
    					
    				
  4. The row number of the selected row will now display in the Console.