on 04-22-2016 2:02 PM
Hi everyone,
I created BAPI to fetch sales details of a given customer.
Import parameter
CUST_NO
Export Parameter
RETURN
Tables: SALES_TAB (Table having 4 columns given below)
* SO_NO
* SO_DATE
* NET_VALUE
* CURRENCY
BAPI working fine.
Now I want to create a OData service by importing the above BAPI function.
I have little confusion while selecting the fields to create a model.
I want to take RETURN structure also.
Another question is do I need to go with GetEntity (Read) or GetEntitySet (Query) for my above BAPI.
Please help.
Ravinder.
Hi Ravinder,
Please look at the following post that will clarify our idea on developing odata services:
Regarding your question about GetEntity and GetEntitySet your answer below:
'GetEntitySet (Query)' is to get a array of values i.e. if you need to get multiple records from a database table/tables
'GetEntity (Read)' is used to get one single record i.e. all the details of a particular employee/customer.
Regards,
Emanuel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Emanuel,
I saw the above examples. In that example, he is fetching all sales orders list without giving input.
In my case, Customer number is the input. Sales orders list is the output.
My main aim is to provide CUST_NO as an input in the OData URI.
Can you give me one example URI with customer number as an input.
Thank you.
Hi Ravinder,
If you want to add the possibility to filter to the odata web service, you have to add some code in the odata web service.
There is an excellent detailed blog on how to do this:
How to Develop Query Options for an OData Service Using Code-Based Implementation
Regards,
Emanuel
You need to implement filter. Your odata call would look somwhat like -
http://<server>:<port>/.../SalesOrderSet?$filter=(CustomerNo eq '1000232')
To do this you would need to implement operation GetEntitySet. If you need to query by Sales Order Number, then it you would need to implement GetEnitity operation.
http://<server>:<port>/../SalesOrder('9000231')
User | Count |
---|---|
84 | |
25 | |
12 | |
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.