on 11-23-2012 7:52 AM
Hi Experts,
I Have developed GW Service using Odata Channel in that i have developed A Function Module for the there two import parameters i.e WKSTRT_DATE (Data Ele: DATS) and WKEND_DATE (Data Ele: DATS). for this i am passing input from web Browser Rest Client as (http://server_name:8000/sap/opu/odata/sap/service_name?$filter=WKSTRT_DATE eq '12112012'&$filter=WKEND_DATE eq '12112012'). for this i am getting an error which mentioned below
<error>
<message xml:lang="en">Invalid parametertype used at function 'eq'</message>
</error>
and i tried with all the date formats like(DDMMYYYY, MMDDYYYY, DD/MM/YYYY, MM/DD/YYYY, YYYY/MM/DD, YYYY/DD/MM, DD.MM.YYYY, MM.DD.YYYY)
Can any one please tell me how i should resolve.
Hi Suman,
Follow Odata Doc ( Plz ref topic Primitive data types)
http://www.odata.org/documentation/overview
Date has to be passed has datetime'2012-11-23T00:00'
Regards,
Jibin Joy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jibin,
Thanks for your reply.
But in my project i am getting date fields as MMDDYYYY .
Actually what happened in my project is one screen is there it has date range search criteria i.e WKSTRT_DATE and WKEND _DATE, this dates is input fields to SAP Service. Hence i defined WKSTRT_DATE & WKEND_DATE fields as DATS Data type fields in my service Model Provider Class and Function Module.
So, Can you please tell me how to resolve this error.
Hi Suman,
This Format is defined by Odata Protocol so we have to pass date as datetime'yyyy-mm-ddThh:mm[:ss[.fffffff]]' NOTE: Spaces are not allowed between datetime and quoted portion. datetime is case-insensitive.
Most probably its SAP Netweaver Gateway Job for date format conversion based on the Domain .
If u r still getting error ... can u post me error response
Regards,
Jibin Joy
Hi,
http://server_name:8000/sap/opu/odata/sap/service_name?$filter=IWKSTRT_DATE eq datetime'2012-10-18T00:00:00' and WKEND_DATE eq datetime'2012-10-20T00:00:00'
If still getting error can u post if ur metadata
Need one more query
R u doing RFC mapping or custom Coding .
Regards,
Jibin Joy
Hi Jibin,
Still i am getting error
i.e
<error>
<code>005056A509B11ED199D88292AB9400FE</code>
<message xml:lang="en">
In the context of Data Services an unknown internal server error occured
</message>
</error>
and Metadata is
<edmx:Edmx Version="1.0">
<edmx:DataServices m:DataServiceVersion="2.0">
<Schema Namespace="SERVICE_NAME" xml:lang="en">
|
</edmx:DataServices>
And I am using RFC mapping
Hi Suman,
In SEGW , Entity Property with the Type Edm.DateTime nullable Flag has to be set .
In Above Metadata , WKSTRT_DATE nullable flag is false make it true .
Goto Tcode /iwfnd/error_log ....
Can u find the error Information
If u r still getting error .
Can u post me screen shot for list of error in getting /iwfnd/error_log
Regards,
Jibin Joy
Hi Suman,
Based on my observation SAP NetWeaver Gateway will convert it (Rest client is just and it will not convert ). Rest client will send request to SAP NetWeaver Gateway . Gateway convert this protocol information to SAP technical information ,After all things are done it will call Mapped RFC .
Try to write datetime'2012-11-12T00:00:00' instead datetime'2012-11-12T23:59:59' because field are defined as dats so it will not consider timestamp (there are some chance of throwing error ).
Data lv_date type dats. (yyyy/mm/dd)
Data lv_timestamp type timestamp.
datetime'2012-11-12T00:00:00' -> lv_date (20121112)
datetime'2012-11-12T23:59:59' -> lv_timestamp (20121112235959)
datetime'2012-11-12T23:59:59' -> No idea
R u getting the same error as mentioned above.
Regards,
Jibin Joy
Hi Jibin,
Thanks For your reply.
Now i am passing input dates as
datetime'2012-11-12T00:00:00' and datetime'2012-11-12T23:59:59' to rest client, it is not allowing other than this date foramt.
so i changed my input parameters to TIMESTAMP type in methods (get_entity & get_entityset) and RFC also. But now i am not getting any error and its not fetching any data just giving below response
<<title type="text">PODCollection</title> |
<updated>2012-11-23T09:55:45Z</updated>
<author> <name/> </author> |
<link href= "PODCollection" rel="self" title="PODCollection"/>
</feed>
Let me know one thin, we are passing date formats as datetime'2012-11-12T00:00:00' from rest client. In which format get_entity & get_entityset methods take it as input. because methods can passing input to RFC.
Can you please tell me.
Hi Suman,
Trouble Shoot
1. http://host_name:8000/sap/opu/odata/sap/service_name?$filter=IWKSTRT_DATE eq datetime'2012-10-18T00:00:00' and WKEND_DATE eq datetime'2012-10-20T00:00:00'
combine Both Filter as mentioned above.
2. Put debug in that RFC FM and check both field data Format
Based on my Gateway knowledge , it has to handle date formats but dont know to covert explicitly.anyway try above produces .
Reagards,
Jibin Joy
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.