cancel
Showing results for 
Search instead for 
Did you mean: 

URI to call method CREATE_DEEP_ENTITY

nandishm
Participant
0 Kudos

Hi Expertise

   I am new Odata services, I need help in calling

 

  CREATE_DEEP_ENTITY method of DPC_EXT class 

   Consider  my parent entity set name as  :- EMP_DET    & my child entity set EMP_SALARY   & navigation name EMP_SALARY_NAVIG

  So help for building URI to call method

  Thanks ...

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

URI for "deep create" will be same as that of regular "Create"

.....ServiceName/EntitySetName

If you are worried about how to populate the request body, check here.

nandishm
Participant
0 Kudos

I am getting this error ... Its not calling method, I have putted debugger at starting of method ..

AshwinDutt
Active Contributor
0 Kudos

Hello Nandish,

Just to remind you that you need to fire your GET operation by passing the navigation property defined between your Header and Item entities.

The response of this should be used as the payload.

When you do this way you will not get these kind of errors.

So please check.

Property names are Case Sensitive.

You need to make sure that you pass same Property Names which are mentioned in your Gateway Model.
Please check the property names and pass them in payload accordingly.

Its easy to build your payload manually as well XML or JSON ->

See below how you can build manually :

You can also build JSON payload for the above XML format as well.

Sample JSON :

Were Header entity has Id , Name and Name2 as properties

and Item entity has Id , Name as properties.

HeaderToItem is the navigation property.

While firing pass the below Header ->

Content-Type - application/json

{

"Id":"01",

"Name":"John",

"Name2":"Bell",

"HeaderToItem":[

{"Id":"10","Name":"TestO1"},

{"Id":"20","Name":"TestO2"}

]

}

Regards,

Ashwin

Former Member
0 Kudos

Hello Nandish,

Keep a external break point in the code, where you are calling your BAPI. I hope you must be creating it already. The above error is because, no return GET enetity is called. To avoid this, in the create_deep_entity method, at the end, add the below code to get the return values.

copy_data_to_ref(
EXPORTING
is_data
= custome_create_deep_entity
CHANGING
cr_data
= er_deep_entity
).

I hope it will solve your 500 Error.

Thanks,

SK

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The highlighted error might be coming because of malformed request payload. Each field that is being used in payload should be exactly same as defined in entity type. The field names are case sensitive also.

Its also important to put navigation name in relation section of payload.

Regards,

Aashika