SAP UNIT_COMPARE_WITH_DAY Function Module for Is a time unit smaller than the unit day?
UNIT_COMPARE_WITH_DAY is a standard unit compare with day SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Is a time unit smaller than the unit day? 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 unit compare with day FM, simply by entering the name UNIT_COMPARE_WITH_DAY into the relevant SAP transaction such as SE37 or SE38.
Function Group: C0UN
Program Name: SAPLC0UN
Main Program:
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function UNIT_COMPARE_WITH_DAY 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 'UNIT_COMPARE_WITH_DAY'"Is a time unit smaller than the unit day?.
EXPORTING
I_UNIT = "Time unit which is compared with 'day'
* I_FLG_UNIT_CHECK = 'X' "
IMPORTING
E_FLG_UNIT_EQ_DAY = "
EXCEPTIONS
DIMENSION_NOT_TIME = 1 UNIT_IN_T006_MISSING = 2 UNIT_LT_DAY = 3 UNIT_MISSING = 4
IMPORTING Parameters details for UNIT_COMPARE_WITH_DAY
I_UNIT - Time unit which is compared with 'day'
Data type: T006-MSEHIOptional: No
Call by Reference: No ( called with pass by value option)
I_FLG_UNIT_CHECK -
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for UNIT_COMPARE_WITH_DAY
E_FLG_UNIT_EQ_DAY -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
DIMENSION_NOT_TIME - Unit is no time unit
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNIT_IN_T006_MISSING - Unit does not exist in T006
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNIT_LT_DAY -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNIT_MISSING - No unit specified
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for UNIT_COMPARE_WITH_DAY 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_i_unit | TYPE T006-MSEHI, " | |||
| lv_e_flg_unit_eq_day | TYPE C, " | |||
| lv_dimension_not_time | TYPE C, " | |||
| lv_i_flg_unit_check | TYPE C, " 'X' | |||
| lv_unit_in_t006_missing | TYPE C, " | |||
| lv_unit_lt_day | TYPE C, " | |||
| lv_unit_missing | TYPE C. " |
|   CALL FUNCTION 'UNIT_COMPARE_WITH_DAY' "Is a time unit smaller than the unit day? |
| EXPORTING | ||
| I_UNIT | = lv_i_unit | |
| I_FLG_UNIT_CHECK | = lv_i_flg_unit_check | |
| IMPORTING | ||
| E_FLG_UNIT_EQ_DAY | = lv_e_flg_unit_eq_day | |
| EXCEPTIONS | ||
| DIMENSION_NOT_TIME = 1 | ||
| UNIT_IN_T006_MISSING = 2 | ||
| UNIT_LT_DAY = 3 | ||
| UNIT_MISSING = 4 | ||
| . " UNIT_COMPARE_WITH_DAY | ||
ABAP code using 7.40 inline data declarations to call FM UNIT_COMPARE_WITH_DAY
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 MSEHI FROM T006 INTO @DATA(ld_i_unit). | ||||
| DATA(ld_i_flg_unit_check) | = 'X'. | |||
Search for further information about these or an SAP related objects