Skip to Content
avatar image
Former Member

how to get holidays info on SQ02 -

Hello everyone

I would like to find if that day is a holiday or working, I tried with the FM HOLIDAY_CHECK_AND_GET_INFO with this code:

but I do not find anything, I was expecting to Sunday the flag X (and other days..)

please help me

thanks in advance

---------------

CALL FUNCTION 'HOLIDAY_CHECK_AND_GET_INFO'

  EXPORTING

    DATE                               = ZBLD_RDT_CON_RDA-DATUM

    HOLIDAY_CALENDAR_ID                = FABKL

    WITH_HOLIDAY_ATTRIBUTES            = ' '

  IMPORTING

    HOLIDAY_FOUND                      = HOLID

* TABLES

*   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

          .

IF SY-SUBRC <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Sep 08, 2014 at 08:47 AM

    Hi

    It depends on how the calendar you need to check is defined:

    If you use IT as calendar and insert 25.12.2014 the function module returns it's holiday as this day is set as holiday in IT calendar,

    but if you insert 07.09.2014 (Sunday) the fm retunrs blank because this day is not set as holiday, it's only not working day.

    So if you need to know if a day is holiday you can use fm  HOLIDAY_CHECK_AND_GET_INFO, if you need to know if it's working day you can use fm like DATE_CONVERT_TO_FACTORYDATE or DATE_CHECK_WORKINGDAY

    Max

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi

      That fm returns thr first working day before or after the date in input, so if you use + it'll return the first working day after the inpu date:

      - If the input date is holiday, the output date will be different from the input one and the WORKINGDAY_INDICATOR will be set to + (in according to the input value of correct_option )

      - If the input date is a working day, the output date will be the same of the input one, so the WORKINGDAY_INDICATOR will be set to space

      You check only WORKINGDAY_INDICATOR, so it can be ok to say if it's + is holiday and if it's blank is working day

      Max