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: 

Get actual time for specific time zone

Former Member
0 Kudos

Dear experts,

is it possible to get the actual time for a given time zone? We need to know the time of a certain plant and we are searching for a standard function module which calculates the time based on the plants time zone.

Thanks in advance,

David

Edited by: David Claes on Apr 12, 2010 5:05 PM

1 ACCEPTED SOLUTION

former_member1245113
Active Contributor
0 Kudos

HI

Enter TIMEZONE* in SE37 and take F4 Help

/OSP/TIMEZONE_DETERMINE -->Determine date and time in different timezones

/OSP/SYSTEM_TIMEZONE ---> System timezone
TZ_LOCATION_TIMEZONE ---> Time zones: Determine time zone for a location (land, region)
/OSP/GET_TIMEZONE

Cheeerz

Ram

4 REPLIES 4

former_member1245113
Active Contributor
0 Kudos

HI

Enter TIMEZONE* in SE37 and take F4 Help

/OSP/TIMEZONE_DETERMINE -->Determine date and time in different timezones

/OSP/SYSTEM_TIMEZONE ---> System timezone
TZ_LOCATION_TIMEZONE ---> Time zones: Determine time zone for a location (land, region)
/OSP/GET_TIMEZONE

Cheeerz

Ram

0 Kudos

Dear Ram,

thanks for you answer, I don't have the "/OSP/*" function modules in the SAP system.

Best regards,

David

satyajit_mohapatra
Active Contributor
0 Kudos

You can use TIME ZONE statement for this.



DATA: time_stamp_s TYPE string,
            time_stamp     TYPE timestamp,
            tzone              TYPE timezone,
           wf_date_conv TYPE sy-datum,
           wf_time_conv TYPE sy-uzeit.

tzone = 'CET'.

CONCATENATE sy-datlo   "Local Date
                          sy-timlo    "Local Time
                  INTO time_stamp_s.

time_stamp = time_stamp_s.

CONVERT TIME STAMP time_stamp TIME ZONE tzone INTO DATE wf_date_conv TIME wf_time_conv.

Otherwise FM IB_CONVERT_INTO_TIMESTAMP/IB_CONVERT_FROM_TIMESTAMP can bne used for same.

Edited by: Satyajit on Apr 13, 2010 1:31 PM

Former Member
0 Kudos

Hi,

You need to run 2 FMs in the following order.

1. CIF_GEN4_TIMEZONE_4_PLANT_GET - It will give you the timezone for the Plant.

2. JIT03_CONVERT_TIME_BY_TIMEZONE - You can convert local time into the time in the specified zone.

Hope this helps,

Raj