Problem in 'Get cell value' function in RPA.SAP library

Hi, I tried to automate SAP using Robocorp. But some issues are there. The function named ‘Get Cell Value’ need 3 attributes, 1st is table_id, 2nd is row_number, 3rd is cell_id. I got the table_id and cell_id by using ‘Script recording’ option in SAP, and when I use that id in code, it giving attribute error. Error related to ‘getcellvalue’ function.
Does anyone here got similar issue or anyone have any idea about this issue?

Can you show your conda.yaml file content, your code that is failing, and actual error that you are seeing (including stack traces and all). Those would help us understand what is going on.

Hi @jippo ,
Thanks for your support.
Now I got the cell value by installing SAPGui Library and make a correction in the ‘Get Cell Value’ function by replacing
this code line
" cellValue = self.session.findById(table_id).getcellvalue(row_num, col_id)"
to this
“cellValue = self.session.findById(table_id).getcell(row_num, col_id).text” .

And I gave the table_id as “wnd[0]/usr/tabsTABSTRIP_EO/tabpPRCT_SCREEN_CC/ssubSUBSCREEN_EO:SAPLRKPM:0335/subPRCTR_CC_TC_SUBSC:SAPLSTC1:0105/tblSAPLSTC1GENERIC_TABLE_6” and col_id and row_num as integers.

Now the problem is I am not able to iterate the cell values for extracting the whole table.

  • Is it possible to extract a table from SAP? If yes, how you are doing that?

This is my conda.yaml file.

Have you checked the documentation at RPA.SAP library keywords ? Keywords listed in there are ones that are supported.

I’m not expert on SAP. But based on indications that IDs are used there, you really have to know your target table to be able to access it. Then you could maybe use Select Table Column or Select Table Row and go from there. Or since you are using python, you can freely for/while-loop thru that known table by just using way you already used to get cell values.

1 Like