on 02-09-2015 4:07 AM
Hi ,
I am not getting the Multiple records for a Gateway ODATA service.
For example:
http://123.XXXX/sap/opu/odata/sap/ZXXX_ORDARRY_SRV/ORDDETSet(Userid='XYZ',Type='11')?$format=json
The requirement : I need to get multiple orders data from based on the User id 'XYZ'.
If I give the URL as '['http://123.XXXX/sap/opu/odata/sap/ZXXX_ORDARRY_SRV/ORDDETSet",
| http://123.XXXX/sap/opu/odata/sap/ZXXX_ORDARRY_SRV/ORDDETSet]
I will get the multiple orders.
Entity set Mapping is referred to a Function module where the User ID is passed to Custom table and we are able to get the Multiple values in the Tables Parameter.
But still the ODATA service returns the Single record.
Thanks,
Shreedhar
Hi Shree,
You understood the GEt_ENTITY operation in a wrong way. When you specify the key parameters, it will give you exactly one entity(record) identified by those key values . For example material number and language will be the keys to identify the description of a particular material in a language. Here in your case, first material you can not use to get multiple line items. You can use one of the below options.
Use an association : from you master (specified by USERID and TYPE) to the details .
Use filter to your entity set : Pass USERID and TYPE as filter parameter(ideally , in this case your entity structure will have more than 2 keys- may be a serial number as the third key )
Sree
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes . let your base entity be the USER entity(as the association rule is , for a user, how many items (1:n)). Let the user entity be associated with the item entity with 1:n cardinality, so that when you execute the navigation , it will give you the list of item for the particular user.
sample URL structure : ..../Users('ABCDUSER')/Items
Sree
Refer this also, you will be able to get multiple table data as pasrt of GW response based on association and navigation.
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.
Hello Shree,
You need to implement QUERY ( Get_EntitySet Method ) to get multilpe records on passing of filters.
Refer the below for info ->
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shreedhar,
I hope you have userid and some other field marked as Key field in Entity Properties in SEGW.
Also do you see any error in Gateway Client.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shreedhar,
When you provide key along with entityset name, it is called as READ. As per OData, read will always return one record.
If you need multiple records, what you need is Filter. You need to use $filter parameter and implement it as well.
I would suggest you to get familiar with OData concepts.
OData URL conventions may be first thing to start with.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.