‎2006 Jun 09 9:34 AM
Is there any SAP standard function module to convert user system date into server date based on the time zone?
Thanks
‎2006 Jun 09 9:43 AM
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
‎2006 Jun 09 9:46 AM
‎2006 Jun 09 10:57 AM
hi all,
my requirement actually is to convert the sy-datum to the local user time(ie Australia), the above FM are not working.
‎2006 Jun 09 9:46 AM
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
‎2006 Jun 09 9:55 AM
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
‎2006 Jun 09 10:04 AM
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
‎2006 Jun 09 11:49 AM
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