Beas WEB Server is a single process. Transactions in SAP B1 take time. While the transaction is running, the WEB Server cannot work on other requests.
Concept: The Beas WEB Server returns only a request ID and sends the POST command to the Beas documentation - common service . This does not take time and the Beas WEB Service can answer the subsequent requests. The WEB client can use the RequestAnswerService to ask if the transaction is executed and can delete the request with DEL RequestAnswerService.
With asynch=true the system sends the command to the Beas common service and returns only the request number on which you can read the answer.
In this way you will not stop the Web server for working on time-intensive commands.
Example
Create Work order over Common service:
POST odata4/WorkOrder?async=true
Body
{"WorkorderPos":[{"ItemCode":"FP","Quantity":2}]}
This return
{
"TransactionID": 5726
}
Now you can request the result
This can take longer.
Note: It is recommended to ask max. 1 time / 3 seconds.
RequestAnswerService?$filter=RequestId eq "5726"
This returns empty value if (for example) this type of string does not exist:
{
"value": [
{
"RequestNumber": 478,
"RequestId": "5726",
"SessionId": "mah-de-desktop2828",
"AnswerType": 0,
"AnswerText": "6002207",
"PARAMETER1": "",
"StationId": "mah-de-desktop",
"Closed": false,
"EntryDate": "2021-03-25T10:51Z"
}
]
}
At the end you must close the answer (Note: you must send the parameter as String array)
RequestAnswerService/Close(["5726"])