on 08-25-2014 12:18 PM
Hello Expert,
I want to create Odata gateway service to READ Account detail with multiple importing parameter along with value range for that parameter for RFC/BOR object. How I will achieve this object please let me know.Its urgent.
Thank's
Hello,
Since u would like to pass range values to those key parameters, there would be single/multiple or null entries as part of GW response based on your input value. Considering that the method which is to be implemented is Get_Entity_Set/QUERY operation.
READ operation can hold one 1 entry as part of GW response when u implement Get_Entity / READ operation.
To perform a READ operation u need to implement Get_Entity method.
READ operation needs KEY's to be passed.
Response can have a single entry as part of response or null.
To perform a QUERY operation u need to implement Get_Entity_Set method.
QUERY operation needs FILTER's to be passed.
Response can have either single/multiple entries or null as part of response.
So decide what exactly u need to implement based on your use case Get_Entity/READ or Get_Entity_Set/QUERY operation.
However the steps are same as below.
1. Implement based on your requirement.
a. Get_Entity_Set / QUERY operation and map the fields accordingly in Service Builder and generate run-time objects.
OR
a. Get_Entity/ READ operation and map the fields accordingly in Service Builder and generate run-time objects.
2. In DPC_EXT class , Redefine below methods and just write ' EXIT ' and activate.
/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN
/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_END
3. As per my knowledge the below are the operators supported by GW through URL.
EQ Equals
LE Less than or equal to
GE Greater than or equal to
NE Not equal to
GT Greater than
LT Less than
Other operators like CP etc... has to be handled explicitly in GW level in DPC_EXT class in respective methods by checking whether the input value contains ' * ' .
If the input contains ' * ' then u need to pass CP operator explicitly in the code level.
4. U need to Create a PAYLOAD to BATCH all the different operations in a single request :
Headers to be passed :
Content-Type : multipart/mixed; boundary=batch
x-csrf-token : < pass the value >
Method :
POST
Sample URL :
http://<Host with the Port Num>/sap/opu/odata/sap/<Your Service Name>/$batch
Sample Payload -> example when u have two operations in 1 single request.
If Get_Entity / READ is implemented then below is the PAYLOAD :
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
GET get_data11(ImWhttype='C2',ImCountry='TH') HTTP/1.1
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
GET get_data11(ImWhttype='C1',ImCountry='TH') HTTP/1.1
--batch--
If Get_Entity_Set / QUERY is implemented then below is the PAYLOAD :
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
GET get_rec_types1?$format=json HTTP/1.1
--batch
Content-Type: application/http
Content-Transfer-Encoding: binary
GET get_order_details HTTP/1.1
--batch--
With this u must be able to implement what u r expecting.
Revert if any issues.
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 Tasnim,
Could you please share wat exactly is the problem u r facing ?
Kindly share some background info like how exactly u would like to pass your inputs to your RFC.
Are u passing inputs as range values to RFC?
It could be great If u can share your RFC input & output structures so that i get idea on wat u would actually want to do & i can can suggest for the same.
Regards,
Ashwin
Hello Tasnim,
You will have to use $filter option to achieve what you are trying to do.
Check the below links:
http://mysapgw.wordpress.com/2012/01/25/filter-string-how-to/
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.
User | Count |
---|---|
83 | |
10 | |
10 | |
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.