Run Account payable transaction over multiple robots

Working on account payable automation in which processing request on 2 instance of SAP using 2 robots.
Whenever multiple invoices having same PO number or when we trying two different invoices having different invoice number but same PO number then we facing issues.
As per SAP Account payable system, it is not allowed to process same PO on two difference instance of sap or 2 user can’t not access same PO number on SAP at same point of time.
So i want to know how we can restrict execution of same kind of PO number invoices on 1 bot , PO number is added as a parameter in queue item.
But that PO changes monthly i.e in current month will receive 20-50 invoices and in 2nd month with another PO we receive 30-60 invoices so we also can’t hard code PO number.

Required help or suggest a best possible way we can use 2 bots for invoice processing

you can add a unique reference to the queue item that has a static common part unique to one robot. In that way robot will know which item to pick up, just add the clause while fetching the queue item, it should fetch only those which belongs to it


Below documentation might help:
Add Queue Item And Get Reference (

Unable to understand completely , are you suggesting adding PO number as reference while adding item to queue ?
In my case PO is dynamic and if one bot is processing that PO number, then bot other can’t pick that transaction which has same PO number, that kind of functionality i need to implement.

I understood the scenario.

we can do it in two ways

  1. In dispatcher, if y have the data extracted and ready to send to queue. At that stage, just group them by PO numbers and send the queue items by sending 1 group having reference Robot1_PO1_Data1, Robot1_PO1_Data2, etc

This will send the items as this customized reference to queue. While fetching at robot 1, fetch the queue items that has “Robot1” in the start and for robot 2 fetch items starting with “Robot2” reference.

  1. If you are sending queue items from multiple sources or not at the same time, in this case queue items can be sent as PO as reference, then use Get Transaction item, this will give you one PO, now you can use Get Queue Items activity, with having the reference as PO number. This will get all the items for that PO number at once.

I would recommend first approach.

Also, can you mention how the dispatcher is sending the data? If it all at once?

Thank you for suggesting approach.
But disapatcher runs in every 5min so it might be the case when existing item on queue having same PO number and once dispatcher run few more transaction comes into queue having the same PO number.
Is there any way we can check before taking transaction for processing, whether current in progress transaction having the same PO number as its parameters?


You can do that at dispatcher and in performer side too

I’ll suggest at dispatcher side.

Create a file in the dispatcher that will have unique references created for one robot.

PO number comes in to get dispatch, robot checks in that file if there is a entry for that PO number, if not it’ll create one and generate a unique reference number for it something like, ROBOT1_PO1
and if the entry is there then dispatcher will simply take the reference number from that file.

in your way the same PO number will be mapped to only one robot.

that file at dispatcher can be managed/deleted/updated as per your need. If you want to keep all the records it’ll be fine, if not then after every one month you csn add logic to delete last months record, in dispatcher.

Are you using Get Transaction to get the item from the queue? If you are, two jobs cannot get the same queue item. Are you putting duplicate queue items into the queue?