11-10-2016 9:05 AM
Hi all,
is there a standard way (fm or method) in SAP to determine if a local variable of type sy-datum is in the date range of summertime or wintertime? I was looking for something that takes in input the local variable date and returns 'Summertime' or 'Wintertime' as output.
Please help.
James
11-10-2016 9:54 AM
We've done this via FM "TZON_INTERNAL_TO_IETF" :
call function 'TZON_INTERNAL_TO_IETF'
EXPORTING
if_timezone = 'CET'
if_year = sy-datum(4)
IMPORTING
et_ietf_data = lt_shiftdates
EXCEPTIONS
time_zone_not_found = 1
dst_rule_not_found = 2
others = 3.
The output table should provide the dates by which 'STANDARD' changes to 'DAYLIGHT' by checking the Dates with Prefix 'DTSTART:'.
Hope this helps ...
Nic T.
11-10-2016 9:12 AM
11-10-2016 9:25 AM
Actually, understanding how SAP calculates sy-dayst (blank or 'X') could help in finding a solution to my problem.
11-10-2016 9:29 AM
It depends also which time zone is your input date. You have to define a rule (for instance, there's a time zone in the user profile). When you have chosen the right time zone, then you may use CONVERT TIME STAMP (input is a UTC timestamp + a time zone) to get the Daylight Saving Time indicator.
11-10-2016 9:50 AM
Hi Sandra,
how can I use CONVERT TIME STAMP to get the Daylight Saving Time indicator? sy-dayst doesn't get flagged after using CONVERT TIME STAMP instruction. So, what else should I use to get that indicator?
Thank you in advance.
11-10-2016 11:48 AM
Hi Sandra,
eventually I was able to use your CONVERT TIME STAMP with DAYLIGHT SAVING TIME.
Thank you!
James
11-10-2016 9:32 AM
if it's Day Light Saving Time the flag is 'X'
if it's not the flag is space.
The flag is set at operating system level.
11-10-2016 9:54 AM
We've done this via FM "TZON_INTERNAL_TO_IETF" :
call function 'TZON_INTERNAL_TO_IETF'
EXPORTING
if_timezone = 'CET'
if_year = sy-datum(4)
IMPORTING
et_ietf_data = lt_shiftdates
EXCEPTIONS
time_zone_not_found = 1
dst_rule_not_found = 2
others = 3.
The output table should provide the dates by which 'STANDARD' changes to 'DAYLIGHT' by checking the Dates with Prefix 'DTSTART:'.
Hope this helps ...
Nic T.
11-10-2016 10:58 AM
11-10-2016 11:33 AM