Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Deep insert using Model.create()?

$
0
0

Hi,

     Can we use model.create() of  class sap.ui.model.odata.ODataModel for deep insert operation.

     I have an OData service for PO creation in which the header and item details has to be inserted in a single POST operation.

     Is it possible to use model.create() for this.

     The xml format of POST data is

 

<?xml version="1.0" encoding="UTF-8"?>

<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

  <atom:content type="application/xml">

   <m:properties>

    <d:PurGroup>AR1</d:PurGroup>

    <d:PurchOrg>7500</d:PurchOrg>

    <d:Vendor>0000100073</d:Vendor>

    <d:DocType>NB</d:DocType>

    <d:CoCode>7500</d:CoCode>

    </m:properties>

  </atom:content>

<atom:link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PurchaseOrderItem" type="application/atom+xml;type=feed" title="Z_DEEP_INSERT_SRV.A_T_ITEMS">

  <m:inline>

   <atom:feed>

    <atom:entry>

     <atom:content type="application/xml">

      <m:properties>

       <d:Plant>7500</d:Plant>

       <d:PurMat>PAPEL</d:PurMat>

       <d:Material>PAPEL</d:Material>

       <d:PoItem>00001</d:PoItem>

       <d:PoNumber>01234</d:PoNumber>

      </m:properties>

     </atom:content>

    </atom:entry>

    <atom:entry>

     <atom:content type="application/xml">

      <m:properties>

       <d:Plant>7500</d:Plant>

       <d:PurMat>PAPEL1</d:PurMat>

       <d:Material>PAPEL1</d:Material>

       <d:PoItem>00002</d:PoItem>

       <d:PoNumber>01234</d:PoNumber>

      </m:properties>

     </atom:content>

    </atom:entry>

   </atom:feed>

  </m:inline>

</atom:link>

</atom:entry>

 

 


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>