cancel
Showing results for 
Search instead for 
Did you mean: 

Gateway entityset with nested tables

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

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.

Regards,

Ashwin

Answers (1)

Answers (1)

kammaje_cis
Active Contributor
0 Kudos

Hi Thibault,

For each table you can model an entity here and relate them with Association and Navigations. To get all of them together you can use $expand.

Search $expand here in SCN forum and you should have many resources.

Thanks

Krishna