10-16-2008 8:15 AM
Hi,
I am doing a report where in we get the date & time from the SRM server and also we get the date & time from R/3 server. Both these servers are in different regions, i need to standardize the time in the report as R/3. How can i convert the date & time from SRM to that of the R/3 and have a common date & time in the report. Please advise.
Regards
Balaji
10-16-2008 8:27 AM
10-16-2008 8:36 AM
Hi,
In order to achieve this, first we need to convert the 2 times to standard GMT and from GMT to the required timezone.
IB_CONVERT_INTO_TIMESTAMP is used to convert the time to the GMT. The input parameters are DATE, TIME and the TIMEZONE(user's timezone, default value SY-ZONLO). The output parameter is the timestamp in GMT.
The function module IB_CONVERT_FROM_TIMESTAMP is used to get the time in required timezone. The input parameters for this are the timestamp obtained from the above function module and the timezone, to which the time needs to be converted.
The output parameters are the date, time in the required timezone.
so do it for SRM and R/3 servers with same output timezone.
Sample code
DATA :
timestamp like TZONREF-TSTAMPS,
time like sy-uzeit,
date like sy-datum.
The following function module is used to convert the
time and date into GMT timestamp
CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
EXPORTING
i_datlo = sy-datum
i_timlo = sy-uzeit
I_TZONE = 'INDIA'
IMPORTING
E_TIMESTAMP = timestamp.
The following function module is used to convert the
above obtained timestamp to PST timezone date and time.
CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'
EXPORTING
i_timestamp = timestamp
I_TZONE = 'PST'
IMPORTING
E_DATLO = date
E_TIMLO = time.
write 😕 'Date and Time at PST zone is ',date, time.
Regards
Bala Krishna
10-18-2008 11:08 AM
The above function module converts the time to time zone time.
I need to convert to server time.
There is a RFC connection exists between the SRM & R/3.
Conversion based on Time zone is not suitable,since server time is always influenced by daylight savings.
Please advice
Regards
Balaji R