cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing CREATE_DEEP_ENTITY

Former Member
0 Kudos

Hi All,

I was trying to implement create deep entity. And what I did was first did a get for the GET_EXPANDED_ENTITYSET and then used the same as a request. I exactly have one data in the header table and 2 data in the item table 1 and 1 data in the item table 2. So I just used the same to create one more. I am getting a 400 Bad request error. I hope atleast the breakpoint should stop then I can figure out the issue.

My questions?

1. Do we need to pass anything in the header name and value?

2. For doing an update in the deep entity which method should be used ?

Below is the XML that i got as a response from the GET_EXPANDED_ENTITYSET.

*********************

feed 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" xml:base="http://ddadb038.ctr.globedev.ddc:8002/sap/opu/odata/GLB/9GT_GW_PR_MSP_PBCRA_SRV/">

<title type="text">ET_ForecastFormSet</title>

<updated>2014-12-11T11:14:55Z</updated>

- <author>

<name />

</author>

<link href="ET_ForecastFormSet" rel="self" title="ET_ForecastFormSet" />

- <entry>

<title type="text">ET_ForecastFormSet('FOR0000008')</title>

<updated>2014-12-11T11:14:55Z</updated>

<category term="XXXXXXXXX.ET_ForecastForm" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />

<link href="ET_ForecastFormSet('FOR0000008')" rel="edit" title="ET_ForecastForm" />

- <link href="ET_ForecastFormSet('FOR0000008')/FormTotSet" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FormTotSet" type="application/atom+xml;type=feed" title="FormTotSet">

- <m:inline>

- <feed 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" xml:base="http://ddadb038.ctr.globedev.ddc:8002/sap/opu/odata/GLB/9GT_GW_PR_MSP_PBCRA_SRV/">

<id>http://ddadb038.ctr.globedev.ddc:8002/sap/opu/odata/GLB/XXXXXXXXX/ET_ForecastFormSet('FOR0000008')/FormTotSet</id>

<title type="text">ET_ForecastFormTotSet</title>

<updated>2014-12-11T11:14:55Z</updated>

- <author>

<name />

</author>

<link href="ET_ForecastFormSet('FOR0000008')/FormTotSet" rel="self" title="ET_ForecastFormTotSet" />

- <entry>

<title type="text">ET_ForecastFormTotSet(Slkey='SERV001',Forecastnumber='FOR0000008')</title>

<updated>2014-12-11T11:14:55Z</updated>

<category term="XXXXXXXXX.ET_ForecastFormTot" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />

<link href="ET_ForecastFormTotSet(Slkey='SERV001',Forecastnumber='FOR0000008')" rel="edit" title="ET_ForecastFormTot" />

- <content type="application/xml">

- <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">

<d:Projcosttot>2343.00</d:Projcosttot>

<d:Submitdaystot>0012</d:Submitdaystot>

<d:Editdaystot>0009</d:Editdaystot>

<d:Npdidaystot>0006</d:Npdidaystot>

<d:Sldesc>SAP App. Development</d:Sldesc>

<d:Slkey>SERV001</d:Slkey>

<d:Forecastnumber>FOR0000008</d:Forecastnumber>

</m:properties>

</content>

</entry>

</feed>

</m:inline>

</link>

- <link href="ET_ForecastFormSet('FOR0000008')/FormDetSet" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/FormDetSet" type="application/atom+xml;type=feed" title="FormDetSet">

- <m:inline>

- <feed 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" xml:base="http://ddadb038.ctr.globedev.ddc:8002/sap/opu/odata/GLB/XXXXXXXXX/">

<id>http://ddadb038.ctr.globedev.ddc:8002/sap/opu/odata/GLB/XXXXXXXXX/ET_ForecastFormSet('FOR0000008')/FormDetSet</id>

<title type="text">ET_ForecastFormDetSet</title>

<updated>2014-12-11T11:14:55Z</updated>

- <author>

<name />

</author>

<link href="ET_ForecastFormSet('FOR0000008')/FormDetSet" rel="self" title="ET_ForecastFormDetSet" />

- <entry>

<id>http://ddadb038.ctr.globedev.ddc:8002/sap/opu/odata/GLB/XXXXXXXXX/ET_ForecastFormDetSet(Tecgpkey='TEGRP001',Slkey='SERV001',Forecastnumber='FOR0000008')</id>

<title type="text">ET_ForecastFormDetSet(Tecgpkey='TEGRP001',Slkey='SERV001',Forecastnumber='FOR0000008')</title>

<updated>2014-12-11T11:14:55Z</updated>

<category term="XXXXXXXXX.ET_ForecastFormDet" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />

<link href="ET_ForecastFormDetSet(Tecgpkey='TEGRP001',Slkey='SERV001',Forecastnumber='FOR0000008')" rel="edit" title="ET_ForecastFormDet" />

- <content type="application/xml">

- <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">

<d:Submitdays>0004</d:Submitdays>

<d:Editdays>0003</d:Editdays>

<d:Npdidays>0002</d:Npdidays>

<d:Techgrpdesc>ABAP OO</d:Techgrpdesc>

<d:Tecgpkey>TEGRP001</d:Tecgpkey>

