Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding payload isse

Former Member
0 Likes
1,349

I encountered a payload issue when I execute the following using HTTP POST. The result just process the "Test Header1" and then stop. I have traced program but cannot find any reasons ...

< Result >

<?xml version="1.0" encoding="UTF-8"?> -<entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom" xml:base="http://domain:8000/sap/opu/odata/SAP/ZGW_DEEP_INSERT_SRV/"> <id>http://domain:8000/sap/opu/odata/SAP/ZGW_DEEP_INSERT_SRV/HeaderSet('100')</id> <title type="text">HeaderSet('100')</title> <updated>2019-12-04T07:34:54Z</updated> <category scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" term="ZGW_DEEP_INSERT_SRV.Header"/> <link title="Header" rel="self" href="HeaderSet('100')"/> -<link title="HeadItemT" type="application/atom+xml;type=feed" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/HeadItemT" href="HeaderSet('100')/HeadItemT"> <m:inline/> </link> -<link title="HeadItemO" type="application/atom+xml;type=feed" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/HeadItemO" href="HeaderSet('100')/HeadItemO"> <m:inline/> </link> -<content type="application/xml"> -<m:properties> <d:Id>100</d:Id> <d:Name>Test</d:Name> <d:Name2>Test Header1</d:Name2> </m:properties> </content> </entry>

< Payload>

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L1S33 { color: #009300; }

<?xml version="1.0" encoding="UTF-8"?>
<atom:entry
xmlns:atom="http://www.w3.org/2005/Atom"
xml:base="http://domain:8000/sap/opu/odata/sap/ZGW_DEEP_INSERT_SRV/"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<atom:content type="application/xml">
<m:properties>
<d:Id>100</d:Id>
<d:Name>Test</d:Name>
<d:Name2>Test Header1</d:Name2>
</m:properties>
</atom:content>
<atom:link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/HeadItemO" type="application/atom+xml;type=feed"
title="HeadItemO">
<m:inline>
<atom:feed>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:IdO>100</d:IdO>
<d:NameO>Test Item11</d:NameO>
</m:properties>
</atom:content>
</atom:entry>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:IdO>100</d:IdO>
<d:NameO>Test Item12</d:NameO>
</m:properties>
</atom:content>
</atom:entry>
</atom:feed>
</m:inline>
</atom:link>
<atom:link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/HeadItemT" type="application/atom+xml;type=feed"
title="HeadItemT">
<m:inline>
<atom:feed>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:IdT>100</d:IdT>
<d:NameT>Test Item21</d:NameT>
</m:properties>
</atom:content>
</atom:entry>
</atom:feed>
</m:inline>
</atom:link>
</atom:entry>

1 ACCEPTED SOLUTION
Read only

cdprasanna
Active Participant
0 Likes
1,208

hi,

As Andy Yen mentioned above make sure variable names is same as of ‘Navigation Property‘ name created in Entity ‘Header’, refer blog post deep insert.

Hope it helps you.

I encountered a payload issue when I execute the following using HTTP POST. The result just process the "Test Header1" and then stop. I have traced program but cannot find any reasons ...

< Result >

<?xml version="1.0" encoding="UTF-8"?> -<entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom" xml:base="http://domain:8000/sap/opu/odata/SAP/ZGW_DEEP_INSERT_SRV/"> <id>http://domain:8000/sap/opu/odata/SAP/ZGW_DEEP_INSERT_SRV/HeaderSet('100')</id> <title type="text">HeaderSet('100')</title> <updated>2019-12-04T07:34:54Z</updated> <category scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" term="ZGW_DEEP_INSERT_SRV.Header"/> <link title="Header" rel="self" href="HeaderSet('100')"/> -<link title="HeadItemT" type="application/atom+xml;type=feed" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/HeadItemT" href="HeaderSet('100')/HeadItemT"> <m:inline/> </link> -<link title="HeadItemO" type="application/atom+xml;type=feed" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/HeadItemO" href="HeaderSet('100')/HeadItemO"> <m:inline/> </link> -<content type="application/xml"> -<m:properties> <d:Id>100</d:Id> <d:Name>Test</d:Name> <d:Name2>Test Header1</d:Name2> </m:properties> </content> </entry>

< Payload>

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L1S33 { color: #009300; }

<?xml version="1.0" encoding="UTF-8"?>
<atom:entry
xmlns:atom="http://www.w3.org/2005/Atom"
xml:base="http://domain:8000/sap/opu/odata/sap/ZGW_DEEP_INSERT_SRV/"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<atom:content type="application/xml">
<m:properties>
<d:Id>100</d:Id>
<d:Name>Test</d:Name>
<d:Name2>Test Header1</d:Name2>
</m:properties>
</atom:content>
<atom:link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/HeadItemO" type="application/atom+xml;type=feed"
title="HeadItemO">
<m:inline>
<atom:feed>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:IdO>100</d:IdO>
<d:NameO>Test Item11</d:NameO>
</m:properties>
</atom:content>
</atom:entry>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:IdO>100</d:IdO>
<d:NameO>Test Item12</d:NameO>
</m:properties>
</atom:content>
</atom:entry>
</atom:feed>
</m:inline>
</atom:link>
<atom:link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/HeadItemT" type="application/atom+xml;type=feed"
title="HeadItemT">
<m:inline>
<atom:feed>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:IdT>100</d:IdT>
<d:NameT>Test Item21</d:NameT>
</m:properties>
</atom:content>
</atom:entry>
</atom:feed>
</m:inline>
</atom:link>
</atom:entry>

4 REPLIES 4
Read only

Former Member
0 Likes
1,208

headitemo and headitemt are all empty using io_data_provider->read_entry_data

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; } .L0S70 { color: #808080; }

io_data_provider->read_entry_data( IMPORTING es_data = lr_deep_entity ).

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; }

class ZCL_ZGW_DEEP_INSERT_MPC_EXT definition
public
inheriting from ZCL_ZGW_DEEP_INSERT_MPC
create public .

public section.

types:
BEGIN OF ts_deep_entity,
id TYPE char10,
name TYPE char25,
name2 TYPE char25,
headitemo TYPE STANDARD TABLE OF ts_itemo WITH DEFAULT KEY,
headitemt TYPE STANDARD TABLE OF ts_itemt WITH DEFAULT KEY,
END OF ts_deep_entity .

METHODS DEFINE
REDEFINITION.

Read only

cdprasanna
Active Participant
0 Likes
1,209

hi,

As Andy Yen mentioned above make sure variable names is same as of ‘Navigation Property‘ name created in Entity ‘Header’, refer blog post deep insert.

Hope it helps you.

Read only

0 Likes
1,208

even after this if not working pls post the code written in create deep method of DPC EXT class.

Read only

Former Member
0 Likes
1,208

Thanks Prasanna !

I solved the issue using your suggestion. I renamed navigation properties' name before I completed the coding. You give me a very useful hint "the root cause should be in navigation property". So, I delete the navigation properties and re-create them carefully. And re-generate the project ... the previous issue has gone ... Thank you.