Sap Abap date to day – tarih gün format çevirmesi

 FUNCTION  Zdate_to_day.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     REFERENCE(DATE) LIKE  SY-DATUM
*"  EXPORTING
*"     REFERENCE(WEEKDAY) LIKE  DTRESR-WEEKDAY
*"----------------------------------------------------------------------


  DATA: day_p TYPE p.

  day_p = date MOD 7.
* DAY_P enthält 0 für Samstag, 1 für Sonntag, etc.. und muß
* der Kalendernotation: 1 für Montag, 2 für Dienstag, etc.,
* angepaßt werden.
  IF day_p > 1.
    day_p = day_p - 1.
  ELSE.
    day_p = day_p + 6.
  ENDIF.

  CASE day_p.
    WHEN 1.
      weekday = text-dmo.
    WHEN 2.
      weekday = text-ddi.
    WHEN 3.
      weekday = text-dmi.
    WHEN 4.
      weekday = text-ddo.
    WHEN 5.
      weekday = text-dfr.
    WHEN 6.
      weekday = text-dsa.
    WHEN 7.
      weekday = text-dso.
  ENDCASE.

ENDFUNCTION.
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)