cancel
Showing results for 
Search instead for 
Did you mean: 

Deep Insert support for OData Offline Service

09-26-2015 12:58 PM
ParagJain Participant
1259 views 19 comments Go to solution
0 Likes
Subscribe

AFAIK, OData Offline Service in SMP did not support deep insert concpet (sales order header + item). Is this available now with the latest SP ? If not, what is the workaround.

Also, would be good to know if we have live implementations with OData Offline Service for ERP datasets like sales orders, invoices, deliveries, etc. which also involve posting back data to ERP.

Till now we have been using our own approach for offline due to lack of deep insert support.

Regards,

Parag.

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

midhun_vp
Active Contributor
0 Likes

Hi Parag,

Deep insert support was added in SP07. But there are limitations: You should read the SAP note : 2140598

Regards, Midhun

SAP Technology RIG

ParagJain
Participant
0 Likes

Thanks Midhun. Do we have any tutorial on this for native apps ? Virinchy already provided one for Kapsel.

midhun_vp
Active Contributor
0 Likes

To my knowledge no.

ParagJain
Participant
0 Likes

Looks like the scenario i described (order to items which is one to many) is not supported in OData nor Kapsel.

midhun_vp
Active Contributor
0 Likes

Hi Parag,

You are right, deep insert of any kind are supported in online. But in offline it supports deep inserts provided they are to a navigation that has a target of single entity.

Unfortunately, the Odata version 2 will not let us do it in offline. It might be possible in future with Odata version 4.

Regards, Midhun

SAP Technology RIG

ParagJain
Participant
0 Likes

Hmmmm..any idea when would this get implemented ?

Meanwhile, can we look at a design where we use offline store for all "reports" and metadata generated additional store with tables for entities that need deep insert.

For e.g. i would have a stock report, outstanding invoices, order status which could be in an offline store as these are only "query" requirements. and for creating a sales order, use own tables.

Would this be recommended approach or any pros/cons around it ?

Currently we are generating tables using the metadata and doing all the plumbing for an offline sync. This can be partially eliminated with the approach i described.

Regards,

Parag.

former_member220979
Participant
0 Likes

Hi Parag,

Can you please provide me the link to Kapsel tutorial for deep insert.

Thanks,

Chirag.

ParagJain
Participant
0 Likes

See the replies above. Copy/Pasting again:

former_member220979
Participant
0 Likes

Hi Midhun,

Please provide me useful links or pointers about deep update in offline mode. The scenario for me is to add Items into existing Product. The model structure looks like:

Products: [ {

          ID: "ProductID1"

          Items: []

     },

      {

          ID: "ProductID2"

          Items: []

     },

]

I have the latest version of SMP Client SDK. The app is Kapsel based app targeted for Windows platform.

Thanks,

Chirag.

midhun_vp
Active Contributor
0 Likes

Hi Parag,

I don't understand.

Regards, Midhun

SAP Technology RIG

midhun_vp
Active Contributor
0 Likes

Hi Chirag,

You should go through the SAP note I have provided to understand what is possible right now. Then follow the example : http://scn.sap.com/docs/DOC-65397#deepinsert

And if you have further questions please create a new discussion with all relevant details on your requirement and what you are trying to do.

Regards, Midhun

SAP Technology RIG

former_member220979
Participant
0 Likes

Hi Midhun,

Thanks for reply. I show the blog and other examples. All example talk about creating a record at parent level. I am trying out creating a record at child level.

Please let me know any inputs.

Thanks,

Chirag.

midhun_vp
Active Contributor
0 Likes

Hi Chirag,

Is it working when the device is online?

Regards, Midhun

SAP Technology RIG

former_member220979
Participant
0 Likes

Hi Midhun,

Yes it's working fine in online mode. It's an issue with offline mode only.

To be more specific the model looks like:

WorkOrders : [

      0: {

           WorkOrderID: “111”,

           WorkOrderDesc: “Description 111”,

           Measurements: []

          },

      1: {

           WorkOrderID: “111”,

           WorkOrderDesc: “Description 111”,

           Measurements: []

          }

]

Now I would like to create a Measurement record for WorkOrder with WorkOrderID: “111”. The creation of record needs to happen in Offline mode.

Thanks,

Chirag.

rakshit_doshi
Active Contributor
0 Likes

Hi Chirag,

How did you design the oData Entity Sets for this?

I assume this is a create operation that you are trying to implement

Thanks,

Rakshit Doshi

ParagJain
Participant
0 Likes

If OData Offline doesnt support deep insert, what is the alternate ? I guess this would be to have an own data store to persist the device data and code for a "sync" - which we can avoid when using OData offline as the framework takes care of the "sync" and caching.

Regards,

Parag.

david_brandow
Product and Topic Expert
Product and Topic Expert
0 Likes

It should be noted that deep inserts are a specific way of creating relationships on the client. There are many other ways of doing the same thing in OData which are fully supported by the Offline OData component.

Answers (1)

Answers (1)

Virinchy
Active Contributor
0 Likes

Hi Parag,

Are you developing Hybrid / Native Apps? Also which platforms are you targeting (Android/Ios/ Windows)?

If developing Hybrid apps with Kapsel SDK of SMP 3.0 , please upgrade to minimum of SMP 3.0 SP08 SDK at the earliest to use the deep insert capabilities in the application. SP09 PL07 is the current version available.

Please refer the below link  for an example of deep insert.

Regards

Virinchy

ParagJain
Participant
0 Likes

Thank you, looking at native apps (Android / iOS / Windows).