on 07-13-2010 6:45 AM
Hello Experts,
I have a string with value '2010-07-16T07:30:00+03:00' which came from a webservice string data.Please advice how to declare variable in abap to get the correct date and time from this string?
From my previous exp, if I had the xml structure with this field as xsddatetime and in abap proxy, if I assign it to a char/string variable it used to do the calculation based on the timezone and give me the value as 20100716043000.
Please advice.
(I'm not sure if I had to post this in the ABAP forum, but thought the PI experts might have faced and solved this problem before)
Mat
If you need to transform the same on PI system, use standard function Date --> DateTrans.
check the below link for standard functions :
http://help.sap.com/saphelp_nwpi711/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Sandeep for your time and effort, but the problem here is this wont consider the +3 timezone in below example.
Generally if you have a date time field in xml structure, while generating proxy ..it creates the field in abap with XSDDATETIME_Z dataelement and automatically converts to the correct date time.(below ex date = '2010-07-16' time = 04:30:00'
If I offset and do the math myself, I have to handle various cases like different time zones as well as time closer to midnights( then the date has to be changed too ).
I was hoping for a straight forward way of declaring it and getting the values.
Thanks again.
Mat
Hi Joseph,
Approach1.
Use datetransform standard function and create two different char variables for date and time and do mapping accorindly ..
Approach2.
create one string variable and do coding for string handeling in the proxy class.
Regards
Vijay G
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply
Approach 1 : The entire XML payload is coming in a string and I'm doing the XML parsing in ABAP.So this is ruled out.
Approach 2 : This is what I'm trying to do , I have the value 2010-07-16T07:30:00+03:00 in a string, but unsure about how to proceed.How do I convert this to date and time taking care of the timezone considerations.
Mat
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.