Omit line if cell value contains 0

Hello everyone,

I’m working on a use case at the moment that goes through SAP tables and I need to look for red lines which means there are errors. But there is one exception that I need to handle.

If column “Quantity” contains 0, then I need to go over that lane and do not count it as an error.

See screenshot below :

I went through the html code behind these tables, and I have noticed that for every red line found (RedLinesCount variable) , there is 4 times that color code which is ( #fa6a6a ). So I did a count on all the red code colors found and divided it by 4.

Then for all the red lines found check if column Quantity column contains 0, I increment the (RedZeroCount variable). And at last If RedLinesCount>RedZeroCount then I have to send an email stating that errors were found in that table.

Apparently this solution isn’t working out well, it does not take in consideration the RedZeroCount. I would appreciate it if you could help me out with some other solution or even propose to me some adjustment for this existing solution.

Calling @LevKushnir for help.

Cheers,

Update :

I have noticed that that the RedZeroCount loops only through the first datable in the HTML page.
I searched for solution to find all datatables in html page and found this link :

But couldn’t apply it to my example, I showed the selector the HTML page, but on execution it says the selector is invalid.

Selector : <webctrl tag= ‘BODY’ / >
Filter : <webctrl tag=‘TABLE’ / >

Hi @Meloueh01

On the screenshot above you our showing the HTML page. What is the reason, that you are not automating the date directly in SAP WinGUI?

in SAP WinGUI you have a lot of filters, which can help you to come to the right result.

So, the recommendation is to perform the automate in SAP WinGUI instead of exporting data in HTML and then struggling with very complex and complicated HTML page.

Best regards, Lev

Hello @LevKushnir and thank you for your input,

Let’s say I perform the automation directly on the SAP WinGUI, how can I export the data from multiple datatables and check the value of the column Quantity.

See screenshot below :

Extract Datatable activity only works with the first datatable, and the number of tables differ from one job to another.
So I need to count the tables first, then go through them one by one.

Cheers

HI @Meloueh01

Not sure, what do you mean with “Extract Datatable activity only works with the first datatable” ?

On this example I have 2 tables and reading the data from the second one

image

General recommendation for such SAP ALV Tables is to use native SAP Filtering possibilities to find out the right results.

Once you have all data available you can use Verify Activities to validate the values

Best regards, Lev