Skip to Content
Former Member
Jul 23, 2009 at 07:50 AM

last table line in a SAP GUI Script


Hi All,

Does anybody know, if it is possible to find the last line of the table on the right hand side of the structure editor in eCATT (tr. SECATT) (

I use the script below and want to calculate the last line automatically if it is possible.

Kind Regards:


Dim Count
Dim Varname
Dim LastLine
Dim CountLine

LastLine = 5
CountLine = 0

For Count = 0 to LastLine

session.findById("wnd[0]/usr/tabsTS_SCRIPT_EDITOR_0202/tabpECSC_ED/ssubTR_SCRIPT_REF1:SAPLECATT_MAIN:0402/cntlCC_ECSC_EDITOR/shellcont/shell/shellcont[1]/shell/shellcont[1]/shell/shellcont[1]/shell/shellcont[1]/shell").currentCellRow = Count
Varname = session.findById("wnd[0]/usr/tabsTS_SCRIPT_EDITOR_0202/tabpECSC_ED/ssubTR_SCRIPT_REF1:SAPLECATT_MAIN:0402/cntlCC_ECSC_EDITOR/shellcont/shell/shellcont[1]/shell/shellcont[1]/shell/shellcont[1]/shell/shellcont[1]/shell").getCellValue(Count, "DATA")

if Varname <> "" Then

session.findById("wnd[0]/usr/tabsTS_SCRIPT_EDITOR_0202/tabpECSC_ED/ssubTR_SCRIPT_REF1:SAPLECATT_MAIN:0402/cntlCC_ECSC_EDITOR/shellcont/shell/shellcont[0]/shell").modifyCell CountLine, "PNAME", Varname 

CountLine = CountLine + 1

End If