on 06-05-2013 6:12 PM
Hi,
What is the correct way to define Date fieldsin Gateway services? I defined a field as Edm.DateTime in SEGW made it nullable but am getting runtime exception.
I tried defining a precision but then the runtime artifact generation fails saying Gateway field and RFC (DATS) field mapped to it are incompatible. Without precision the runtime artifacts are generated but failing at runtime with XML Serialization error.
Please let me know if we have to do anything special to map/define Date /DateTime fields of Gateway service.
Thanks,
Avishek.
P.S. We are on SP6 so hoping the earlier issues of SEGW mapping validation for DateTime fields is taken care of (Note: 1763390).
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
If anyone else would face similar issue, then I suggest to proceed with this KBA:
2819936 - Check Project Consistency button in SEGW results in numerous warnings and/or error messages
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Guys,
Came across this post and it helped me out with a service I was building, long story short, I had to rebuild the service due to a system refresh and now I am having the same issue but cannot resolve it with the tips above, here is my setup (I have tried clearing the cache with /iwfnd/cache_cleanup) :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply Tejas ... I am not sure what was wrong with the service I built but it would not let me change the length of the DATE field from 0 and as for the BAPI - that data element is typed as DATS.
Long story short, I rebuilt the service and everything seemed to fall into place. Very odd.
This probably isn't where the issue is. The project isn't the service it's a representation of what should be generated and can be 'off'. There have been issues with MPC generation and the types that have been declared. I recall that I found that my dates had been generated with type P(8) instead of D (or even N(8) / C(8) ). Any of those would have worked but P(8) is very wrong. When I manually corrected it the service came back to life... until regenerating.
But seriously, do yourself a favour and stay away from FM mapping. If you are a developer at heart you'd probably appreciate code based implementation and the amount of control it gives you (and actually less work in real terms).
Cheers
Ron.
Some pointers about dates posted here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Avi,
i just followed the same steps u mentioned. I have my gateway type as Edm.Datetime and in abap it is Dats and maintained the ABAP Type internal type to D ( and tried with data element to Dats). I am able to generate the runtime artifacts without issues.. but in run time getting error saying in Error Log.
any other changes required while populating the data? Please suggest.
..ERROR_INFO | Invalid format (return table): Row Number 1, Property Name 'EarlyStartDt', Property Value '00000000' |
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any inputs on this, still could not solve this inspite of trying our various things.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.