cancel
Showing results for 
Search instead for 
Did you mean: 

Where is "update_deep_entity"?

Clucking
Participant
0 Kudos

Hi,

I can find methods in the API's for create_deep_entity via POST, get_expanded_entityset for QUERY and get_expanded_entity for READ.

But I cannot find method update_deep_entity or something like this in any classes or interfaces. Is this correct?

Br,

Claus.

Accepted Solutions (1)

Accepted Solutions (1)

Jeff-Gebo
Advisor
Advisor
0 Kudos

Hi Claus,

The odata specification does not support a deep update...strange I know, but there are some technical reasons for it. I'll let me development colleagues chime in on that one. That said, in SP4 (due out mid-May) we will support $batch which will allow for similar functionality. For now I suggest you read this info about $batch from the odata website:

http://www.odata.org/documentation/batch

Cheers,
Jeff

Former Member
0 Kudos

Jeff,

Is there any documentation yet for the SAP side using batch requests? I think this would solve the messy code we are having to use to build deep insert requests from .NET to the GW server...

Thanks,

Mike

Jeff-Gebo
Advisor
Advisor
0 Kudos

Hi Mike,

that batch requests aren't yet documented since they aren't yet supported. This will be supported in SP4, which is due out mid-May if all goes well. The associated SP4 documentation will be released at the same time on the SAP Help Portal.


Cheers,
Jeff

Clucking
Participant
0 Kudos

Thanks, Jeff. So if I understand it correctly - currently you cannot e.g. update a salesorder header together with item changes in one call?

Sorry - but I am totally new to this area...

Former Member
0 Kudos

Claus,

The only thing you could do it have a flattened model with the header and single item and update just that...but for multiple items with one call, I don't think it's currently possible.

Mike

Jeff-Gebo
Advisor
Advisor
0 Kudos

Hi Claus,

currently (as of SP3) you can not easily do an update to multiple line items and the sales header. That said, I have seen it done where a string is used to pass an XML representation of the line items...this works fine but requires more development.

That said, in SP4 with the Batch command you will be able to do this scenario.

Just to reiterate what I said above, the reason for Gateway not having a Deep Update is due to the OData standard.

SP4 is due out in Mid May if all goes well.

Cheers,
Jeff

Clucking
Participant
0 Kudos

Okay, thanks guys. Much appreciated.

Former Member
0 Kudos

Any update on UPDATE multiple line items for sales order? If you have any documentation that would really help. I could not find anything under

http://www.odata.org/documentation/batch

I tried updating both header & Item together and it gets updated together but only with single item. The Inline does not support for update but in Create.

Any help is highly appreciated.

Thanks,

AshwinDutt
Active Contributor
0 Kudos

Hello Joby,

You can update the item level details of a sales order with BATCH operation.

We cannot update multiple line items of a sales order in a single operation/body like how we fire our create_deep_entity. We cannot update like how we fire deep entity.

We need to fire multiple operations i.e., multiple update operations for a particular sales order in batch mode in a single request

Regards,

Ashwin

Answers (1)

Answers (1)

Former Member
0 Kudos

Well hi there,

It's over a year later and this method still has not been implemented.

Any updates?

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Tatjana,

as Jeff already pointed out the OData standard does currently not support an "deep update".

That's why we have not implemented it.

Best Regards,

Andre

UweFetzer_se38
Active Contributor
0 Kudos

... and I totally understand why.

You CREATE a whole sales order

You READ a whole sales order

But you UPDATE a single line item or the header. For what daily purpose you need a deep update?

fred_verheul
Active Contributor
0 Kudos

...because in daily life people frequently update the header as well as multiple line items simultaneously?

Sorry, couldn't resist .

UweFetzer_se38
Active Contributor
0 Kudos

...maybe in Holland but not in Duitsland.

Sorry, couldn't resist

kammaje_cis
Active Contributor
0 Kudos

Uwe,

I have a scenario.

I have a UI5 application, where user is given a grid like interface to update multiple line items. (Editing inside Grid). So I would like to update multiple line items in this case in addition to header.

I have seen a Fiori application, where this is done by a regular POST. (Not PUT) . If the record already exists then header and children are updated, else created.

regards

Krishna

