Application Development 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: 

FM for public holiday

Former Member
0 Kudos

hi

can anyone point to me the fm for public holidays?

thanks in advance

4 REPLIES 4

Former Member
0 Kudos
<b>option 1</b>
DATA : V_DATE TYPE SY-DATUM,
       V_DATE_NEW TYPE SY-DATUM.
       
V_DATE = SY-DATUM.
DATA : V_FLAG TYPE SCAL-INDICATOR.

  CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
       EXPORTING
*            CORRECT_OPTION               = '-'
            DATE                         = V_date
            FACTORY_CALENDAR_ID          = 'US'
       IMPORTING
       DATE                         = V_DATE_NEW
       WORKINGDAY_INDICATOR   = V_FLAG 
       EXCEPTIONS
            CALENDAR_BUFFER_NOT_LOADABLE = 1
            CORRECT_OPTION_INVALID       = 2
            DATE_AFTER_RANGE             = 3
            DATE_BEFORE_RANGE            = 4
            DATE_INVALID                 = 5
            FACTORY_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.
   EXIT.
  ENDIF.

  IF V_FLAG IS INITIAL.
   WRITE 😕 'Given day is a working day'.
  ENDIF.

<b>if V_FLAG is X Then its holiday.

if its initial,its a working day</b>

<b>Option 2 :</b>

this function module will display result as message.

CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
EXPORTING
date = d
factory_calendar_id = '01'
message_type = 'I'
EXCEPTIONS
date_after_range = 1
date_before_range = 2
date_invalid = 3
date_no_workingday = 4
factory_calendar_not_found = 5
message_type_invalid = 6
OTHERS = 7.
IF sy-subrc = 0.
numofdays = numofdays + 1.
write 😕 d.
ENDIF.

Regards

Srikanth

Message was edited by: Srikanth Kidambi

Former Member
0 Kudos

Hi,

check Fm

HOLIDAY_CALENDAR_GET

HOLIDAY_GET

CHECK_HOLIDAY

Regards

amole

Former Member
0 Kudos

Try

HOLIDAY_CHECK_AND_GET_INFO

HOLIDAY_CALENDER_GET

HR_DE_GET_HOLIDAY

Former Member
0 Kudos

Hi

This is the FM which will fulfil ur requirement-

HOLIDAY_GET

Hope this helps u.

Regds,

Seema