Skip to Content

SAP Screen Personas - Address Non visible row

We at Terumo BCT have implemented SAP Screen personas (service pack level 3) and are trying to simplify Purchase order creation screen. While creating Purchase order, we used a button on the screen to populate default values – so when the user hits the button, it populates default value like issuing storage location, receiving storage location and plant. It works for the rows which are visible on the screen, but doesn’t work for non-visible rows which will be visible only when scrolled down. The number of visible rows depends on the screen size – it varies. We are looking for a way to address this issue. Please let us know if this is a limitation on the screen personas – that this will work on visible screen rows rather than the whole table and if there is a better way to address this issue.


We tried to use rowCount, absolute rows, visible row property but couldn’t get pass this issue.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Dec 07, 2017 at 08:52 PM

    You will need to use a combination of firstVisibleRow, rowCount, and visibleRowCount properties.

    I use this function to read table contents, but you should be able to see how it scrolls the table and use these pieces as it pertains to you.

    I attached the following code as a text document as well.

    To call this:

    var zTable = session.findById("wnd[0]/usr/tabsTABSTRIP_0300/tabpANWS/ssubSUBSCREEN:SAPLBSVA:0302/tblSAPLBSVATC_E");
    var zContents = getTableContents(zTable);
    //Read Table Contents
    function getTableContents(zStatusTable)
    	session.utils.log('=============================== Read Table Contents Function ===============================');
    	var zFoundYa = false;
    	var zContents = [];
    	var zcolumns = zStatusTable.columns;
    	var zname;
    	var oRow = [];
    	zXcolumnname = zcolumns.elementAt(0).name;       //X column
    	zStatusColumnName = zcolumns.elementAt(1).name;  //Status column
    	zStatusTable.firstVisibleRow = 0;
    	var zStatusVisibleRows = zStatusTable.visibleRowCount - 1;  //Number of visable rows in the table (does not change).
    	for(zCurrentRow = 0; zCurrentRow < zStatusTable.rowCount; zCurrentRow++)
    		oRow = {};  //clear the oRow variable - reinitialize it
    		if(zCurrentRow > zStatusVisibleRows)
    			if(zStatusVisibleRows + zStatusTable.visibleRowCount > zStatusTable.rowCount) //Make sure not to go past the last row in the table
    				zStatusTable.firstVisibleRow = zStatusTable.rowCount - zStatusTable.visibleRowCount;  
    				zStatusTable.firstVisibleRow = zStatusVisibleRows + 1;  //Pagedown in table
    			zStatusVisibleRows += zStatusTable.visibleRowCount;
    		//Populate columns 0 and 1 into oRow array
    		for(i=0; i <= 1; i++)  // only want columns 0 and 1
    			zColumnName = zcolumns.elementAt(i).name;
    			session.utils.log('zCurrentRow = ' + zCurrentRow + ', zColumnName = ' + zColumnName + ' Value = ' + zStatusTable.getCellValue(zCurrentRow, zColumnName));
    			if(zStatusTable.getCellValue(zCurrentRow, zColumnName) == '____')
    				session.utils.log('Last Row - Exit For Loop');
    				zFoundYa = true;
    			//Add data from table to the Array
    			oRow[i] = zStatusTable.getCellValue(zCurrentRow, zColumnName);
    		if(zFoundYa === true)
    		//Add Array to the Array
    	zStatusTable.firstVisibleRow = 0;
    	return zContents;

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.