Same seq id should not repeat the process in SAP


I am doing automation for one of the SAP process. In that we have to load and process n number of seq id with multipe criterias.
Everytime new seq will come when I refresh the invoice seq page. BOT will process the seq Id one by one.
If there is any error in particular invoice BOT will ignore and continue the process with the next seq Id.
But the Ignored seq Id also will be there in the same page untile we clear it.

I need to add a criteria that same seq Id should not repeat the process again.


Seq Id


BOT process the seq Id 1111 sucessfully and started the process with 2222.
Due to some error BOT ignored this seq Id 2222 and continue the same process with next seq Id 3333.
Still seq Id 2222 remains in the bottom of the queue.
Once clear all the other seq Id BOT will pick the seq Id 2222 again and try to process it, which is incorrect.
Same seq Id should not repeat the process again.

Can anyone suggest me an approach to add a check for this?

Thanks in advance.

is there any way to keep the history of Sequence Id and compare? if Seq Id already exist it will come out from the loop.

Once you processed you can add that ID to List then while processing next record just have a check weather that Collection have that value if yes then skip else continue.

Would be grateful if you add the logic here…

Hi Shajanjose,

Extract your Seq Ids into a datatable or list and loop your process in a for each.
Even if you face any errors in processing the Seq Ids it will not repeat the process again

Hi Kranthiv,

At the very first step I am exporting the sequence from SAP to Excel, their am performing some macro operations and categorize the sequence id’s. Based on this categorization am loading set of seq id for first process, once first set of seq id completed i need to load the 2nd set of sequence Id’s. The problem is if there is any Id pending due to some error in the first set of sequence, process will repeat for those id until it get cleared out. So we need to make sure sequence id’s should not repeat the process again, if process repeat for sequence id then it will load the 2nd set of sequence id for next process.

Ok in this case, when you export data from SAP to excel and read that excel you will be having dataTable, just add one more column with type boolean and initialize to false, once record is processed make that value as true, while you process those records filter based on False value and process.

Thanks Divya, will try this approach.