cancel
Showing results for 
Search instead for 
Did you mean: 

Primary key generated in backend

Former Member
0 Kudos

Hello,

We are developing a native application that allows you to create sales orders directly on mobile devices.

The problem is that the primary key of the sales order (sales order number) must be generated by the server when creating the application.

That is, what we need is to allow users to create and fill new orders, and then save them (save method of MBO) and submit them to the server (by calling the create operation). Just in time to submit is that the primary key would be populated with the value returned by the backend.

Is there any application that uses the SUP this way?
How you approach this situation?

Any suggestions?

Accepted Solutions (1)

Accepted Solutions (1)

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi David,

are you sure return parameter for that particular operation BAPI contain primary key?

actually i am working on one some of the scenarios where return parameter of create operation BAPI doesnt have any primary key attribute.

from frontend side, we are generating one unique temporary parameter, that is getting converted into actual unique PK.

Regards,

Jitendra Kansal

Former Member
0 Kudos

Actually, it is not a BAPI, it is a SOAP Web Service.

The primary key is returned for sure.

What we are trying to to is generate a new record in the local database with PK = 0, and use an operation CREATE that assigns the PK with the correct value. The problem is that the result of CREATE operation is not inserted into the cache.

Looks like the change of PK value is causing some trouble.

How do you change the temporary parameter by the backend generated value?

Dan_vL
Product and Topic Expert
Product and Topic Expert
0 Kudos

What type of a client are you using?  Is it native or a hybrid app?

If it is a hybrid app, the following sample contains a sections showing a potential solution for this problem.

MBOs and Hybrid Apps https://cw.sdn.sap.com/cw/docs/DOC-152083

Specifically the section titled Accessing an MBO Operation's Output Parameters

Answers (0)