Skip to Content
Jun 30, 2017 at 04:15 PM

Reading Selected Row in SAP GUI for Windows

285 Views Last edit Jun 28, 2018 at 11:26 AM 2 rev

Hey guys,

I started working on screen personas flavors a month ago and currently face a problem in the Sap Gui for Windows version of my flavor. in HTML, my code works fine.

Example of what I'm trying to achieve in Windows version:

var srcTable = session.findById("wnd[0]/usr/cntlCUSTOM/shellcont/shell/shellcont[0]/shell");
var sRow = parseInt(srcTable.selectedRowsAbsolute);
var data = srcTable.getCellValue(sRow, srcTable.getColumnName(14));

This alerts the data in the row I selected, in the column 14 , simple but cannot get selectedRowsAbsolute/selectedRows to work in Windows version. Tried a lot of different techniques but not one worked so far.

Here is another example in HTML:

var srcTable = session.findById("wnd[0]/usr/cntlCUSTOM/shellcont/shell/shellcont[0]/shell");
if(srcTable.selectedRowsAbsolute == "2"){
	session.utils.alert("Please Work");

This one just alerts if your selected row index is 2 when script is run. You get the idea.

How can I achieve this in Windows version of Sap Gui? There must be some workarounds for this. In essence, any code that can read which row is currently selected by the user, would do.