on 11-09-2013 1:37 PM
Hello Experts,
I am using DeepInsert Method for Creating Return Order Header and Items Creation(Parent and Child) relation that too based on a Existing Return order creation RFC. I am getting 500 internal server error as "No valid source context supplied" and In gateway error log "DeSerialization of XML Failed via transformation 'ID'" . Also I tried to keep the edm core type abap field for date as Nullable & Internal type as Date , decimal values with Packed but it's not accepting to change the datatype as it is different from Abap Type.
In Detail:-
I have 5 Entitysets for Header,Partner,Items,Conditions,Schedues.
Out of them I am using Header Entityset in the POST URL(http://host:port/sap/opu/odata/ZRETURNS_SRV/HeaderCollection)
and passing Header, Items,Partners,conditions,schedules inline entries via rest client based on http://scn.sap.com/docs/DOC-22305 .
Is that approach correct of having 5entity sets and passing only HeaderSet in URL ? The below Request Body shows the Inline entries belonging to all the Entitysets. So here the doubt arise , the way of passing the Inline entries is correct or any other approach for different entitysets.
URL:-http://host:port/sap/opu/odata/ZRETURNS_SRV/HeaderCollection
RequestBody:-
<?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:DocType>RE</d:DocType>
<d:SalesOrg>1000</d:SalesOrg>
<d:DistrChan>10</d:DistrChan>
<d:Division>10</d:Division>
<d:DateType>1</d:DateType>
<d:OrdReason>101</d:OrdReason>
<d:PartnRole>AG</d:PartnRole>
<d:PartnNumb>0000000011</d:PartnNumb>
</m:properties>
</atom:content>
<atom:link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/SOItems"
type="application/atom+xml;type=feed"
title="Header_Items">
<m:inline>
<atom:feed>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:ItmNumber>000010</d:ItmNumber>
<d:Material>P500042</d:Material>
<d:Plant>1000</d:Plant>
<d:StoreLoc>1000</d:StoreLoc>
<d:TargetQty>5.000</d:TargetQty>
<d:TargetQu>EA</d:TargetQu>
<d:ShortText>JACK DANIELS WHISKEY</d:ShortText>
<d:MatlGroup>50200000</d:MatlGroup>
<d:CondStNo>011</d:CondStNo>
<d:CondCount>01</d:CondCount>
<d:CondType>PR00</d:CondType>
<d:Currency>USD</d:Currency>
<d:ReqDate>11-11-2013</d:ReqDate>
<d:ReqQty>5.000</d:ReqQty>
</m:properties>
</atom:content>
</atom:entry>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:ItmNumber>000020</d:ItmNumber>
<d:Material>P500042</d:Material>
<d:Plant>1000</d:Plant>
<d:StoreLoc>1000</d:StoreLoc>
<d:TargetQty>5.000</d:TargetQty>
<d:TargetQu>EA</d:TargetQu>
<d:ShortText>BRANDY</d:ShortText>
<d:MatlGroup>50200000</d:MatlGroup>
<d:CondStNo>011</d:CondStNo>
<d:CondCount>01</d:CondCount>
<d:CondType>PR00</d:CondType>
<d:Currency>USD</d:Currency>
<d:ReqDate>11-11-2013</d:ReqDate>
<d:ReqQty>5.000</d:ReqQty>
</m:properties>
</atom:content>
</atom:entry>
</atom:feed>
</m:inline>
</atom:link>
</atom:entry>
Appreciate your help.
Thanks,
Uday.
Hi Uday,
Here I attach a sample request body for post request
<?xml version="1.0" encoding="utf-8"?>
<entry xml:base="https://xxxxxxx/sap/opu/odata/sap/ZTEST_DI_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">
<category term="ZTEST_DI_SRV.Ent1" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link href="Ent1Set(Name='Atanu',Id='1')/ENT2SET" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ENT2SET" type="application/atom+xml;type=feed" title="ENT2SET">
<m:inline>
<feed xml:base="XXXXX/sap/opu/odata/sap/ZTEST_DI_SRV/">
<link href="Ent1Set(Name='Atanu',Id='1')/ENT2SET" rel="self" title="Ent2Set"/>
<entry>
<category term="ZTEST_DI_SRV.Ent2" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:Desc>Atanu Mallik</d:Desc>
<d:Id>1</d:Id>
</m:properties>
</content>
</entry>
<entry>
<category term="ZTEST_DI_SRV.Ent2" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:Desc>Atanu Mallik2</d:Desc>
<d:Id>1</d:Id>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<content type="application/xml">
<m:properties>
<d:Name>Atanu</d:Name>
<d:Id>1</d:Id>
</m:properties>
</content>
</entry>
JSON format would be even simpler
{d:{"Name":"Atanu", "Id" : "1" , "ENT2SET" : [{"Id":"1" , "Desc" :"Atanu 2"}]}}
Regards,
Atanu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Krishna,
I Checked by Passing empty date and still it's throwing error as "No valid source context supplied" and In gateway Error log as "DeSerialization of XML failed via transformation ID". Also when I put external break point in CREATE_DEEP_ENTITY it's not getting triggered, Instead it is calling CREATE_ENTITY method .
Body:-
<?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:DocType>RE</d:DocType>
<d:SalesOrg>1000</d:SalesOrg>
<d:DistrChan>10</d:DistrChan>
<d:Division>10</d:Division>
<d:DateType>1</d:DateType>
<d:OrdReason>101</d:OrdReason>
</m:properties>
</atom:content>
<atom:link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Items"
type="application/atom+xml;type=feed"
title="Z_RETURN_ORDER_SRV.Header_Items">
<m:inline>
<atom:feed>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:ItmNumber>000010</d:ItmNumber>
<d:Material>P500042</d:Material>
<d:Plant>1000</d:Plant>
<d:StoreLoc>1000</d:StoreLoc>
<d:TargetQty>5.000</d:TargetQty>
<d:TargetQu>EA</d:TargetQu>
<d:ShortText>Laptop</d:ShortText>
<d:MatlGroup>50200000</d:MatlGroup>
<d:CondStNo>011</d:CondStNo>
<d:CondCount>01</d:CondCount>
<d:CondType>PR00</d:CondType>
<d:Currency>USD</d:Currency>
<d:ReqDate></d:ReqDate>
<d:ReqQty>5.000</d:ReqQty>
</m:properties>
</atom:content>
</atom:entry>
</atom:feed>
</m:inline>
</atom:link>
</atom:entry>
In Above code Header_Items is the Association Name and Items refers to types in MPC. Is that the way of declaration correct else do i need to change any thing ...
Appreciate your help.
Thanks,
Uday.
Hi Uday,
Did you solve the problem - DeSerialization of XML Failed via transformation 'ID'?
I also get this error, although I have used $expand output to create request body for Deep Insert.
Thanks,
Maja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maja,
Can you check if the solution given here helps?
Search for your error message.
Krishna
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.