Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

function module

Former Member
0 Likes
642

how do we convert time and date from one zone to other zone?..using function module..can any one explain plz...

5 REPLIES 5
Read only

naimesh_patel
Active Contributor
0 Likes
553

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

Read only

0 Likes
553

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?

Read only

0 Likes
553

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

Read only

0 Likes
553

Hi go thru these FMs

FITP_CONVERT_LOCAL_TIME_GMT

STU3_ALERTS_CONV_LOCAL_2_UTC

TZ_LOCATION_TIMEZONE

Read only

Former Member
0 Likes
553

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.