on 06-28-2016 11:37 PM
All,
I have read seemingly every article about dates and GW services but still cannot solve this one.
I am attempting a POST with a deep insert (I don't think that is related but maybe), the payload is JSON and I am formatting the date like this:
"MyDate":"2015-02-08T00:00:00Z",
In SEGW the date is formatted as Edm.DateTimeOffset and typed as DATS with 0's for the Precision, Scale and Max Length and Nullable is checked.
The response I get back is:
Value 20150208000000 is not a valid date in accord with the XML format for ABAP
I have tried clearing the cache with:
/IWFND/CACHE_CLEANUP and
/IWBEP/CACHE_CLEANUP
Any ideas?
Thanks, Mike
Hello Mike,
Please check as below.
1. Use Edm.DateTimeOffset with 0's for the Precision, Scale and Max Length and Null-able is checked.
2. In ABAP Type editor maintain as below.
3. Generate run-time objects and clear /IWFND/CACHE_CLEANUP & /IWBEP/CACHE_CLEANUP
4. Send Date as below in milliseconds in the JSON payload
{
...
"MyDate":"/Date(1467164260445)/",
...
}
Where
Wed Jun 29 2016 07:07:40 GMT+0530 (Asia/Kolkata)
equals
1467164260445 milliseconds
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ashwin,
Thanks for the reply, one question.
I am using a structure (not a custom one) that defines that entity and the date field is typed as DATS - so I cannot change it to TIMESTAMP.
I suppose I could add a custom date field that I could type as TIMESTAMP.
Is there a way I can use the existing field and make this work?
-Mike
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.