SAP TM_DATE_CHECK_WORKINGDAY Function Module for Working Day Check for a Date with Regard to Two Factory Calendars
TM_DATE_CHECK_WORKINGDAY is a standard tm date check workingday SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Working Day Check for a Date with Regard to Two Factory Calendars processing and below is the pattern details for this FM, 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 tm date check workingday FM, simply by entering the name TM_DATE_CHECK_WORKINGDAY into the relevant SAP transaction such as SE37 or SE38.
Function Group: TM03
Program Name: SAPLTM03
Main Program: SAPLTM03
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TM_DATE_CHECK_WORKINGDAY 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 'TM_DATE_CHECK_WORKINGDAY'"Working Day Check for a Date with Regard to Two Factory Calendars.
EXPORTING
* CALENDAR1 = ' ' "Factory Calendar 1
* CALENDAR2 = ' ' "Factory Calendar 2
CHECK_MODE = "Check mode
DATE = "Date
* DESCRIPTION = ' ' "Description of date
* BAPI_CALL = "Aufruf durch BAPI
IMPORTING
DATE_CHECKED = "Date after check
EXCEPTIONS
CHECK_MODE_INVALID = 1 NO_WORKING_DAY = 2
IMPORTING Parameters details for TM_DATE_CHECK_WORKINGDAY
CALENDAR1 - Factory Calendar 1
Data type: TFACD-IDENTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CALENDAR2 - Factory Calendar 2
Data type: TFACD-IDENTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CHECK_MODE - Check mode
Data type: AT100-SGTGPRFOptional: No
Call by Reference: No ( called with pass by value option)
DATE - Date
Data type: SY-DATUMOptional: No
Call by Reference: No ( called with pass by value option)
DESCRIPTION - Description of date
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
BAPI_CALL - Aufruf durch BAPI
Data type: BOOLEANOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for TM_DATE_CHECK_WORKINGDAY
DATE_CHECKED - Date after check
Data type: SY-DATUMOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
CHECK_MODE_INVALID - Check mode not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_WORKING_DAY -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for TM_DATE_CHECK_WORKINGDAY 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: | ||||
| lv_calendar1 | TYPE TFACD-IDENT, " SPACE | |||
| lv_date_checked | TYPE SY-DATUM, " | |||
| lv_check_mode_invalid | TYPE SY, " | |||
| lv_calendar2 | TYPE TFACD-IDENT, " SPACE | |||
| lv_no_working_day | TYPE TFACD, " | |||
| lv_check_mode | TYPE AT100-SGTGPRF, " | |||
| lv_date | TYPE SY-DATUM, " | |||
| lv_description | TYPE SY, " SPACE | |||
| lv_bapi_call | TYPE BOOLEAN. " |
|   CALL FUNCTION 'TM_DATE_CHECK_WORKINGDAY' "Working Day Check for a Date with Regard to Two Factory Calendars |
| EXPORTING | ||
| CALENDAR1 | = lv_calendar1 | |
| CALENDAR2 | = lv_calendar2 | |
| CHECK_MODE | = lv_check_mode | |
| DATE | = lv_date | |
| DESCRIPTION | = lv_description | |
| BAPI_CALL | = lv_bapi_call | |
| IMPORTING | ||
| DATE_CHECKED | = lv_date_checked | |
| EXCEPTIONS | ||
| CHECK_MODE_INVALID = 1 | ||
| NO_WORKING_DAY = 2 | ||
| . " TM_DATE_CHECK_WORKINGDAY | ||
ABAP code using 7.40 inline data declarations to call FM TM_DATE_CHECK_WORKINGDAY
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 IDENT FROM TFACD INTO @DATA(ld_calendar1). | ||||
| DATA(ld_calendar1) | = ' '. | |||
| "SELECT single DATUM FROM SY INTO @DATA(ld_date_checked). | ||||
| "SELECT single IDENT FROM TFACD INTO @DATA(ld_calendar2). | ||||
| DATA(ld_calendar2) | = ' '. | |||
| "SELECT single SGTGPRF FROM AT100 INTO @DATA(ld_check_mode). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_date). | ||||
| DATA(ld_description) | = ' '. | |||
Search for further information about these or an SAP related objects