Quantcast
Channel: SCN: Message List - Edm.DateTime format and conversion error.
Viewing all 33 articles
Browse latest View live

Re: Edm.DateTime format and conversion error.

$
0
0

Hi Experts,

I am still not able to solve this, any inputs will be highly appreciated. I went through this SAP help page and tried all the suggestions but no success.

I Tried to define the ABAP Type as Date, Packed (15,0), Packed(11,7), Packed(21,7) but none of them worked. Another strange issue I faced in SEGW; I could not define ABAP Type for the DateTime field as Packed(8,0) by default the editor changes it to Packed(7,0) after saving the Entity definition.

 

Really lost trying to resolve this now.

 

Thanks,

Avishek.


Re: Edm.DateTime format and conversion error.

$
0
0

Avishek,

 

Edm.DateTime (ABAP type Packed(11,7))should work fine.

Either define it using EDM Core type or define it using Pre. and Scale. Do not use both to avoid conflicts.

 

What is the runtime exception you are getting? and at while doing what?

 

Thanks

Krishna

Re: Edm.DateTime format and conversion error.

$
0
0

Hi Krishna,

 

These are the errors loggoed against various cases:

GW Service Type        ABAP Type          Error

 

Edm.DateTime (0,0)     P(8,0)                    Value 734977 is not a valid date in accord with the XML format for ABAP

 

Edm.DateTime (0,0)     P(11,0)                  When converting the value 0.0 the values after the decimal place were lost

 

Edm.DateTime (0,0)     P(21,7)                  When converting the value 0.0 the values after the decimal place were lost

 

Edm.DateTime (21,7)   P(11,0)                  When converting the value 0.0 the values after the decimal place were lost

 

Edm.DateTime (8,0)     D(0,0)                   The argument 2013-04-18 cannot be interpreted as a number

 

Edm.DateTime (11,0)     D(0,0)                 The argument 2013-04-18 cannot be interpreted as a number

 

In the first case where the ABAP type is defined as P(8,0) the Service Builder is changing it to P(7,0) after saving.

 

Again the errors are not always consistent for each case even though I clear the cache Gateway system (/IWFND/CACHE_CLEANUP) before testing each call. However these are historically the errors I got.

 

Sometimes there is an XML conversion error and sometimes overflow error and for ABAP types DATE the date string is not being converted as a number.

 

Hope this gives some clue.

 

Thanks,

Avishek

Re: Edm.DateTime format and conversion error.

$
0
0

Hi Avishek,

 

Try this.

 

Only give EDM Date time as the EDM Core type and do not give precision and scale.

 

After doing this clear the cache so that metadata gets refreshed. Check that the changes you performed are reflecting.

 

Then try the runtime and let me know the error.

 

Thanks

Krishna

Re: Edm.DateTime format and conversion error.

$
0
0

Hi Krishna,

 

After using Edm.DateTime without precision and scale the error is always 'When converting the value 0.0 the values after the decimal place were lost' irrespective of the ABAP Type uesd (I checked with Date, Packed (8,0) and Packed (11, 0) .

 

Also did the cache cleanup and regenerated runtime objects everytime after changing. The change to the Edm.DateTime field was reflected in the MPC class.

 

Regards,

Avishek.

Re: Edm.DateTime format and conversion error.

$
0
0

Hi Avishek.,

why would you have 0.0 value in the date field? Is it not possible to stop this kind of values getting populated?

 

Regards,

Atanu

Re: Edm.DateTime format and conversion error.

$
0
0

Hi Avishek,

 

I suppose that you are in the Central hub deployment scenario, creating your model on the Gateway system ?

 

If you have installed IW_BEP on the backend system as well, can you try to create your model in the backend system ?

 

 

Regards,

 

Alexandre

Re: Edm.DateTime format and conversion error.

$
0
0

look avishek in the backend you have to define it as DATS and while testing on Rest client pass it as (im_date=datetime'2013-06-12T00:00:00'), even while u r passing using xml pass it as

<d:im_date>2012-06-06T00:00:00</d:im_date>


Re: Edm.DateTime format and conversion error.

$
0
0

Hi Krishna, Atanu, Abhishek and Alexandre thank you for your help.

I was able to resolver this by using the ABAP Type for the Date fields as DATS in the GW service definintion. However I had to create a new scenario and it worked and magically even some of the older scenarios also started working (which it was not earlier). Earlier, irrespective of whatever I did the data cache in GW was not clearing (and same error thrown again and again), I tried ICM cache clear, REST clint history deletion, GW metadata cache but no respite, but all of a sudden after I created this new scenario things started working.

Anyways all is good now for DATE and TIME fields. Thanks once again for your help.

 

Solution used in Brief:

Define ABAP Type for DateTime fields as DATS (or TIME) in Gateway Service builder.

 

Thanks and Regards,

Avishek.

Re: Edm.DateTime format and conversion error.

$
0
0

Dear Avishek

 

You have saved me hours of investigation!

 

Many thanks for sharing your solution.

 

Mike

Re: Edm.DateTime format and conversion error.

$
0
0

Avi, you are a rock star!

 

I have been battling with this the whole day and after reading your post and making the suggested changes my dates are working fine.

 

Thank you for actually coming back and posting the solution you found.

 

Rodney

Re: Edm.DateTime format and conversion error.

$
0
0

Avishek Gorai wrote:

.....
Define ABAP Type for DateTime fields as DATS (or TIME) in Gateway Service builder
......

Sorry for my question, but where do you define the ABAP type in SEGW?

I can't find it.


Regards
Aikon

Re: Edm.DateTime format and conversion error.

Re: Edm.DateTime format and conversion error.

Re: Edm.DateTime format and conversion error.

$
0
0

Hi Aikon.

 

Click on your Entity Type.

Open the Properties Folder and select the Property that you want to change.

 

In the displayed table there is a "Abap type" button second column from the right.

 

There you can select the abap type.

 

Good luck.

Rod


Re: Edm.DateTime format and conversion error.

$
0
0

thanks for the feedback

In the binding I still got an error, that says "Data source attribute ERDAT and model porperty Erdat have different types".

 

My dataproperty has the datatype DATS (type is ERDAT)

My model property has datatype DATS

dats.JPG

 

Any idea, whats wrong?


Thanks


Aikon

Re: Edm.DateTime format and conversion error.

$
0
0

Hi Aikon,

 

i think in this case you have to use Internal Type and Date. Try the following...SEGW_Date.jpg

Re: Edm.DateTime format and conversion error.

$
0
0

Hi Avishek

I have tried, but still error - please see my screendumps

 

date.JPG

 

And the error (and erdat definition):

error.JPG

Re: Edm.DateTime format and conversion error.

$
0
0

Hi Aikon,

 

Please define Gateway service field 'Erdat' as Edm.DateTime (without any presion, scale or length) instead of Edm.String as currrently done.

 

Regards,

Avishek.

Re: Edm.DateTime format and conversion error.

Viewing all 33 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>