cancel
Showing results for 
Search instead for 
Did you mean: 

GetCell method error, how can I avoid it?

0 Kudos

Hi, I want to get the text of cell from a table.

When I try to GetCell(2,0), and error happended. I know this cell is read-only and cannot even be focused.

But I don't know which cells are read-only.

So, can you give me some suggestions?

Any suggestions would be appreciated 🙂

Accepted Solutions (0)

Answers (3)

Answers (3)

Sandra_Rossi
Active Contributor
0 Kudos

Documentation: GuiTableControl object

I tried to explain here (Stack Overflow) how to go through the lines of a table control, you may find properties like VisibleRowCount and more.

FrankKrauseGUI
Advisor
Advisor
0 Kudos

Hello,

these rows are quite special. The server adds them for paging reasons and SAP GUI itself does not have a property to find out how many such rows exist. Nor does SAP GUI know this number unless you paged to the last page of the table.

However, you can find out the number of such rows yourself by getting the collection of rows and then checking for each of the rows whether the collection of children of this row is greater than 0. If the collection does not contain anything, you have such a special row.

Best regars,
Frank

0 Kudos

Excuse me, will this situation appear that the first row is available and the second row is special and the third row is available?

FrankKrauseGUI
Advisor
Advisor
0 Kudos

No, this cannot happen. These rows fill up the page which means they always come at the end.

0 Kudos

I mean how to avoid this error in a loop.

```python

for i in range(10):

cell = table.GetCell(i, 0)

# I dont know which cell can be get...

```