Hi experts
i wanna perform create service on the details mentioned here
here we have a parent entity set /headerset
in this parent entityset we have child entitysets Headertoprocess,Headertotask and Headertoitem
now i have written the following code
var payload = {
"InspectionLot": "1233",
"Matnr": "123",
"Floc": "TM",
"Equipment": "123",
"Assembly": "TM",
"RefNo": "123",
"Demandorder": "TM",
"Unit": "123",
"System": "TM",
"InspectionTyp": "123",
"InspectionTxt": "TM",
"Descr": "123",
"ObjPrt": "TM",
"DefectTyp": "123",
"Cause": "TM",
"Priority": "1",
"Startdate": "",
"Enddate": "",
"Author": "TM",
"Mplant": "123",
"Location": "TM",
"Mode": "1"
};
//var oModel = new sap.ui.model.odata.ODataModel(oService,true);
var oModel = this.getModel();
oModel.create("/HeaderSet", payload, null,
function(oData, oResponse) {
alert("success");
},
function(oError) {
});
},
but how to read the child entitysets, payload is mentioned below
please help
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
payload :
/sap/opu/odata/sap/ZGW_QM_E_55_NOTIF_SRV/HeaderSet
Payload for notification create.
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<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:NotifNo/>
<d:InspectionLot>000000000000</d:InspectionLot>
<d:Matnr >123</d:Matnr >
<d:Floc />
<d:Equipment />
<d:Assembly />
<d:RefNo />
<d:Demandorder />
<d:Testpath />
<d:Unit />
<d:System />
<d:Sno />
<d:Batch />
<d:Plant />
<d:InspectionTyp />
<d:InspectionTxt />
<d:Descr />
<d:ObjPrt />
<d:DefectTyp />
<d:Cause />
<d:Priority />
<d:Startdate m:null="true" />
<d:Enddate m:null="true" />
<d:Author />
<d:Mplant />
<d:Location />
<d:Mode />
</m:properties>
</atom:content>
<atom:link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Naviprocess"
type="application/atom+xml;type=feed"
title="ZGW_QM_E_55_NOTIF_SRV.Headertoprocess">
<m:inline>
<atom:feed>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:Function>1</d:Function >
<d:Partner >X</d:Partner >
<d:Name >Abhishek</d:Name >
</m:properties>
</atom:content>
</atom:entry>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:Function >X</d:Function >
<d:Partner>12</d:Partner >
<d:Name >Capgemini</d:Name >
</m:properties>
</atom:content>
</atom:entry>
</atom:feed>
</m:inline>
</atom:link>
<atom:link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Navitask"
type="application/atom+xml;type=feed"
title="ZGW_QM_E_55_NOTIF_SRV.Headertotask">
<m:inline>
<atom:feed>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:Task />
<d:Status />
<d:Startdate m:null="true" />
<d:Enddate m:null="true" />
<d:Name />
<d:Codegrp >12</d:Codegrp >
<d:Taskcode />
<d:TaskTxt >test</d:TaskTxt >
<d:TaskCinfo >X</d:TaskCinfo >
<d:Processor >X</d:Processor >
<d:Responsible >X</d:Responsible>
<d:ListNam >X</d:ListNam >
</m:properties>
</atom:content>
</atom:entry>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:Task />
<d:Status />
<d:Startdate m:null="true" />
<d:Enddate m:null="true" />
<d:Name />
<d:Codegrp />
<d:Taskcode >02</d:Taskcode >
<d:TaskTxt >test1</d:TaskTxt >
<d:TaskCinfo />
<d:Processor >X</d:Processor >
<d:Responsible >X</d:Responsible>
<d:ListNam />
</m:properties>
</atom:content>
</atom:entry>
</atom:feed>
</m:inline>
</atom:link>
<atom:link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Navitem"
type="application/atom+xml;type=feed"
title="ZGW_QM_E_55_NOTIF_SRV.Headertoitem">
<m:inline>
<atom:feed>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:Itemno>0001</d:Itemno>
<d:DefectCat />
<d:DefectTyp />
<d:ObjPart />
<d:Descr >this is for test</d:Descr >
<d:Cause />
<d:Codegrp />
</m:properties>
</atom:content>
</atom:entry>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:Itemno>20</d:Itemno>
<d:DefectCat/>
<d:DefectTyp />
<d:ObjPart />
<d:Descr />
<d:Cause />
<d:Codegrp />
</m:properties>
</atom:content>
</atom:entry>
</atom:feed>
</m:inline>
</atom:link>
</atom:entry>