on 11-08-2012 1:07 PM
Hi,
I have a huge xml-structure (external definition) with a lot of date- and datetime fields. In the proxy the abap type is either XSDDATE_D or XSDDATETIME_Z. The interface apparantly expects the data to be in offset format (2012-11-08+02:00 for dates and 2012-11-08T13:34:00.000+02:00 for datetimes - the second one seems to be ABAP-type XSDDATETIME_OFFSET, the fist one might be XSDDATE_ISO?). So I think I need to convert the data from and to the internal ABAP format. I found a class CL_BS_SOA_CONVERT_XSDDATETIME to convert datetimes from Internal to xsd_datetime_z and to XSDDATETIME_offset. Can I somehow change the proxy to XSDDATETIMEOFFSET (XSDDATE_ISO is possible)? Or should the conversion be done in PI rather than in the Backend? Any suggestions.
Thanks and Regards,
Felix
Try class CL_GDT_CONVERSION
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Felix,
What you need to do is to define your data type in ESR as a "Core Data Type" with "Representation Term - DateTime". After that the layout of type definition subscreen is changed. There you need to choose "Pattern". For ABAP XSDDATETIME_OFFSET choose option "Local with Offset", for ABAP XSDDATETIME_ISO use the last one "Global, Local or Local with Offset". Save and activet the change in ESR and go back to SPROXY, when you need to regenerate the proxy object for you ESR date type. The selection field "ABAP Attributes Techn.Type" changes it's content.
IMHO the variant with ISO is more flexible since the proxy object has no pattern on itself and you wont get transformation exception in case of UTC datetime.
Hope it helps to answer this "sometime" very important topic.
Rgds
Tomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tomas,
I was going through your response and wanted to check with you on how to get the attribute XSDDATETIME_LOCAL in the "ABAP Attributes Technical Type".
I get the XSDDATETIME_Z, XSDDATETIME_ISO , STRING attributes in the SPROXY dropdown but cannot see the XSDDATETIME_LOCAL attribute.
Appreciate your help on this.
Thanks and regards,
Atul
Hi Atul,
use type XSDDATETIME_ISO and get the ABAP timestamp variable. The ProxyFramework will take care about the conversion between timezones and daylight saving. Then use ABAP command CONVERT timestamp with appropriate parameters to get date and time in local timezone.
This works for me.
Rgds
Tom
It will be easier and maintainable to do it in PI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.