‎2007 Dec 06 4:02 AM
how do we convert time and date from one zone to other zone?..using function module..can any one explain plz...
‎2007 Dec 06 4:13 AM
You can use the CONVERT statement with TIME ZONE addition.
Like:
DATA: time_stamp TYPE timestamp,
dat TYPE d,
tim TYPE t,
tz TYPE ttzz-tzone,
dst(1) TYPE c.
tz = 'BRAZIL'.
time_stamp = 20030309033000.
CONVERT TIME STAMP time_stamp TIME ZONE tz
INTO DATE dat TIME tim DAYLIGHT SAVING TIME dst.
WRITE: /(10) dat, (8) tim, dst.
time_stamp = 20030309043000.
CONVERT TIME STAMP time_stamp TIME ZONE tz
INTO DATE dat TIME tim DAYLIGHT SAVING TIME dst.
WRITE: /(10) dat, (8) tim, dst.
Regards,
Naimesh Patel
‎2007 Dec 06 4:26 AM
function module input parameters should be FROM zone ,TO zone,time,date and output parameters must be TO zone time,and date.....we must ask the user to enter TO zone, FROM zone ,TIME ...i need the code for that?
‎2007 Dec 06 4:29 AM
But why do you need FM for that when it can be achieved through this simple syntax.
You can make the parameters fields on your selection screen for date, time and timezone and use this CONVERT in your program to convert to different timezone.
Regards,
Naimesh Patel
‎2007 Dec 06 4:32 AM
Hi go thru these FMs
FITP_CONVERT_LOCAL_TIME_GMT
STU3_ALERTS_CONV_LOCAL_2_UTC
TZ_LOCATION_TIMEZONE
‎2007 Dec 06 5:06 AM
Hi joe ,
1.TIMESTAMP_INVERT_11_DIGITS
2.TIMESTAMP_RE_INVERT_11_DIGITS
3.TIMESTAMP_DURATION_ADD
4.TIMESTAMP_DURATION_DETERMINE
5.TIMESTAMP_DURATION_SUB
try theese function modules.
With Regards,
muthu.