Abap , Tatil Günlerini Hesaplama
Abap tarih günlerini çekmek için holiday_get fonksiyonu kullanılır.
DATA: cnt TYPE i.
DATA: it_holidays LIKE iscal_day OCCURS 0 WITH HEADER LINE.
REFRESH : it_holidays.
CLEAR : it_holidays.
CALL FUNCTION ‘HOLIDAY_GET’
EXPORTING
holiday_calendar = ‘TR’
factory_calendar = ‘TR’
date_from = it–erdat
date_to = it–onay_dt
TABLES
holidays = it_holidays
EXCEPTIONS
factory_calendar_not_found = 1
holiday_calendar_not_found = 2
date_has_invalid_format = 3
date_inconsistency = 4
OTHERS = 5.
cnt = 0.
LOOP AT it_holidays.
WRITE :/ it_holidays.
cnt = cnt + 1.
ENDLOOP.
WRITE :/ cnt.
*IF it–onay_dt IS NOT INITIAL.
*it–gunsay = it–onay_dt – it–erdat – cnt.
*ENDIF.
*MODIFY it TRANSPORTING gunsay.
*ENDLOOP.