Skip to Content
0
Former Member
Mar 17, 2015 at 06:41 AM

Gateway response with multiple header in Odata service

212 Views

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

}

.

.

.

}

}

.

.

.

}