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

Time

Former Member
0 Likes
942

Is there any SAP standard function module to convert user system date into server date based on the time zone?

Thanks

7 REPLIES 7
Read only

Former Member
0 Likes
895

hii

use thsi fm <b>CONVERT_TIME_INPUT</b>and for 12 hour format

<b>HRVE_CONVERT_TIME</b>

or

you just fill in a default value in:

INITIALIZATION.

<b>p_uzeit = sy-uzeit.</b>

Then there is no need for a popup or search help.

u can as well Use EDIT MASK to change the format of time.

chk this func modules

<b>TZON_CHECK_TIMEZONE

TZON_GET_TIMEZONE_TEXT

TZON_GET_USER_TIMEZONE

TZ_LOCATION_TIMEZONE</b>

REPORT Z_TIMESTAMP .
DATA: TSTAMP TYPE TIMESTAMP,
D TYPE D VALUE '19971224',

T TYPE T VALUE '235500'.

SET COUNTRY 'US'.


CONVERT DATE D TIME T INTO
TIME STAMP TSTAMP TIME ZONE 'UTC+12'.

" tstamp : 19971224115500
" (12/24/1997 11:55:00)

CONVERT TIME STAMP TSTAMP TIME ZONE 'UTC+12' INTO
DATE D TIME T.

Regards

Naresh

Read only

Former Member
0 Likes
895

You can use <b>SET TIME STAMP date time</b>

Cheers,

Thomas.

Read only

0 Likes
895

hi all,

my requirement actually is to convert the sy-datum to the local user time(ie Australia), the above FM are not working.

Read only

Former Member
0 Likes
895

Hi create this FM.This works

FUNCTION ZSERVER_TIME.

*"----


""Local Interface:

*" EXPORTING

*" VALUE(SYSTEMDATE) TYPE SY-DATUM

*" VALUE(SYSTEMTIME) TYPE SY-UZEIT

*"----


systemdate = sy-datum.

systemtime = sy-uzeit.

ENDFUNCTION.

(or)

alternatively you can use this function module

MSS_GET_SY_DATE_TIME

Reward helpful answers

Regards

PRaneeth

Read only

0 Likes
895

hi,

you can use CONVERT TIME STAMP

<b>CONVERT TIME STAMP tst TIME ZONE tz INTO DATE d TIME t.

CONVERT DATE d TIME t INTO TIME STAMP tst TIME ZONE tz.</b>

try the above things.

Regards

vijay

Read only

Former Member
0 Likes
895

Hai Srikanth

check the following F.M in the bellow code

parameters : p_date(8) default '20061025'.

data : v_out type sy-datum.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = p_date

IMPORTING

DATE_INTERNAL = v_out.

write 😕 v_out.

Thanks & regards

Sreenivasulu P

Read only

Former Member
0 Likes
895

Hii Srikanth

check this code

<b>

REPORT Z_TIMESTAMP .
DATA: TSTAMP TYPE TIMESTAMP,
D TYPE D VALUE '19971224',
 
T TYPE T VALUE '235500'.
 
SET COUNTRY 'AU'. " AUSTRALIA
 
 
CONVERT DATE D TIME T INTO
TIME STAMP TSTAMP TIME ZONE 'UTC+9'. " CHECK THE TIME ZONE
 
" tstamp : 19971224115500
" (12/24/1997 11:55:00)
 
CONVERT TIME STAMP TSTAMP TIME ZONE 'UTC+9' INTO
DATE D TIME T.

</b>

rEGARDS

Naresh