04-12-2010 4:05 PM
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
04-12-2010 4:11 PM
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
04-12-2010 4:11 PM
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
04-13-2010 8:26 AM
Dear Ram,
thanks for you answer, I don't have the "/OSP/*" function modules in the SAP system.
Best regards,
David
04-13-2010 8:34 AM
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
04-13-2010 9:13 AM
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