cancel
Showing results for 
Search instead for 
Did you mean: 

Create deep insert not working

vivek_gaurav
Participant
0 Kudos

Hi All,

        I had created Create deep insert for Header detail scenario.

        Things are working fine for GetEntitySet.

         I am able to get Header detail data in Client but when I do post for Header details ,

        Only Header part is going but no Details data is going.

       HTTP Response is 201 is coming but getting only Header Fields no details

       IO_DATA_PROVIDER Method is not getting Detail Data.

     I checked multiple times Model are fine....

     But getting any reason for such behaviors..

     Not getting any error ,also

     Kindly advice

Regards

Vivek

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Vivek,

Name used for Item details while creating Deep Structure inside Create_Deep_Entity method should be same as the Navigation property defined in GW model.

Referring below will help ->

Regards,

Ashwin

vivek_gaurav
Participant
0 Kudos

I am following this Link

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0d92637-3d0d-2f10-ebb2-efc1f40a8...

which is given for Create Sales order..It works fine for Create Sales Order

Is this doc have any issue...

AshwinDutt
Active Contributor
0 Kudos

Say In your GW Model if navigation property is 'SOItems' ( Highlighted One in Bold )

"Add Navigation Property from role SOHeader to role SOItems

lo_entity_type->create_navigation_property(

iv_property_name = 'SOItems'

iv_association_name = 'SOHeader_SOItems' ).

Your Deep Structure defined for Items in Create_Deep_Entity should also have 'SOItems' ( Highlighted One in Bold )

i.e., Navigation name should be same as the structure name used for item details in the deep structure.

* Represents full Sales Order structure - header with one of more items

types: begin of ty_s_so.

include type z_salesorder_model_xx=>s_so_hdr.

types: SOItems type ty_t_soitem,

end of ty_s_so.

Keep the above as reference to cross check your ls_so structure and correct accordingly.

This will resolve your issue.

Regards,

Ashwin

vivek_gaurav
Participant
0 Kudos

Thanks Ashwin...

Your solution is perfect it was very difficult to find this issue...

Thanks again

Answers (1)

Answers (1)

kammaje_cis
Active Contributor
0 Kudos

Vivek,

This is a common problem faced by beginners. You could have searched SCN for quicker answer.

Most probable reason is the way you have declared the parent/child structure in the DPC_EXT class' Deep Insert method. The child elements in this structure should have the same name as the Navigation property of your OData model.

vivek_gaurav
Participant
0 Kudos

Thanks for your quick reply...

I had cross verified Model with POST XML all Tag are correctly placed .

I am doing Get using oData : /sap/opu/odata/sap/ABCDS/XXXHeaders?$expand=Details

And then by using Use As request ,I am getting XML Data in HTTP Request and then posting XML by

OData : /sap/opu/odata/sap/ABCDS/XXXHeaders.


This line of code is not returning Details Data part,It has same structure as in XML for detail part.

io_data_provider->read_entry_data( IMPORTING es_data = ls_so )




kammaje_cis
Active Contributor
0 Kudos

Check the declaration of LS_SO. Compare the child item names in that strucutre with that of navigation names.