<d:Sldesc>SAP App. Development</d:Sldesc>

<d:Slkey>SERV001</d:Slkey>

<d:Forecastnumber>FOR0000008</d:Forecastnumber>

</m:properties>

</content>

</entry>

- <entry>

<id>http://ddadb038.ctr.globedev.ddc:8002/sap/opu/odata/GLB/XXXXXXXXX/ET_ForecastFormDetSet(Tecgpkey='TEGRP002',Slkey='SERV001',Forecastnumber='FOR0000008')</id>

<title type="text">ET_ForecastFormDetSet(Tecgpkey='TEGRP002',Slkey='SERV001',Forecastnumber='FOR0000008')</title>

<updated>2014-12-11T11:14:55Z</updated>

<category term="XXXXXXXXX.ET_ForecastFormDet" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />

<link href="ET_ForecastFormDetSet(Tecgpkey='TEGRP002',Slkey='SERV001',Forecastnumber='FOR0000008')" rel="edit" title="ET_ForecastFormDet" />

- <content type="application/xml">

- <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">

<d:Submitdays>0004</d:Submitdays>

<d:Editdays>0003</d:Editdays>

<d:Npdidays>0002</d:Npdidays>

<d:Techgrpdesc>ABAP Procedural</d:Techgrpdesc>

<d:Tecgpkey>TEGRP002</d:Tecgpkey>

<d:Sldesc>SAP App. Development</d:Sldesc>

<d:Slkey>SERV001</d:Slkey>

<d:Forecastnumber>FOR0000008</d:Forecastnumber>

</m:properties>

</content>

</entry>

</feed>

</m:inline>

</link>

- <content type="application/xml">

- <m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">

<d:Chngstatusto />

<d:Chngstatusdesc />

<d:Forecastnumber>FOR0000008</d:Forecastnumber>

<d:Currstatus>WFSTS001</d:Currstatus>

<d:Currstatusdesc>Draft</d:Currstatusdesc>

<d:Creator>KOUSHIK MAZUMDER</d:Creator>

<d:ServReceTower>SRTOW13</d:ServReceTower>

<d:ServReceTowerDesc>IS/IT Security</d:ServReceTowerDesc>

<d:ServReceSubTower>SRSTW14</d:ServReceSubTower>

<d:ServReceSubTowerDesc>Technology & Systems Security</d:ServReceSubTowerDesc>

<d:ServReceTeam>SRTEAM22</d:ServReceTeam>

<d:ServReceTeamDesc>Technology & Systems Security</d:ServReceTeamDesc>

<d:Region>RGN006</d:Region>

<d:Regiontxt>Center</d:Regiontxt>

<d:Costcenter>104395032</d:Costcenter>

<d:Approver>Koushik Mazumder</d:Approver>

<d:Forecastmnth>11</d:Forecastmnth>

<d:Forecastyr>2014</d:Forecastyr>

<d:Comments>Test for Query</d:Comments>

<d:Reasoncode />

<d:Reasontxt />

<d:Supplier />

<d:Supplierdesc />

<d:Urlev>www.google.co.in</d:Urlev>

<d:Frcst />

</m:properties>

</content>

</entry>

</feed>

**********************************************************


Tags edited by: Jitendra Kansal

Tags edited by: Jitendra Kansal

Accepted Solutions (1)

Accepted Solutions (1)

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Koushik,

1. Do we need to pass anything in the header name and value?

I guess below parameters:       

X-CSRF-TOKEN :  <value returned from GET method>

Content-Type : application/atom+xml;type=entry;charset=utf-8

2. For doing an update in the deep entity which method should be used ?


You have to used POST method.


Have a look at document

Answers (1)

Answers (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Koushik,

1. Please follow the blog specified by Jitendra. You will be able to accomplish Create Deep Operations.

2. You cannot perform Update on Deep Entities.There is no such method available to perform the same like Update_Deep_Entity.

You need to perform normal Update itself ( Update_Entity ) on the item level based on use of appropriate Key

Regards,

Ashwin

Former Member
0 Kudos

Hi Ashwin,

I have successfully implemented the create. But problem I am facing is when I implement Create Deep Entity then the expand is not working.

I assume this is because for the redefinition of the "Define" method in the create deep entity. Any suggestion how to overcome this.

Regards,

Koushik

AshwinDutt
Active Contributor
0 Kudos

Hello Koushik,

Are you getting any error ? Please share.

Regards,

Ashwin

Former Member
0 Kudos

Hi Ashwin,

I was getting an error in the class CL_ABAP_STRUCTDESCR method CHECK_COMPONENT_TABLE

raise exception type CX_SY_STRUCT_COMP_NAME

And when I removed the define method redefination this works fine.

Regards,

Koushik

AshwinDutt
Active Contributor
0 Kudos

So your Deep Entity Creation & Expand Entity Set both is working fine now ?

Former Member
0 Kudos

No either of them works. Both doesn't works at the sametime.

AshwinDutt
Active Contributor
0 Kudos

Both will work at a time if you are using the same entities and association ( cardinality ) between them. So that you can use the response of your $expand operation as the input ( payload ) for the Deep Create Operations.

Pleas check in your case if everything is same.