Skip to Content
avatar image
Former Member

SAP OData Creation with deep structure

Hello All,

I wanted to create Odata as below sequence. Please help me how to do this.

"companyCodes":[

{

"CompanyCode":"ABCD",

"Country":"USA",

"Decription":"XXXX -CMPP-US",

"Function":[

                {"FunName":"Function_1","Count":16},

                {"FunName":"Function_2","Count":13},

                {"FunName":"Function_3","Count":0},

                {"FunName":"Function_4","Count":4},

                {"FunName":"Function_5","Count":8},

               {"FunName":"Function_6","Count":0},

                {"FunName":"Function_7","Count":0}

                  ]

   },

I guess I can achieve it by using deep structure but RFC is not allowing to use deep structure .

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 09, 2014 at 12:27 PM

    Hi Rahul,

    You have to redefine the Create_deep_entity method in *_dpc_ext class.

    Read the payload using io_data_provider->read_entry_data( IMPORTING es_data = **).


    Step by Step development for CREATE_DEEP_ENTITY operation


    U can check the above link how to implement Create Deep entity method.



    Regards,

    Venu

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 09, 2014 at 02:04 PM

    Rahul, I would suggest using a code based approach. 

    First model your entity is SEGW (manually creating entities, associations, navigation), then implement the deep_entity method. (As Venu suggested).

    Add comment
    10|10000 characters needed characters exceeded