on 05-23-2014 7:03 AM
Hello Experts,
I have gone through the other related posts already asking similar question but still I need more information.
In my SEGW web service, import structure has first three fields as FLD1, EXEC_DATE, EXEC_TIME & these fields comprise the key also. Hence, they are not nullable.
System-default Edm types for date & time are Edm.datetime & Edm.time. There is no such Edm type as Edm.date. Also, values for these types are displayed as 2013-01-02T00:00:00 for date and PT10H10M00S as time.
Do we have any Edm type that would accept date as '2013-01-02' or '20130102' and time as '101000'? Or date & time are to be passed in this format only?
Please help on this. I need more clarity whether I am using correct Edm types & its fine for service to expect date & time in above format.
Thanks in advance
Gaurav K
Hi Gaurav,
There is no EDM type available which will take date format as you mentioned. but it is possible to have the format you mentioned at client side. while passing the date to OData service, it should be passed as 2013-01-02T00:00:00 as you mentioned correctly.
Also refer ODATA DATE QUERY - Stack Overflow
Regards,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Additionally annotate the date property with sap:display-format="Date" for pure date fields. Read response by Ralf Handl in thread
From OData version 4.0, there will be new edm type for date as Edm.Date and Edm.Duration for time. Please refer What's New in OData Version 4.0
But for that we need to wait as SAP NW Gateway is based on OData version 2.0
Just FYI.
Regards,
Chandra
Caution: Edm.Time uses the format of a duration, i.e. P13H20M for thirteen hours and twenty minutes.
To make things more interesting Edm.Time only allows durations smaller then 24 hours.
Which is why it was removed in OData 4.0 and two new data types were introduced:
Which hopefully makes things easier
Hi Gaurav,
while creating project, you need to select Service with Vocabulary-Based Annotations to use annotations. Please refer Working with Annotations - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library
Also follow the steps mentioned at Adding Vocabulary-Based Annotations to Data Model Artifacts - SAP NetWeaver Gateway Foundation (SAP_...
Regards,
Chandra
Hi Chandrashekhar,
I am with NWGW SP09 and new to NWGW.
I am getting the same Warning message as above mentioned when an Entity is created w.r.t DDIC Structure and if it contains Date/Time field.
I have changed the Edm Core Type to Edm.DateTimeOffset of those fields, still I was not able to rectify the warning.
If I change the ABAP Field Name to D, it throws error as it is not a part of Structure.
The same I didn't find in SP06.
Please do help to understand the concept.
Thanks in Advance.
Regards,
Punith
Hi Gaurav,
The names EXEC_DATE and EXEC_TIME suggest that these two backend fields belong together and combined identify the point in time at which something gets executed.
If that is the case, the best modeling approach here is to combine the two backend fields EXEC_DATE and EXEC_TIME into one OData property ExecDateTime of type Edm.DateTimeOffset (Offset == with time zone information).
That way the real business semantics is visible in the OData model, and the implementation detail of storing the point in time in two ABAP fields is gracefully hidden from the consumer.
Regards!
--Ralf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.