SAP CF_CK_PUNIT Function Module for PRT: Check unit formula parameter
CF_CK_PUNIT is a standard cf ck punit SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for PRT: Check unit formula parameter 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 cf ck punit FM, simply by entering the name CF_CK_PUNIT into the relevant SAP transaction such as SE37 or SE38.
Function Group: CFCK
Program Name: SAPLCFCK
Main Program:
Appliation area: M
Release date: 17-Feb-1993
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CF_CK_PUNIT 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 'CF_CK_PUNIT'"PRT: Check unit formula parameter.
EXPORTING
* MSGTY_IMP = 'E' "Message type
PARID_IMP = "Formula parameter
PUNIT_IMP = "Unit formula parameter
PVALUE_IMP = "Evaluate formula parameter
* SPRAS_IMP = SY-LANGU "Language indicator for short text
IMPORTING
T006T_EXP = "Table entry dimension unit
T006_EXP = "Table entry unit
TC20T_EXP = "Table entry short text formula par
TC20_EXP = "Table entry formula parameter
EXCEPTIONS
NO_PARAMETER = 1 NO_UNIT = 2 WRONG_DIMENSION = 3 WRONG_PARAMETER = 4 WRONG_UNIT = 5
IMPORTING Parameters details for CF_CK_PUNIT
MSGTY_IMP - Message type
Data type: SY-MSGTYDefault: 'E'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PARID_IMP - Formula parameter
Data type: TC20-PARIDOptional: No
Call by Reference: No ( called with pass by value option)
PUNIT_IMP - Unit formula parameter
Data type: TC20-UNITOptional: No
Call by Reference: No ( called with pass by value option)
PVALUE_IMP - Evaluate formula parameter
Data type: TC20-VALUE_DEFOptional: No
Call by Reference: No ( called with pass by value option)
SPRAS_IMP - Language indicator for short text
Data type: T002-SPRASDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CF_CK_PUNIT
T006T_EXP - Table entry dimension unit
Data type: T006TOptional: No
Call by Reference: No ( called with pass by value option)
T006_EXP - Table entry unit
Data type: T006Optional: No
Call by Reference: No ( called with pass by value option)
TC20T_EXP - Table entry short text formula par
Data type: TC20TOptional: No
Call by Reference: No ( called with pass by value option)
TC20_EXP - Table entry formula parameter
Data type: TC20Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_PARAMETER - No formula parameter transferred
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_UNIT - No unit in spite of value
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_DIMENSION - Dimension unit <> Dimension formul
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_PARAMETER - Formula parameter not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_UNIT - Unit not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CF_CK_PUNIT 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_msgty_imp | TYPE SY-MSGTY, " 'E' | |||
| lv_t006t_exp | TYPE T006T, " | |||
| lv_no_parameter | TYPE T006T, " | |||
| lv_no_unit | TYPE T006T, " | |||
| lv_t006_exp | TYPE T006, " | |||
| lv_parid_imp | TYPE TC20-PARID, " | |||
| lv_punit_imp | TYPE TC20-UNIT, " | |||
| lv_tc20t_exp | TYPE TC20T, " | |||
| lv_wrong_dimension | TYPE TC20T, " | |||
| lv_tc20_exp | TYPE TC20, " | |||
| lv_pvalue_imp | TYPE TC20-VALUE_DEF, " | |||
| lv_wrong_parameter | TYPE TC20, " | |||
| lv_spras_imp | TYPE T002-SPRAS, " SY-LANGU | |||
| lv_wrong_unit | TYPE T002. " |
|   CALL FUNCTION 'CF_CK_PUNIT' "PRT: Check unit formula parameter |
| EXPORTING | ||
| MSGTY_IMP | = lv_msgty_imp | |
| PARID_IMP | = lv_parid_imp | |
| PUNIT_IMP | = lv_punit_imp | |
| PVALUE_IMP | = lv_pvalue_imp | |
| SPRAS_IMP | = lv_spras_imp | |
| IMPORTING | ||
| T006T_EXP | = lv_t006t_exp | |
| T006_EXP | = lv_t006_exp | |
| TC20T_EXP | = lv_tc20t_exp | |
| TC20_EXP | = lv_tc20_exp | |
| EXCEPTIONS | ||
| NO_PARAMETER = 1 | ||
| NO_UNIT = 2 | ||
| WRONG_DIMENSION = 3 | ||
| WRONG_PARAMETER = 4 | ||
| WRONG_UNIT = 5 | ||
| . " CF_CK_PUNIT | ||
ABAP code using 7.40 inline data declarations to call FM CF_CK_PUNIT
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 MSGTY FROM SY INTO @DATA(ld_msgty_imp). | ||||
| DATA(ld_msgty_imp) | = 'E'. | |||
| "SELECT single PARID FROM TC20 INTO @DATA(ld_parid_imp). | ||||
| "SELECT single UNIT FROM TC20 INTO @DATA(ld_punit_imp). | ||||
| "SELECT single VALUE_DEF FROM TC20 INTO @DATA(ld_pvalue_imp). | ||||
| "SELECT single SPRAS FROM T002 INTO @DATA(ld_spras_imp). | ||||
| DATA(ld_spras_imp) | = SY-LANGU. | |||
Search for further information about these or an SAP related objects