Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

DATS to EDM.DateTime Conversion

former_member460045
Participant
0 Likes
6,569

Hello community,

I'm trying to set up an oData-Service and have troubles with using date fields from a table.

1. I have imported the DDIC Structure with Sdate (Datatype DATS)

2. Field Sdate is mapped to EDM.DateTime

3. Error in Gateway Client --- Format invalid when calling GET_ENTITY_SET

Obviously the date is not formatted correctly.

But why?

Best regards and many thanks in advance
Johannes Sonner

Hello community,

I'm trying to set up an oData-Service and have troubles with using date fields from a table.

1. I have imported the DDIC Structure with Sdate (Datatype DATS)

2. Field Sdate is mapped to EDM.DateTime

3. Error in Gateway Client --- Format invalid when calling GET_ENTITY_SET

Obviously the date is not formatted correctly.

But why?

Best regards and many thanks in advance
Johannes Sonner

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
3,437

Did you search and read a discussion such as Rules for OData datetime properties, if yes what is the content of the field (use Request/Response Daten)

Read only

0 Likes
3,437

Hi,

yes i checked it.

Rule 3
The nullable attribute can only be correctly evaluated if the backend date contains '00000000' as a value. ABAP date values containing spaces (this is allowed unfortunately) will not be treated as null, but also not be able to convert to an edm.datetime - you will get a runtime error from the server.

Regarding Rule 3: I dont know how I could check the request/response data because it does'nt even hit the set breaktpoint in the GET_ENTITY_SET function. In the table itself (with se16) I cannot see any spaces.

And Rule 5 is exactly what I did. The DATS Element of the table is directly used for the entity defintion.

I'm very confused because DATS is YYYYMMDD but it is shown in the error log as DD.MM.YY

Best regards

Johannes