Quantcast
Channel: SCN : Popular Discussions - SAP NetWeaver Gateway Developer Center
Viewing all articles
Browse latest Browse all 1657

Using different entities in the same service call

$
0
0

Hi,

 

I have scenario where I have to fetch data from the DB based on some filter criteria.

The data I have to fetch is taken from a PLAN table and the fields that I have to fetch are PLAN_ID, PLAN_DESCRIPTION, PLAN_START_DATE,PLAN_END_DATE etc.The filter criteria I pass contains fields like MANDT,USER_ID,LANG_ID,SEARCH.

 

Now I have created a project where I have 2 entities.

FILTER and PLAN with their respective fields.

 

Since my filter is large and I will not know the length of the filter at runtime im choosing to POST it as payload instead of passing it as $filter in my GET url.

 

So when I use the POST method and pass the filter the create entity method gets invoked.So I have written my code inside this method where I fetch the plan details using the filter.

Now is there a way I can return my plan details in the same method? 

 

I tried making my ER_ENTITY point to the plan structure instead of the Filter structure.

 

At runtime in the debug mode it does hold the plan details but when I test in the gateway client I can see only an empty filter as the response.

 

Can anyone let me know if we can pass one entity structure as request and return another as response?


Viewing all articles
Browse latest Browse all 1657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>