SAP HOLIDAY_GET Function Module for









HOLIDAY_GET is a standard holiday get SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for holiday get FM, simply by entering the name HOLIDAY_GET into the relevant SAP transaction such as SE37 or SE38.

Function Group: SCA5
Program Name: SAPLSCA5
Main Program: SAPLSCA5
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function HOLIDAY_GET pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'HOLIDAY_GET'"
EXPORTING
* HOLIDAY_CALENDAR = ' ' "Public holiday calendar ID
* FACTORY_CALENDAR = ' ' "Factory calendar ID
* DATE_FROM = SY-DATUM "
* DATE_TO = SY-DATUM "

IMPORTING
YEAR_OF_VALID_FROM = "
YEAR_OF_VALID_TO = "
RETURNCODE = "

TABLES
HOLIDAYS = "

EXCEPTIONS
FACTORY_CALENDAR_NOT_FOUND = 1 HOLIDAY_CALENDAR_NOT_FOUND = 2 DATE_HAS_INVALID_FORMAT = 3 DATE_INCONSISTENCY = 4
.



IMPORTING Parameters details for HOLIDAY_GET

HOLIDAY_CALENDAR - Public holiday calendar ID

Data type: SCAL-HCALID
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

FACTORY_CALENDAR - Factory calendar ID

Data type: SCAL-FCALID
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

DATE_FROM -

Data type: SCAL-DATE
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

DATE_TO -

Data type: SCAL-DATE
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for HOLIDAY_GET

YEAR_OF_VALID_FROM -

Data type: SCAL-YEAR
Optional: No
Call by Reference: No ( called with pass by value option)

YEAR_OF_VALID_TO -

Data type: SCAL-YEAR
Optional: No
Call by Reference: No ( called with pass by value option)

RETURNCODE -

Data type: SY-SUBRC
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for HOLIDAY_GET

HOLIDAYS -

Data type: ISCAL_DAY
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

FACTORY_CALENDAR_NOT_FOUND - Factory calendar is not in buffer

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

HOLIDAY_CALENDAR_NOT_FOUND - Holiday calendar is not in buffer

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

DATE_HAS_INVALID_FORMAT -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

DATE_INCONSISTENCY -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for HOLIDAY_GET Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lt_holidays  TYPE STANDARD TABLE OF ISCAL_DAY, "   
lv_holiday_calendar  TYPE SCAL-HCALID, "   SPACE
lv_year_of_valid_from  TYPE SCAL-YEAR, "   
lv_factory_calendar_not_found  TYPE SCAL, "   
lv_factory_calendar  TYPE SCAL-FCALID, "   SPACE
lv_year_of_valid_to  TYPE SCAL-YEAR, "   
lv_holiday_calendar_not_found  TYPE SCAL, "   
lv_date_from  TYPE SCAL-DATE, "   SY-DATUM
lv_returncode  TYPE SY-SUBRC, "   
lv_date_has_invalid_format  TYPE SY, "   
lv_date_to  TYPE SCAL-DATE, "   SY-DATUM
lv_date_inconsistency  TYPE SCAL. "   

  CALL FUNCTION 'HOLIDAY_GET'  "
    EXPORTING
         HOLIDAY_CALENDAR = lv_holiday_calendar
         FACTORY_CALENDAR = lv_factory_calendar
         DATE_FROM = lv_date_from
         DATE_TO = lv_date_to
    IMPORTING
         YEAR_OF_VALID_FROM = lv_year_of_valid_from
         YEAR_OF_VALID_TO = lv_year_of_valid_to
         RETURNCODE = lv_returncode
    TABLES
         HOLIDAYS = lt_holidays
    EXCEPTIONS
        FACTORY_CALENDAR_NOT_FOUND = 1
        HOLIDAY_CALENDAR_NOT_FOUND = 2
        DATE_HAS_INVALID_FORMAT = 3
        DATE_INCONSISTENCY = 4
. " HOLIDAY_GET




ABAP code using 7.40 inline data declarations to call FM HOLIDAY_GET

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
"SELECT single HCALID FROM SCAL INTO @DATA(ld_holiday_calendar).
DATA(ld_holiday_calendar) = ' '.
 
"SELECT single YEAR FROM SCAL INTO @DATA(ld_year_of_valid_from).
 
 
"SELECT single FCALID FROM SCAL INTO @DATA(ld_factory_calendar).
DATA(ld_factory_calendar) = ' '.
 
"SELECT single YEAR FROM SCAL INTO @DATA(ld_year_of_valid_to).
 
 
"SELECT single DATE FROM SCAL INTO @DATA(ld_date_from).
DATA(ld_date_from) = SY-DATUM.
 
"SELECT single SUBRC FROM SY INTO @DATA(ld_returncode).
 
 
"SELECT single DATE FROM SCAL INTO @DATA(ld_date_to).
DATA(ld_date_to) = SY-DATUM.
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!