Liquid UI - Documentation - 10.25 Identify position of the cursor on the table cells using _tabrow and _tabcol

10.25 Identify position of the cursor on the table cells using _tabrow and _tabcol


Prerequisites


Purpose

You will learn how to identify the cursor position [row,column] if the user has placed the cursor in a table cell. The system variables "_tabrow" and "_tabcol" can be used to find the cursor position for the row and column, and further to read data from or write data to that position. We will walk you through the following steps.

  1. Add Find Position pushbutton
  2. Add a function to read the position of the cursor

//Create this file inside your script folder for customizing Create Standard Order:Overview Screen SAPMV45A.E4001.sjs
//Now let's start adding the content to the above file

  1. Add Find Position pushbutton on the Create Standard Order: Overview Screen.
     
    // Creates a pushbutton that executes readCursorPosition on click.
    pushbutton([TOOLBAR],'Find Position',{'process':readCursorPosition});
    

     
  2. Add a readCursorPosition function to read the cursor postion and to print the position of the cursor in the console window.
    // Creates a readCursorPosition function to find the position of the cursor
    function readCursorPosition(){
            set('V[z_rowcol]','['+_tabrow+','+_tabcol+']');
            println('Position of the cursor on the table at:' + z_rowcol);
    }
    

     
  3. Navigate to VA01 Create Standard Order: Overview Screen. Click Find Position pushbutton after placing your cursor on any table cell of the All items SAP table.

     
  4. You can view the position of the cursor displayed in the console window. Array 1, 2 indicate the position of the cursor on the first row and second column. Based on the position we can also access the table cell value.


     

Can't find the answers you're looking for?