cancel
Showing results for 
Search instead for 
Did you mean: 

Avoiding repetitive Post call in SAP Odata

Nikhil1
Explorer
0 Kudos

Hi everyone,

I'm encountering issues with duplicate data being posted through SAP OData. Is there a way to identify and prevent these repetitive submissions? 

Regards,

Nikhil

Accepted Solutions (1)

Accepted Solutions (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert

Hi @Nikhil1,

I believe what you are after is a way to avoid the backend system processing multiple times the same exact request. So, let's say your front-end has no restriction that allows for a bot to click on a button "create" several times in just a very short period of time (let's say 1s the request gets sent 10 times). This will reach the backend system for sure and they will all get processed in a row almost at the same time. Which would potentially lead into having a stock item sold multiple times for the same customer.

First, let me say that whenever you develop such a button you require the front-end to treat it a completed action. Meaning: the fron-end should restrict any further clicks on the same button by disabling it before the backend is able to process it. Or, it should navigate away from the creation screen to allow the request to be processed. These are ways in which you are able to mitigate such odd behavior. 

Nonetheless, you might be interested in using another unpopular feature of the SAP Gateway Foundation component which enables your request to be processed as a singleton, regardless if it were called multiple times is a row. That's a feature called "idempotency" and can be enabled following the steps described on this documentation: 

https://help.sap.com/docs/ABAP_PLATFORM_NEW/68bf513362174d54b58cddec28794093/09f82651c294256ee100000...

Best regards,
Ivan

Answers (1)

Answers (1)

emil_lazarski
Explorer
0 Kudos

I guess we would need some more details. Are you familiar with $batch requests?