cancel
Showing results for 
Search instead for 
Did you mean: 

OData communication disruption

former_member190010
Contributor
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Emanuel,

In My Opinion,

I see 2 things to be addressed :

1. SO created successfully in BackEnd and response dint reach the mobile.

2. SO creation failed in BackEnd  and response dint reach the mobile.

Solution designed by You :

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.

I have a Question here :

When u encounter any one of the situation as i described above ( in the beginning point 1 and point 2 ) ,

Are u firing the create operation on hitting on Create button again with the same mobile device LOCAL Sales Order ID ?? i mean to say previous mobile device LOCAL Sales Order ID for which operation was failed ? i would say with the same mobile device LOCAL Sales Order ID for which response dint reach mobile?

Comments according to me based on ur answer for the above question i have from my side:

If NO then u will end up creating SO with a different mobile device LOCAL Sales Order ID number for the same set of data. In this case u need to have some other way of handling ur case here.

If YES ( i.e., u firing the create operation on hitting on Create button again with the same/previous mobile device LOCAL Sales Order ID ) then in my opinion the solution looks fine for me.

Solution has to be implemented in BE only according to me.

May be u can check/search for any BAPI for SO which can take SO Number and the data associated with that and return u result saying SO number exists with the same set of data. May be U can use this to perform check and use it if is feasible.

Regards,

Ashwin

former_member190010
Contributor
0 Kudos

Hi Ashwin,

Thank you for answering the question.

Two things to clarify.

Are u firing the create operation on hitting on Create button again with the same mobile device LOCAL Sales Order ID ??

Yes, I am firing the operation with the same mobile device LOCAL Sales Order ID.

In a part of your answer, you metion: "Solution has to be implemented in BE only according to me."

What do you mean by BE?

Best Regards,

Emanuel

AshwinDutt
Active Contributor
0 Kudos

Hello Emanuel,

What i meant by saying "Solution has to be implemented in BE only according to me" is that according to me handling of this kind of scenarios has to be done in the BackEnd Level ( BE )  only.

I mean the check whether SO number exists or not needs to be done in BE system only.


Regards,

Ashwin

former_member190010
Contributor
0 Kudos

Totally agree.

Thanks for all your help.

Answers (1)

Answers (1)

kammaje_cis
Active Contributor
0 Kudos

This can be handled by your UI design.

After pressing the "Create" button once, the screen should not remain in the same create screen. Rather it should show an overview screen, may be showing all the sales order he can view/edit/created by him. Thus there will not be a chance to hit "Create" again. You would show the same screen only if there is a data entry error. 

I would suggest you to look at the Fiori Sales Order App UI design.

former_member190010
Contributor
0 Kudos

Thank you for your answer Krishna.

In your answer, you mention:

"You would show the same screen only if there is a data entry error."

How do you know if there is an error, if the communication between the mobile device and the SAP NW Gateway after calling the create OData operation cuts. If the comminication fails, you never get to know if the Sales Order was created or not.

Best Regards,

Emanuel