|
HOLIDAY_GET - Provides a table
of all the holidays based upon a Factory Calendar &/ Holiday Calendar.
Holiday_Get function is basically used to find the holidays occurring in a prescribed period of time. For this it exports the four parameters holiday calendar, factory calendar, date from and date to. 1) HOLIDAY_CALENDAR The name of the holiday calendar used should be passed in this parameter. The public holidays or any other holidays mentioned in the given calendar will be considered as a holiday. 2) FACTORY_CALENDAR The name of the factory calendar is used in this parameter. This type of calendar by default considers Saturdays and Sundays as holidays. Apart from this we include a holiday calendar inside the factory calendar. So all the holidays mentioned in the include holiday calendar will also occur in the factory calendar. 3) DATE_FROM The starting date from where the holidays have to be calculated should be given in this parameter. 4) DATE_TO The ending date to where the holidays have to be calculated should be given in this parameter. All the holidays mentioned in the given calendars will be returned to a table. This table will have the list of all holidays in the given time along with the dates on which they occur. This function can be used in calculation of leave duration. DATA ITAB_ISCAL_DAY TYPE STANDARD
TABLE OF ISCAL_DAY INITIAL SIZE 0.
CALL FUNCTION 'HOLIDAY_GET' EXPORTING HOLIDAY_CALENDAR = holiday_calendar_name FACTORY_CALENDAR = factory_calendar_name DATE_FROM
= START_DATE
* IMPORTING
TABLES
EXCEPTIONS
IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY
NUMBER SY-MSGNO
ENDIF. DESCRIBE TABLE ITAB_ISCAL_DAY
LINES rec. "This command will give the number of rows in the table
which is also the number of holidays" occurring in the given time in the
mentioned calendars.
Notes: Function Module for List of holidays for given calendar year HOLIDAY_CHECK_AND_GET_INFO Useful for determining whether or not a date is a holiday. Give the function a date, and a holiday calendar, and you can determine if the date is a holiday by checking the parameter HOLIDAY_FOUND. |
|
Read Also
Get help for your ABAP problems
ABAP Books
More ABAP Tips
SAP ERP Modules, Basis, ABAP and Other IMG Stuff All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|