Posts Tagged "HOLIDAY_GET"

ABAP – Program for getting Holidays information

In ABAP we can get the complete information about the holidays for an employee. That can be done as follows:   REPORT ZTEST. INFOTYPES : 0001. TABLES: PERNR. data: l_hcalno type HIDENT, count TYPE i  . Data: it_holidays TYPE STANDARD TABLE OF ISCAL_DAY. START-OF-SELECTION. GET PERNR. rp_provide_from_last p0001 space pn-begda pn-endda. IF sy-subrc = 0. SELECT SINGLE mofid FROM t001p INTO l_hcalno WHERE werks = p0001-werks AND btrtl = p0001-btrtl. ENDIF. REFRESH: it_holidays. CALL FUNCTION 'HOLIDAY_GET' EXPORTING holiday_calendar           = l_hcalno date_from                  = pn-begda date_to                    = pn-endda 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. IF sy-subrc <> 0. * Implement suitable error handling here ENDIF. count = lines( it_holidays ). WRITE: 'Number of holidays', count.   Output will displays the number of holidays for the employee in his working period.  

. Read More →

ABAP – Getting Holidays Details

In ABAP we can get the complete information about the holidays of a particular person. For that we can use the function module 'HOLIDAY_GET'. Syntax with exapmle: CALL FUNCTION 'HOLIDAY_GET' EXPORTING holiday_calendar           =<calendar id> date_from                  =begda date_to                    = endda TABLES holidays                   = <internal table> EXCEPTIONS factory_calendar_not_found = 1 holiday_calendar_not_found = 2 date_has_invalid_format    = 3 date_inconsistency         = 4 OTHERS                     = 5.   Now the internal table will contains all the information about the holidays for the calendar that the employee follows. For sample program please refer ...

. Read More →