cancel
Showing results for 
Search instead for 
Did you mean: 

last table line in a SAP GUI Script

Former Member
0 Kudos

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) (http://help.sap.com/saphelp_47x200/helpdata/EN/2a/121e3bd711bb04e10000000a114084/frameset.htm)

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

Kind Regards:

Svetlana

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

Next

Accepted Solutions (1)

Accepted Solutions (1)

script_man
Active Contributor
0 Kudos

Hi Svetlana,

You could try it as follows:

. . .

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").rowCount

For Count = 0 to LastLine - 1

. . .

Regards,

ScriptMan

Former Member
0 Kudos

Hi ScriptMan,

It works very well. Thousand thanks for the help.

Kind Regards:

Svetlana

Answers (0)