Application Development 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: 

Conversion of server time

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

This message was moderated.

former_member585060
Active Contributor
0 Kudos

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

0 Kudos

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