Hi gurus,
I am developing an OData web service to create Sales Orders (t-code: VA01) from the mobile device.
The functionality of the app should be the following:
After completing all the fields in the screen necessary to create a Sales Order, the user press the "Create" button.
At the moment the user press the "Create" button, the web service for creating a Sales Order is called.
As the OData Standard states, after the CREATE Operation, the READ operation is called.
The customer told me that it is not acceptable to create the same Sales Order more than one time.
So he asked me:
In case the connection between the mobile app and the SAP NW Gateway fails AFTER creating the Sales Order (I mean, the READ operation doesn't arrive to the mobile app): How can you assure the Sales Order will not be created again if the user press the button a second time?
The only solution I came up is, to create a Z table in the SAP ERP that will hold the mobile device LOCAL Sales Order ID (i.e. LOCAL_1)", the current date and the ERP Sales Order number.
With this Z table, the process to create a Sales Order from the mobile device should be the following:
When the user press the create Sales Order button in the mobile app, first it is checked in the ERP if there is a record in the Z table for the combination of the mobile device LOCAL Sales Order ID (i.e. LOCAL_1)" and the current date.
In case there is no record in the Z table, once the VA01 t-code creates the Sales Order, it will be inserted a record in the Z table containing the mobile device LOCAL Sales Order ID (i.e. LOCAL_1)", the current date and the ERP Sales Order number.
This way, in case the connection between the mobile device and the SAP NW GW fails and the mobile app doesn't receive the SAP Sales Order number, when the user press again the create button in the mobile app and the Sales Order is tried to be created again in the SAP ERP, it will be detected that for that Sales Order Local ID and current date there is already a ERP Sales Order number associated in the Z table, and the Sales order is not going to be created. Finally, the Sales Order number is going to be retrieved to the mobile app.
Is this correct?
Hope someone can help me with this and confirm if my approach is ok.
Best regards,
Emanuel