cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in user Time printing in sap script

Former Member
0 Kudos

Hi,

We have our system time as CET . hence the printouts time is displayed as per system time. But i want the user date and time to be printed as per his local time zone. I have used sy-uzeit but it is a system time. can anyone help if there is another system variable which stores user local time & date. Else any function module by which we can convert the sys time to user time.

Thanks. Points will be given to useful answers

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

form convert_date_time .

data: l_tzone type timezone.

constants: c_cet type timezone value 'CET'.

  • Fetch system time zone

call function '/ISDFPS/GET_SYSTEM_TIME_ZONE'

importing

time_zone = l_tzone.

  • Convert to time zone CET

call function '/ISDFPS/CONV_TIME_ZONE'

exporting

old_date = sy-datum

old_time = sy-uzeit

old_time_zone = l_tzone

new_time_zone = c_cet

importing

new_date = g_date

new_time = g_time

exceptions

invalid_time_zone = 1

others = 2.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endform. " CONVERT_DATE_TIME

Former Member
0 Kudos

Hi,

Try FM 'IB_CONVERT_INTO_TIMESTAMP'

Reward if helpful.

Tyken