cancel
Showing results for 
Search instead for 
Did you mean: 

SAP GUI Scripting - Count Rows in Table with Conditions

0 Kudos

Hello all,

I will need your help and advice on below code for row count.

TotalRows = ""            
TotalRows = session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_ITEM/tabpT\07/ssubSUBSCREEN_BODY:SAPMV45A:4500/tblSAPMV45ATCTRL_PEIN").rowCount
WScript.Echo "Total Rows: " & TotalRows

Total_Rows = ""
Total_Rows = session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_ITEM/tabpT\07/ssubSUBSCREEN_BODY:SAPMV45A:4500/tblSAPMV45ATCTRL_PEIN").rows.Count
WScript.Echo "Total_Rows: " & Total_Rows

VisibleRows = ""
VisibleRows = session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP_ITEM/tabpT\07/ssubSUBSCREEN_BODY:SAPMV45A:4500/tblSAPMV45ATCTRL_PEIN").VisibleRowCount
WScript.Echo "Visible Rows: " & VisibleRows  

Output:

Total Rows: 9
Total_Rows: 6
Visible Rows: 6

Actually I would like to get the number of rows returned which contain data. So in my example I am looking for a result of 3. Deducting the values doesn’t seem to be the right approach here.

Additionally I would like to do another count with a condition, e.g. where the order quantity > 0 -> result should be 1

Do you have any guidance here?

Thanks in advance

Best regards

Florian

row-count.png

sveabecker
Community Advocate
Community Advocate
0 Kudos

Hi Florian,

We noticed your question which has been tagged with "SAP Process Automation" - it seems that this wasn't the right tag. I have now retagged to "Material Management" according to the attached screenshot.

It's important to add the correct tag to your question so that the right experts get notified. I recommend to check out our SAP Community Q&A Tutorial: Ask and Answer Questions on SAP Community

Just wanted to let you know that this might have caused the delay of getting a response.

Regards, Svea

SAP Community Global Moderator

Accepted Solutions (0)

Answers (0)