Hi Experts!
I´m working on a program where I will create a loan contract. When posting the data I have to consider deep insert. I have no clue how to do this.
Here is my oDataModel.create:
oDataModel.create("LoanItemCollection", newData, null, function(){
sap.m.MessageToast.show("Workflow successfully delivered!", {});
},function(){
sap.m.MessageToast.show("Sent Workflow failed!", {});
});
How do I have to structure my var newData = { .... };
Here is my XML:
<?xml version="1.0" encoding="utf-8"?>
<entryxml:base="XXXXXXXXXXX/sap/opu/odata/sap/ZIG_LOAN_ERP_SRV/" xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<link href="LoanItemCollection(CompCode='abcd',ContractNo='abcdefghijklm')" rel="self" title="LoanItem"/> <content type="application/xml">
<m:properties>
<d:CompCode>
1000</d:CompCode>
<d:Status>
20</d:Status>
<d:ProdType>
30A</d:ProdType>
<d:CurrencyIso>
EUR</d:CurrencyIso>
<d:Partner>
0300000286</d:Partner>
</m:properties>
</content>
<linkhref="LoanItemCollection(CompCode='abcd',ContractNo='abcdefghijklm')/LoanConditionHeaderItem" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/LoanConditionHeaderItem" type="application/atom+xml;type=feed" title="LoanConditionHeaderItem">
<m:inline>
<feedxml:base="XXXXXX/sap/opu/odata/sap/ZIG_LOAN_ERP_SRV/">
<entry>
<content type="application/xml">
<m:properties>
<d:ConditionValidFrom>
2014-05-01T00:00:00</d:ConditionValidFrom>
<d:TermStart>
2014-05-01T00:00:00</d:TermStart>
<d:FinalDueDate>
2019-05-31T00:00:00</d:FinalDueDate>
<d:FixedUnt>
2019-05-31T00:00:00</d:FixedUnt>
<d:CommCap>
100000.0000</d:CommCap>
<d:CurrencyIso1>
EUR</d:CurrencyIso1>
</m:properties>
</content>
<linkhref="LoanConditionHeaderItemCollection(ContractNo='abcdefghijklm',CompCode='abcd',ProductCategory='300',Key1='abcdefghijklm',ConditionValidFrom=datetime'1990-12-31T23%3A59%3A59',ConsNo='001')/LoanConditionItem" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/LoanConditionItem" type="application/atom+xml;type=feed" title="LoanConditionItem">
<m:inline>
<feedxml:base="XXXXXXXXX/sap/opu/odata/sap/ZIG_LOAN_ERP_SRV/">
<entry>
<content type="application/xml">
<m:properties>
<d:ConditionType>
0100</d:ConditionType>
<d:ValidFrom>
2014-06-01T00:00:00</d:ValidFrom>
<d:PercentageRate>
2.0000000</d:PercentageRate>
<d:AmountCurr>
0.0000</d:AmountCurr>
<d:CurrencyIso>
EUR</d:CurrencyIso>
<d:CalcDate>
2014-06-30T00:00:00</d:CalcDate>
<d:DueDate>
2014-06-30T00:00:00</d:DueDate>
<d:PmntfDay>
MN</d:PmntfDay>
</m:properties>
</content>
</entry>
<entry>
<content type="application/xml">
<m:properties>
<d:ConditionType>
0121</d:ConditionType>
<d:ValidFrom>
2014-06-01T00:00:00</d:ValidFrom>
<d:PercentageRate>
0.0000000</d:PercentageRate>
<d:AmountCurr>
1752.7700</d:AmountCurr>
<d:CurrencyIso>
EUR</d:CurrencyIso>
<d:CalcDate>
2014-06-30T00:00:00</d:CalcDate>
<d:DueDate>
2014-06-30T00:00:00</d:DueDate>
<d:PmntfDay>
MN</d:PmntfDay>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
</entry>
</feed>
</m:inline>
</link>
</entry>
Thanks for your help!!!
Matthias