Skip to Content

Issue in handling Date field

Hello Experts,

In order to handle the 'date filed' i have used 'Edm Core Type' as 'Edm.DateTime' as shown below.

In the 'ABAP Type Editor' i have used '/BI0/OIDATE' as type which is provided by Gateway itself.

When backend returns the date filed with values ( for example '20130303' ) my service is not dumping and is working fine as shown below.

I am facing the below issues.

Issues :

1. I am getting the below error when the backend returns the date filed with value '00000000'.

2. I am getting the same above error when date filed is ' ' .

Kindly suggest solution for the above issue and guide if anything is wrong.

Immediately help is very much appreciated as i have already spent much time on this 😔

Regards,

Ashwin

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 11, 2013 at 07:35 AM

    Hi Ashwin,

    The problem lies in your model.

    You need to mark you date field as nullable in the model.you can do this by checking the nullable checkbox for the property. You are getting this error as you have mentioned a field as not nullable and passing null value into it.

    Regards,

    Atanu

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Ashwin Dutt R

      Hi both,

      I had this same issue yesterday, with somebody else's model. I changed to date=nullable expecting that to fix it - it didn't!

      The reason for this is that the actual data coming back from the feed had spaces in the date - I still don't know why the SAP kernel allows this as it's not a valid content type.

      The ABAP test for "initial" equivalence will only respond true for '00000000', spaces are not considered initial!

      The OData parser has a piece of code that checks for initial, and if the date value is space it will still fail as the improper initial value detection sends it down the wrong conversion path.

      The only way around this is to make sure your date field has some valid content, either '00000000' or a proper date.

      Regards

      Ron.

  • Posted on Oct 12, 2013 at 10:03 AM

    Hi Ashwin,

    I faced the same error earlier, Use the Abaptype for date field as shown below.

    Also Refresh the Cache using /IWFND/CACHE_CLEANUP and clear the logs using /IWFND/ERROR_LOG.

    Hope this helps.

    Thanks,

    Uday.


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 17, 2019 at 11:08 AM

    Hi,

    You are going to get entity data, after getting record your date field contain no value so you need to make your date field nullable.

    Thank you.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.