cancel
Showing results for 
Search instead for 
Did you mean: 

Gateway response with multiple header in Odata service

Former Member
0 Kudos

I am using Odata service with  SAP Netweaver Gatway Serivce builder.

I want to send data item data nested under Header.

I am Getting two different internal table for Header data and Item data by calling RFC method.

Now there is a multiple header and there relevant Item data

I need to send all data as a josn. If there is multiple Header than it should also be send with respective item data

i am using "$expand" for that.but Problem is that $expand is begin called for every Header item and and hence my RFC is also called multiple time as i RFC Calling code written in $expand Method.

I am Getting all data(more than one Header Data and there item data) in first time.

so is there any way i create  Json of item data(more then one ) nested under Header data.

i repeating i am having multiple header also.

so my json will be like this

d{

header[0]{

          headerDetail1

          heqaderDetail2

          itemResult{

                    item[0]

                      {

                                itemDetail1

                                itemDetail2

                      }

                    item[1]

                      {

                                itemDetail1

                                itemDetail2

                      }

                    item[2]

                      {

                                itemDetail1

                                itemDetail2

                      }

                  

                         .

                         .

                         .

          }

header[1]{

          headerDetail1

          heqaderDetail2

          itemResult{

                    item[0]

                      {

                                itemDetail1

                                itemDetail2

                      }

                    item[1]

                      {

                                itemDetail1

                                itemDetail2

                      }

                    item[2]

                      {

                                itemDetail1

                                itemDetail2

                      }

                         .

                         .

                         .

          }

}

.

.

.

}

Accepted Solutions (0)

Answers (1)

Answers (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Zubin,

it seems that you have implemented the method GET_EXPANDED_ENTITY , is that correct ?

This will expand everything beneath one entity (header(x)).

To get all header items including their items you have to implement the method

GET_EXPANDED_ENTITYSET

Best Regards,

Andre

Former Member
0 Kudos

I have implemented  GET_EXPANDED_ENTITYSET. But for each and every Header data GET_EXPANDED_ENTITYSET is called.