Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Gateway entityset with nested tables

Hi,

My requirement is to create a Gateway service to retreive material data + grid values (size and color) + stock for each grid value.

Level 1: Material general data

     Level 2: Grid values (nested table)

          For each line of level 2: Level 3: ATP stock (nested table)

In XML this is what I am trying to do:

<MATERIAL1>

     <MAKTX>

     <GRIDVALUES>

          <GRIDVALUE1>

               <GRID_VALUE_ATTRIBUTE1>

               <GRID_VALUE_ATTRIBUTE2>

               <STOCK_DATA>

                    <STOCK_ATTRIBUTE1>

                    <STOCK_ATTRIBUTE2>

                    <STOCK_ATTRIBUTE3>

  </STOCK_DATA>

  </GRIDVALUE1>

  </GRIDVALUES>

</MATERIAL1>

<MATERIAL2>

     <MAKTX>

     <GRIDVALUES>

          <GRIDVALUE1>

               <GRID_VALUE_ATTRIBUTE1>

               <GRID_VALUE_ATTRIBUTE2>

               <STOCK_DATA>

                    <STOCK_ATTRIBUTE1>

                    <STOCK_ATTRIBUTE2>

                    <STOCK_ATTRIBUTE3>

  </STOCK_DATA>

  </GRIDVALUE1>

  </GRIDVALUES>

</MATERIAL2>

I would like to get all these information in a single get_entityset request (taking filters in input request).

Whats is the best way to create such a service ? Do I need to use the complex entities ? Are there any samples around because I was not able to find anything on SCN.

Any advises on similar cases would be much appreciated.

Thanks in advance.

Thibault

Former Member
Former Member replied

Hello Thibault,

Implement Expand_EntitySet where u can send your inputs as filters and get all those those table as output.

Create Entity for each of those output tables. Also Create Entity holding your Inputs as well.

Once u do this create association & navigation between entities with appropriate cardinality.

Implement Expand_EntitySet method and get all ur inputs as filters inside it and use it in ur logic.

Also send back the navigation properties to the expand clause table.

With using $expand in the url u can get the output tables.

Please refer the below which will help u : With this u can try accomplishing your scenario.

Implementing Expand Entity/Entity Set

Regards,

Ashwin

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question