<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Update operation of Multiple Items using Deep entity method, code based approach in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655122#M4354875</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Laksham,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How about writing an additional piece of code to identify if request is for create or update in Create Deep Entity itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As when creating you will not be having key value, and when updating you should be having key value for which you are updaing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets say after reading Payload in structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;io_data_provider-&amp;gt;read_entry_data( IMPORTING es_data = ls_struct ).&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;if ls_struct-key is initial.&amp;nbsp; "Create &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;Your &lt;SPAN style="font-size: 13.3333px;"&gt;Create &lt;/SPAN&gt;Logic&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;elseif &lt;SPAN style="font-size: 13.3333px;"&gt;ls_struct-key is not initial&lt;/SPAN&gt;. "Update&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;lt;Your &lt;SPAN style="font-size: 13.3333px;"&gt;Update &lt;/SPAN&gt;Logic&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;endif.&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tarun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 May 2016 09:25:33 GMT</pubDate>
    <dc:creator>JyotiD</dc:creator>
    <dc:date>2016-05-23T09:25:33Z</dc:date>
    <item>
      <title>Update operation of Multiple Items using Deep entity method, code based approach</title>
      <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaq-p/11655121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am aware that create_deep_entity method is generally used for creating deep entities in OData. However , If we need to perform an update operation on multiple items without using $Batch functionality we need to manually implement a code based approach on&amp;nbsp; create_deep_entity method using extension _*EXT class. How can this be achieved ?Generally this method gets called when we are performing a deep entity operation and the same cannot be applied while doing an update&amp;nbsp; request on multiple items. Please advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Lakshman.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 09:02:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaq-p/11655121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-05-23T09:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Update operation of Multiple Items using Deep entity method, code based approach</title>
      <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655122#M4354875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Laksham,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How about writing an additional piece of code to identify if request is for create or update in Create Deep Entity itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As when creating you will not be having key value, and when updating you should be having key value for which you are updaing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets say after reading Payload in structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;io_data_provider-&amp;gt;read_entry_data( IMPORTING es_data = ls_struct ).&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;if ls_struct-key is initial.&amp;nbsp; "Create &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;Your &lt;SPAN style="font-size: 13.3333px;"&gt;Create &lt;/SPAN&gt;Logic&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;elseif &lt;SPAN style="font-size: 13.3333px;"&gt;ls_struct-key is not initial&lt;/SPAN&gt;. "Update&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;lt;Your &lt;SPAN style="font-size: 13.3333px;"&gt;Update &lt;/SPAN&gt;Logic&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;endif.&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tarun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 09:25:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655122#M4354875</guid>
      <dc:creator>JyotiD</dc:creator>
      <dc:date>2016-05-23T09:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Update operation of Multiple Items using Deep entity method, code based approach</title>
      <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655123#M4354876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tarun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Agree it as an alternative , but per coding standards will it always work. There should be some official way to do that. Any Ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And one more question, We are doing an update operation and we're&amp;nbsp; going to select PUT operation. But create_deep_entity is purely for POST operation. In what way this is going to be trigerred during an PUT operation and we dont have a method like update_deep_entity as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Lakshman.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 10:26:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655123#M4354876</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-05-23T10:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Update operation of Multiple Items using Deep entity method, code based approach</title>
      <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655124#M4354877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi lakshman,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I also face the same problem some time back, there is no official way to do so as there is not such provided in '_EXT' class. I will agree with the approach suggested by TARUN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ashish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 10:33:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655124#M4354877</guid>
      <dc:creator>Ashg1402</dc:creator>
      <dc:date>2016-05-23T10:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Update operation of Multiple Items using Deep entity method, code based approach</title>
      <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655125#M4354878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lakshman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The easiest way would be to have an additional property of flag which contains the operation that you are trying to perform ('C' = Create, 'U' = Update). Now when you hit the POST call with navigation property of your line items, you can check the flag and change your functionality accordingly in the Deep_Insert method.&lt;/P&gt;&lt;P&gt;Let us know if we failed to understand your question in the correct way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ekansh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 10:39:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655125#M4354878</guid>
      <dc:creator>EkanshCapgemini</dc:creator>
      <dc:date>2016-05-23T10:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Update operation of Multiple Items using Deep entity method, code based approach</title>
      <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655126#M4354879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lakshman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no such thing like 'Deep Update' for OData v2 and thus not supported in SAP Gateway as well. As per the standard, 'Create_Deep_Entity' is for CREATE operation only thus can not be triggered by PUT operation. However you can use it as a workaround. In this case, you have to trigger a POST call for both the operations(Create/Update).&lt;/P&gt;&lt;P&gt;The recommended approach as per the standards is to use $batch 'changeset at once'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ekansh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 10:43:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655126#M4354879</guid>
      <dc:creator>EkanshCapgemini</dc:creator>
      <dc:date>2016-05-23T10:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Update operation of Multiple Items using Deep entity method, code based approach</title>
      <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655127#M4354880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ekansh,You're clear on what I have asked. Even I had the same thought , An additional property as an entity .But what would be the best way to update this flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You mean in the front end itself we're going to design POST and PUT&amp;nbsp; URL in such a way that this Flag&amp;nbsp; parameter is populated based on the operation we perform? Am I Right&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 10:45:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655127#M4354880</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-05-23T10:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Update operation of Multiple Items using Deep entity method, code based approach</title>
      <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655128#M4354881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Laksham,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Well I don't found Update deep entity method in framework, so had to go with this workaround and &lt;/SPAN&gt;It saved me many time without any issues. &lt;SPAN __jive_emoticon_name="silly" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/108/images/emoticons/silly.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As per this you will have to use POST operation only in both case (Create, Update).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only diff will be in your Payload, while Create you don't have to pass header key(i.e. null values) and when doing Update provide the value against &lt;SPAN style="font-size: 13.3333px;"&gt;key Property&lt;/SPAN&gt; in Payload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg. You are working with SO and SO Item, so when you are creating new sales order you have to pass null values for sales document (vbeln) in your payload, so your logic will do an create operation and new sales order will be created.&lt;/P&gt;&lt;P&gt;and when updating sales order, pass the sales document in payload, identify it in create deep entity method and your &lt;SPAN style="font-size: 13.3333px;"&gt;update logic will be executed&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once using POST, create deep entity method is triggered you can identify within code, which operations to be performed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-avatarid="-1" data-userid="708785" data-username="ashwindutt.r" href="https://answers.sap.com/people/ashwindutt.r" style="font-size: 12px; font-weight: bold; text-align: center; font-family: inherit; font-style: inherit; color: #3778c7; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"&gt;Ashwin Dutt R&lt;/A&gt;&lt;A _jive_internal="true" data-avatarid="59352" data-userid="537603" data-username="ekansh005" href="https://answers.sap.com/people/ekansh005" style="font-weight: bold; font-style: inherit; font-family: inherit; color: #3778c7; background: transparent;"&gt;Ekansh Saxena&lt;/A&gt;&amp;nbsp; Even I would like to know, if there is better or official approach for this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tarun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 10:54:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655128#M4354881</guid>
      <dc:creator>JyotiD</dc:creator>
      <dc:date>2016-05-23T10:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Update operation of Multiple Items using Deep entity method, code based approach</title>
      <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655129#M4354882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you are correct.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 10:58:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655129#M4354882</guid>
      <dc:creator>EkanshCapgemini</dc:creator>
      <dc:date>2016-05-23T10:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Update operation of Multiple Items using Deep entity method, code based approach</title>
      <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655130#M4354883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My Bad. Already quite a lot happened in discussion, I can see now....&lt;SPAN __jive_emoticon_name="silly" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/108/images/emoticons/silly.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 11:00:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655130#M4354883</guid>
      <dc:creator>JyotiD</dc:creator>
      <dc:date>2016-05-23T11:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Update operation of Multiple Items using Deep entity method, code based approach</title>
      <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655131#M4354884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tarun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The standard way to achieve this would be using $batch with 'chagneset at once/changeset in differ mode' . You can find more details about this in the below mentioned blog link&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="57113" __jive_macro_name="document" class="jive_macro_document jive_macro" data-orig-content="Details about some new features in SAP Gateway 2.0 SP09" href="https://community.sap.com/" modifiedtitle="true" title="Details about some new features in SAP Gateway 2.0 SP09"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However there is some performance gain in using Deep_Insert workaround in contrast to batch. &lt;/P&gt;&lt;P&gt;&lt;A __default_attr="66893" __jive_macro_name="document" class="jive_macro_document jive_macro" data-orig-content="Performance considerations for mass creation scenarios when using OData and SAP Gateway" href="https://community.sap.com/" modifiedtitle="true" title="Performance considerations for mass creation scenarios when using OData and SAP Gateway"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This topic has already been discusses quite a lot in past. One can check this link (one of many on same topic &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/111/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt; )&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="3784022" __jive_macro_name="thread" class="jive_macro_thread jive_macro" data-orig-content="UpdateEntity" href="https://community.sap.com/" modifiedtitle="true" title="UpdateEntity"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ekansh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 11:14:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655131#M4354884</guid>
      <dc:creator>EkanshCapgemini</dc:creator>
      <dc:date>2016-05-23T11:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Update operation of Multiple Items using Deep entity method, code based approach</title>
      <link>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655132#M4354885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, This has been widely discussed in the forums. &lt;/P&gt;&lt;P&gt;Thanks everyone for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 May 2016 12:59:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/update-operation-of-multiple-items-using-deep-entity-method-code-based/qaa-p/11655132#M4354885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-05-23T12:59:25Z</dc:date>
    </item>
  </channel>
</rss>