UweFetzer_se38
Active Contributor
0 Kudos

Maybe they are using the batch function?

Or they use a flat string (XML with all items) -> but this is not OData, just a workaround

As far as I know (correct me if I'm wrong) with the OData standard it's still not possible to change multiple line (deep update) and therefore SAP will not implement this function into GW.

kammaje_cis
Active Contributor
0 Kudos

Yes it is not possible to update deep in GW.

I was talking about other work around I saw in Fiori.

That is, doing a Update using "Deep Insert".

UweFetzer_se38
Active Contributor
0 Kudos

Now I get your remark. Sorry.

Yes, this is also possible, but really just a workaround, because this is not very RESTful (to say it in a kind way).

kammaje_cis
Active Contributor
0 Kudos

Yeah....I agree.

When SAP says that all its UI is converging towards FIori, then I guess we need something more than just OData. What do you think? Scenarios like this are very common.

I have started working with FIori, and see that FIori Apps are using OData/REST workarounds very often. I do not think it is limitation of the Fiori Developer, rather wanting to stick with OData at all costs including workarounds.

kammaje_cis
Active Contributor
0 Kudos

Fiori Application I was talking about was "My Quotations" and update of quotation header and items is done by Deep Insert.

jpenninkhof
Product and Topic Expert
Product and Topic Expert
0 Kudos

I don't think we need those deep updates and even deep inserts for that matter. In modern interfaces, including the ones built with UI5, I would recommend leaving the paradigm of only transferring data to the server when the user presses the save button. Instead, I think you should save as you type, and send updates to the server e.g.  line by line. If there is still a need for a save button in your order form, it would be merely a confirmation or "commit" if you like.

When you build your applications this way, your users will love you. No more lost work when the browser (or something else) crashes after entering all those lines. Just fall back on the auto saved order that was progressively saved for them.

Just my $0.02.

Cheers,

Jan

kammaje_cis
Active Contributor
0 Kudos

I would love to have an UI like that but not convinced if that would work in all scenarios.

For example:

- I actually have a use case where Sales Order items is a hierarchy and we have a drag and drop feature planned to rearrange the hierarchy. That action would result in changing more than one items' hierarchy at a time.

- There is a feature to select more than one order items and update any of vendor/shipping-address/requested-delivery-date for all of them.

On the other note, Save button cannot be used for 'Commit' since each of these update calls will be stateless.

jpenninkhof
Product and Topic Expert
Product and Topic Expert
0 Kudos

The examples you mentioned, are typical use cases of custom functions. I would use a custom function to perform the data transformation server side instead of pulling the entire order to the client, transforming it there and pushing it back again.

I think you misunderstood me when it came down to the save button. With the commit I wasn't referring to a database type commit, but to a functional commit. Perhaps "confirm" would be a better word.

Best,

Jan

kammaje_cis
Active Contributor
0 Kudos

Interesting thought.  I currently have such a requirement. Currently I have used a deep insert as a deep update. (enhanced SAP's My quotation service)

How would you model such a "custom function"? or how would the URI look like?

Let us take example of: Updating 7 out of 10 Sales Order items with a new Shipping address.

Also, on another note, what would 'confirm'  button do?

Former Member
0 Kudos

Hi Krishna,

Thanks for your idea. I tried multiple line items update using CREATE_DEEP and it did update multiple lines. This was exactly my requirement. I implemented the code within CREATE_DEEP method with a flag set for "create/change/delete/simulate" etc.. and that worked..

Thanks a lot.

Former Member
0 Kudos

Both of these can be accomplished by $batch, so why subvert the protocol by doing it a non-standard way? Use the tools provided, even if it is a pain at times.

I agree with Jan, the whole "deep update" idea needs to go away, it's wrong thinking. OData is based on http, wherein you cannot navigate to more than one single entity at a time; the best you can manage is a collection of that entity. If you want associated entities or collections, you need to navigate to them too, probably collecting information along the way. So it seems long-winded because we are used to data contexts that are tightly coupled to the server. However anyone who has used WDA or similar that uses contexts will know how much bloody coding is needed to access a simple attribute In that context, batching is not really makiig life any harder, it's just relocating the load.

Trying to emulate another design paradigm is wrong - learn to do it with the current paradigm.