Application Development and Automation 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: 
Read only

Summer time - Winter time

Former Member
0 Likes
1,923

Hi,

is possible in SAP samehow determine by abap code when the change from summer to winter time and vice versa occurs ?

Thanks.

Marian

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,623

Try checking sy-dayst.

Rob

Hi,

is possible in SAP samehow determine by abap code when the change from summer to winter time and vice versa occurs ?

Thanks.

Marian

8 REPLIES 8
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,623

Do you mean, daylight savings time?

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,624

Try checking sy-dayst.

Rob

Read only

0 Likes
1,623

That's interesting, in my system sy-dayst is not set to "X". I know that our time is set from the OS level, maybe that is the reason.

Regards,

Rich Heilman

Read only

0 Likes
1,623

Hi,

thanks. It is a little help.

However I need to determine a date when a time is changed.

Is it possible ?

Thanks for any help.

Marian

Read only

0 Likes
1,623

Hi,

any FM available ?

Thanks.

Marian

Read only

0 Likes
1,623

That's odd; however, it's set to 'X' in ours.

Rob

Read only

0 Likes
1,623

Fm: TZON_INTERNAL_TO_IETF gives begin of standard and daylight date/time in an itab for a given time zone and year.

Regards

Sridhar

Read only

suresh_datti
Active Contributor
0 Likes
1,623

The following works for US daylight savings..

*&---------------------------------------------------------------------*
*& Report  ZDAYLIGHT                                                   *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

report  zdaylight                               .


data: w_winter_start type sydatum,
      w_summer_start type sydatum,
      w_day like dtresr-weekday.

parameters: p_date like sy-datum default sy-datum.

concatenate p_date+0(4) '0401' into w_summer_start.

do.
  call function 'DATE_TO_DAY'
    exporting
      date    = w_summer_start
    importing
      weekday = w_day.

  translate w_day to upper case.
  if w_day eq 'SUNDAY'.
    exit.
  else.
    w_summer_start = w_summer_start + 1.
  endif.
enddo.
concatenate p_date+0(4) '1031' into w_winter_start.
do.
  call function 'DATE_TO_DAY'
    exporting
      date    = w_winter_start
    importing
      weekday = w_day.

  translate w_day to upper case.
  if w_day eq 'SUNDAY'.
    exit.
  else.
    w_winter_start  = w_winter_start - 1.
  endif.
enddo.

write: / 'Summer Starts on:', w_summer_start, '&',
         'Winter Starts on:', w_winter_start.

~Suresh