on 06-03-2013 3:14 PM
Hello Experts ,
I would like to generate an Odata Service based on Remote Enabled Function Module . But the Issue here is where we need to Provide/Mark the fields as Input and Output Parameters . And Do we have to write Anycode in the Get_entity_set method .Even I tried with the Mapping to Data source for the fields as Input and Output Parameters.But coming to service , I'm not able to get the output.
Can Anyone help me in getting this solved .Also please share any documents related to Odata .
Appreciate your help.
Thanks,
Uday.
Hi Uday,
please check out the following three blogs of my colleague Volker Drees.
Step-by-step guide to build an OData Service based on RFCs – Part 1
Step-by-step guide to build an OData Service based on RFCs – Part 2
Step-by-step guide to build an OData Service based on RFCs – Part 3 |
Best Regards.
Andre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Avishek,
this expression is not correct.
The expression
BusinessPartnerCollection?$filter=CompanyName ge 'S' and CompanyName le 'T'& $filter=CompanyName ge 'M' and CompanyName le 'L'&$select=CompanyName
would only retrieve BusinessPartners whose name start with an S or T, that means only that filterstring is used that is passed with the first occurence of $fitler. The second filter string is omitted.
But it will retrieve only the property "CompanyName".
The correct expression for the $fitler would be
$filter=((CompanyName ge 'S' and CompanyName le 'T' ) or (CompanyName ge 'M' and CompanyName le 'L'))&$select=CompanyName
Best Regards,
Andre
Hi
We have a similar scenario with little difference. We have a RFC developed on top of a BW query which takes 3 input parameters and returns a structure. We have created the service and the entities and entity sets without any errors. But when we execute the service we do not see any data.
Followed the step to step guide mentioned in one of the above replies.
We tried to send the parameters as suggested above and we do not see any data still.
Not sure what is missing. Appreciate any help
Thanks in advance
Lakshmi
Hi Lakshmi,
if your query is marked as an Easy Query there is also the option to generate an OData service using redefinition option.
For this you have to right click on your data model in SEGW and choose:
Redefine --> BW Query Service.
Here you have the option to use either Easy Queries or MDX queries.
Best Regards,
Andre
Hi Narayana,
We have a RFC developed on top of a BW query which takes 3 input parameters and returns a structure. We have created the service and the entities and entity sets without any errors.
In return parameter are you getting a actual data which needs to show response in odata or r just returning the output structure.
Please provide the screen shot of your RFC to understand how exactly your RFC works.
Regards,
Venu
Hello All,
How to frame the URI to get multiple records from the same entity set ?
example : I would like to retrieve NotificationNumber 'A' and NotificationNumber 'Y'
from 'NotificationHeaderSet'. I do not want to use 'ge' and 'le'. But would like to filter random 2 records.
Regards,
Rekha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rekha,
The expression would be : /sap/opu/.../NotificationHeaderSet?$filter=NotificationNumber eq 'A' and NotificationNumber eq 'B'
You need to be aware that in gateway framework you will get these values as range, now the business logic(can be direct select query or RFC) to get the notification header should be capable enough to take this range and give you only those value. For details, you can check this doc
Regards,
Ekansh
Hi Ekansh,
the expresssion is not correct. You have to use 'OR' instead of 'AND'.
When using 'AND' the resultset will be empty.
While using the statement
/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/ProductSet?$filter=(SupplierID eq '0100000015' or SupplierID eq '0100000010' )
you will get 6 products the statement
/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/ProductSet?$filter=(SupplierID eq '0100000015' and SupplierID eq '0100000010' )
does not contain any product.
Best Regards,
Andre
Hi Andre
It reminds me the AND-OR situation we met. We've done a simple request to KNA1 table via NW service.
The request
/sap/opu/odata/......SRV/ClientSet?$filter=Kunnr eq '0000000006' AND Name1 eq 'Test'
worked OK and gave 1 record.
But the request
/sap/opu/odata/......SRV/ClientSet?$filter=Kunnr eq '0000000006' OR Name1 eq 'Test'
gave an error, because io_tech_request_context->get_filter( )->get_filter_select_options( ) (for shorter) doesn't transform the request to select_option table.
Hi Andrei,
you can try to retrieve an osql statement:
DATA: lv_osql_where_clause TYPE string.
lv_osql_where_clause = io_tech_request_context->get_osql_where_clause_convert( ).
When using the following statement
/sap/opu/odata/SAP/ZNAVPROP_SRV/CarrierSet?$filter=Carrid eq 'AA' or Carrname eq 'Air Berlin'
in the Gateway Client I get the following value for lv_osql_where_clause
( ( CARRID = 'AA' ) OR ( CARRNAME = 'Air Berlin' ) )
Best Regards,
Andre
Thanks for reply, Andre
We've made it easily via io_tech_request_context->get_filter( )->get_filter_string( ) and then dynamic SQL. The only problem is that development takes more time in this case - some additional checks should be done. It leaves a feeling that SAP does not completely cover oData standard. For any code automatically generated by SAP for Search Helps or Fms it is definitely a problem.
User | Count |
---|---|
76 | |
9 | |
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.