on 11-04-2014 2:02 PM
Hi guys,
I am developing a Gateway OData service, and have one question I would like to clarify with you.
I have a requirement to send to the mobile device 10 different text tables (i.e. TVK1T, TVK2T, TVK3T, etc) using an OData web service.
I see two possible approaches for doing these:
1) Create 10 different entities, one for each table, where each of one will have two properties:
-Code
-Text
This way, I have to define a query operation for each entity and an RFC for each text table in the SAP Backend.
Then, the data can be retrieved from the mobile app using one $bacth request with 10 operations inside.
2) Create one entity that will have the fields:
- Table ID
- Code
- Text
This way, I can retrieve the data for the 10 tables using just one RFC I develop in the SAP Backend.
The mobile app just have to send one request containing one operation.
* In my opiinon, the second one is the best approach because the effort is much less than the first one, and it will be much more performant.
* In your opinion, What is the best approach to follow?
Best Regards,
Emanuel
Hello Emanuel,
Is it a Read operations or any Modifying operation ( Create / Update /Delete )?
Kindly share how u would like to consume data in your application. Based on that we can suggest to model ur service in a best way.
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your answers.
The operation that need to be done is just Query operations.
I am going to use the data I retrieve to populate some matchcodes.
The requirement is similar to this post:
http://scn.sap.com/thread/3488251
In a few words, I need to populate 10 match codes, and I want to know if it's better to retrieve the data from the mobile app using one $bacth request with 10 operations inside (each operation will differ in an import parameter that will select which matchcode data to return), or to retrieve the data for the 10 matchcodes in just one operation (the data for the 10 different matchcodes will be returned in the same operation, and it will be identified by the "Table ID" field).
What do you think?
Hello Emanuel,
U r displaying all the data coming from different tables at once on the UI is it ?
That means u will have 10 different table of data as part of GW response based on Table ID is it ?
Will it be only 10 match codes ?
BATCH would be the neat and best approach.
Ur response would be neat and organised. Its easy to access response in UI level.
One more thing is ur service will be flexible so that u can get data of a single table or multiple table based on Table ID.
But since its a Mobile App, u need to think about performance here.
If data retrieved is huge then it may hamper the performance.
But if u see latest SP 09 there is some performance improvements done in BATCH.
Please refer below
$batch Processing - SAP NetWeaver Gateway - SAP Library
Refer below thread as well ->
If u r on latest SP 09 u can use BATCH only and can process all the operations at once
Regarding ur second approach i.e., to retrieve the data for the 10 matchcodes in just one operation (the data for the 10 different matchcodes will be returned in the same operation, and it will be identified by the "Table ID" field),
U can do this somehow but according to me if u look at the GW model point if view , ur GW model will be very rigid here.
U need to have 10 entities and tomorrow if u want to get 11 match codes from 11 different tables then u need to change the model of ur GW again and also the back end code.
If u use BATCH u will not have to do this.
If u think its always 10 entities only and will never change, then u can do a trade off with respect to ur GW model and accomplish through $expand ( Expand Entity/Expand Entity Set), where u can get all those tables of data based on table id in one call.
Regards,
Ashwin
One Approach:
I would create one entity, but 10 entity sets. Each entityset pointing to the same entity.
In the implementation logic, based on the entity set, I would fetch from different tables.
Other approach:
Also check if the search helps are already existing. If yes, you can use this.
Importing Search Help as a Data Source - SAP NetWeaver Gateway - SAP Library
regards
Krishna
Thank you for your answer.
I like what you said of having one entity, and 10 entity sets.
One question:
When I define the QUERY operation:
The 10 entity sets will be populate at the same time. Is this right?
I mean, there is no possibility to populate just one entity set from the 10, because there is just one operation for the 10 of them.
Thanks in adavance.
Emmanuel,
Best approach would depend on the UI. May be you can explain us how does the UI look like which shows this data. Your solution might be completely different.
Your OData model need not reflect the database model, rather it should reflect the UI and the UI navigations.
regards
Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.