cancel
Showing results for 
Search instead for 
Did you mean: 

Kapsel offline deep-insert workaround?

Former Member
0 Kudos

Hello,

I'm am participating on a mobile app development project, and this app is supposed to operate in offline mode. When we were trying to create deep-inserts I noticed that these operations only worked when tested in clients, but didn't when triggered from the app. That's when I came to know through this thread (Lessons learned: Migrating an MBO-based application to an OData Offline App with SMP 3.0 and Kapsel ...) that offline mode doesn't support deep-inserts.

Now I am trying to create a sale order from the app, and if I did understand it, i am supposed to split our original FM in two (one for order header and one for order item).

But my question is: how it is supposed to work via batch call if each of my items dont have an associated order (as I didn't received yet an order id from sap standard order creation routine) when I run "Create Header" and "Create Item List" in a single call?

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

Gateway SP9 comes with enhanced support for $batch. As part of this enhancement, you get header and items (I.e. entire batch request content) together in "CHANGESET_PROCESS" method, and you can go ahead and call the FM creating both header and item together.

Refer:

Former Member
0 Kudos

Thank you Krishna, it was very helpful, and I could understand how it would be done, but... I forgot to mention that we are currently on SP7. Due to this am I unable to create the order with itens?

I am asking this because w/o this changeset_process method, POST operation and consequently the creation RFC would be called for every single entry, right? And that means that every item creation will fail and raise a exception on validation routines because there is no header code vinculated to it.

kammaje_cis
Active Contributor
0 Kudos

I am not actually aware of limitation of not handling deep Insert with Kapsel. You may check with people to find when they would support it.

Till then one of the option is to create Header First, and then Create Item one by one. So if you have a Header with 4 line items, then you would issue 5 http calls, yeah, thats a pain. Other work around would be redesign your data model, I.e to flatten items with header and create a single entity.

Former Member
0 Kudos

We initially had problems with deep insert. It worked successfully when the calls were made from the GW client, but even using the same test data it didn't worked from the mobile device. Thats when I saw that post I mentioned, where the author says "When trying to run a deep insert, you will fail. This must be done with a batch call." if using Kapsel's Offline Mode..

Yeah, I tought about creating them separatedly, but it wouldn't work because after creating a header I still don't have it's number, and if I expect a backend response containing it, my application isn't offline anymore, haha.

Thank you very much, Krishna.

kammaje_cis
Active Contributor
0 Kudos

Oh, Yeah. Its offline, didn't occur to me.

What about flattening the item into header.?  May be you need to foresee maximum number of lines beforehand.

Former Member
0 Kudos

Krishna,

After working on this implementation we decided to upgrade to SP9 and use the changeset_process method with cv_defer_mode. I belive it will be better for the application. Thank you for your time and your help. (:

Answers (0)