cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in handling Date field

AshwinDutt
Active Contributor
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member184867
Active Contributor

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

AshwinDutt
Active Contributor
0 Kudos

Thanks for your Input.
It worked for me

Former Member
0 Kudos

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.

Answers (2)

Answers (2)

0 Kudos

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.

former_member192971
Participant
0 Kudos

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.