If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Cada centro tiene un calendario laboral. Cada centro además tiene su calendario de días festivos. Yo quiero sumarle a una fecha dos días pero teniendo en cuenta que el día que me de sea laboral, teniendo en cuenta ese calendario laboral y de festivos para ese centro.
la siguiente funcion te dice si una fecha es festivo o no, segun el calendario q utilices:
DATA: lc_holiday_cal_id LIKE SCAL-HCALID VALUE 'PE', "Este es el ID dl calendario
ltab_holiday_attributes LIKE THOL OCCURS 0 WITH HEADER LINE,
flag(1) type c.
CALL FUNCTION 'HOLIDAY_CHECK_AND_GET_INFO'
EXPORTING
DATE = fecha "La fecha evaluar
HOLIDAY_CALENDAR_ID = lc_holiday_cal_id
WITH_HOLIDAY_ATTRIBUTES = 'X'
IMPORTING
HOLIDAY_FOUND = flag
TABLES
holiday_attributes = ltab_holiday_attributes
EXCEPTIONS
CALENDAR_BUFFER_NOT_LOADABLE = 1
DATE_AFTER_RANGE = 2
DATE_BEFORE_RANGE = 3
DATE_INVALID = 4
HOLIDAY_CALENDAR_ID_MISSING = 5
HOLIDAY_CALENDAR_NOT_FOUND = 6
OTHERS = 7.
La idea es q luego d agregar los dias q quieras a tu fecha, valides si esta ultima es feriado, si sale q si (flag = 'X') ya tu ves q haces: agregas 1 dia mas y asi hasta encontrar un dia laborable.
Comentario