on 08-20-2014 1:56 PM
Hi Experts,
Requirement is to fetch the data from three different tables and display in one single table on front end.
In single OData service i have 3 GET_ENTITYSET method for three different entity types. I want to fetch data from 3 different database tables based on key fields.
If I write select query in 3rd GET_ENTITYSET method then how i can access the 3 table's data in one method.
Thanks,
Prashant
Hello Prashant,
Below are the approaches as per my knowledge :
Approach 1 :
Say Table1 has fields A, B, C
Say Table2 has fields D, E, F
Say Table3 has fields X, Y, Z
Say u need only A, D, X fields in our GW response on passing of input from the above different tables.
In the data model create single entity which will have fields only A, D, X.
Implement Get_Entity_Set method and write your logic to get above fields from all those different 3 tables and populate in a single table and return as GW response.
This way u get all the required fields from different tables as a single entity in GW level.
Approach 2 :
If at all u r calling an RFC to this case, u can also change your RFC logic to get all required fields from those 3 tables and populate n a single output table in RFC level.
Then u can straight away implement Get_Entity_Set in SEGW and map the response and generate run time objects.
You can decide what approach to be used and implement
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Prashant,
Do not import, U need to manually add the required fields / properties in the data model with appropriate edm types.
Then follow the steps which i have share in the previous reply of mine.
With that u should be able to implement what u exactly need. i.e., retrieve only those required fields from 3 different tables based on some input in one single output table as part of GW response.
Regards,
Ashwin
Hi All,
Thanks for help. The problem is solved successfully.
Regards,
Prashant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Prashant,
If you wanted all three entities together, why did you create three entities?
You need to correct your Entity Data Model first.
Create only one entity instead of three entities, having all the required properties.
In the Get Entityset method, fetch all the properties using a join. No need to create any RFC.
regards
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishna,
I have 3 database tables and show the data using sap.m.Table on screen.
For this, i have created OData service and inside it i have 3 entity types and and 3 entity sets. I want to fetch the data from 3 tables based on key fields and display the output. I know how to write select query but the problem is how to get all this fields in single GET_ENTITYSET method so that i can access single entity set and get it done.
If there any other solution/idea please let me know.
Thanks,
Prashant
Hi All, For this solution can i use GET_EXPAND_ENTITYSET. But don't know how to implement this method. I have also read about $expand and this is by default provided by SAP net weaver gateway. But still i am confused with this. Could any one help to clear this concept and how to implement it. Thanks, Prahsant
Hi,
Also read SAP help https://help.sap.com/saphelp_gateway20sp08/helpdata/en/ca/c683e803494b77a2e1290b987556e2/content.htm on Framework Expand (earlier known as Generic Expand) and Data Provider Expand (earlier known as Basic Expand).
Regards,
Chandra
Hello,
Create RFC wrapper by joining tables and store result in an out put table.
Use this table to map as a response table in segw.
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Discussion moved to SAP Gateway community. Not UI related.
Regards, Mike (Moderator)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prashant,
a technical possibility to "save roundtrips" is to make use of batch requests. Here you can "bundle" requests for different entities of the same model. Just check the API Reference for the oData Model in OpenUI5 SDK - Demo Kit.
Regards, Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prasanth,
Thanks,
Arun
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.