SAP CMOA_CHECK_WORKCENTER Function Module for Check Work Center
CMOA_CHECK_WORKCENTER is a standard cmoa check workcenter SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Check Work Center 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 cmoa check workcenter FM, simply by entering the name CMOA_CHECK_WORKCENTER into the relevant SAP transaction such as SE37 or SE38.
Function Group: CMOA
Program Name: SAPLCMOA
Main Program: SAPLCMOA
Appliation area: I
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CMOA_CHECK_WORKCENTER 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 'CMOA_CHECK_WORKCENTER'"Check Work Center.
EXPORTING
* I_GEWRK = "Object ID of the Work Center
* I_VAPLZ = "Main work center for maintenance tasks
* I_VAWRK = "Plant associated with main work center
* I_IWERK = "Maintenance Planning Plant
* I_PLNTY = "Task List Type
* I_DATE = SY-DATLO "ABAP System Field: Local Date of Current User
* I_NO_KOKRS_CHECK = "
IMPORTING
E_GEWRK = "Object ID of the Work Center
E_VAPLZ = "Main work center for maintenance tasks
E_VAWRK = "Plant associated with main work center
E_VATXT = "Short Text for Work Center
E_PM_OBJTY = "Object Type of CIM Resources for Work Center
E_KOKRS = "Controlling Area
E_KOSTL = "Cost Center
EXCEPTIONS
NO_WORKCENTER = 1 NO_PLANT = 2 WORKCENTER_NOT_FOUND = 3 PLNTY_NOT_ALLOWED = 4 KOKRS_DIFF = 5 DELETED_AND_LOCKED = 6 DELETED = 7 LOCKED = 8
IMPORTING Parameters details for CMOA_CHECK_WORKCENTER
I_GEWRK - Object ID of the Work Center
Data type: CAUFVD-GEWRKOptional: Yes
Call by Reference: Yes
I_VAPLZ - Main work center for maintenance tasks
Data type: CAUFVD-VAPLZOptional: Yes
Call by Reference: Yes
I_VAWRK - Plant associated with main work center
Data type: CAUFVD-VAWRKOptional: Yes
Call by Reference: Yes
I_IWERK - Maintenance Planning Plant
Data type: CAUFVD-IWERKOptional: Yes
Call by Reference: Yes
I_PLNTY - Task List Type
Data type: CAUFVD-PLNTYOptional: Yes
Call by Reference: Yes
I_DATE - ABAP System Field: Local Date of Current User
Data type: SY-DATLODefault: SY-DATLO
Optional: Yes
Call by Reference: Yes
I_NO_KOKRS_CHECK -
Data type:Optional: Yes
Call by Reference: Yes
EXPORTING Parameters details for CMOA_CHECK_WORKCENTER
E_GEWRK - Object ID of the Work Center
Data type: CAUFVD-GEWRKOptional: No
Call by Reference: Yes
E_VAPLZ - Main work center for maintenance tasks
Data type: CAUFVD-VAPLZOptional: No
Call by Reference: Yes
E_VAWRK - Plant associated with main work center
Data type: CAUFVD-VAWRKOptional: No
Call by Reference: Yes
E_VATXT - Short Text for Work Center
Data type: CAUFVD-VATXTOptional: No
Call by Reference: Yes
E_PM_OBJTY - Object Type of CIM Resources for Work Center
Data type: CAUFVD-PM_OBJTYOptional: No
Call by Reference: Yes
E_KOKRS - Controlling Area
Data type: AFVGD-KOKRSOptional: No
Call by Reference: Yes
E_KOSTL - Cost Center
Data type: AFVGD-KOSTLOptional: No
Call by Reference: Yes
EXCEPTIONS details
NO_WORKCENTER -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_PLANT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WORKCENTER_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
PLNTY_NOT_ALLOWED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
KOKRS_DIFF -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DELETED_AND_LOCKED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DELETED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LOCKED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CMOA_CHECK_WORKCENTER 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_e_gewrk | TYPE CAUFVD-GEWRK, " | |||
| lv_i_gewrk | TYPE CAUFVD-GEWRK, " | |||
| lv_no_workcenter | TYPE CAUFVD, " | |||
| lv_e_vaplz | TYPE CAUFVD-VAPLZ, " | |||
| lv_i_vaplz | TYPE CAUFVD-VAPLZ, " | |||
| lv_no_plant | TYPE CAUFVD, " | |||
| lv_e_vawrk | TYPE CAUFVD-VAWRK, " | |||
| lv_i_vawrk | TYPE CAUFVD-VAWRK, " | |||
| lv_workcenter_not_found | TYPE CAUFVD, " | |||
| lv_e_vatxt | TYPE CAUFVD-VATXT, " | |||
| lv_i_iwerk | TYPE CAUFVD-IWERK, " | |||
| lv_plnty_not_allowed | TYPE CAUFVD, " | |||
| lv_i_plnty | TYPE CAUFVD-PLNTY, " | |||
| lv_e_pm_objty | TYPE CAUFVD-PM_OBJTY, " | |||
| lv_kokrs_diff | TYPE CAUFVD, " | |||
| lv_i_date | TYPE SY-DATLO, " SY-DATLO | |||
| lv_e_kokrs | TYPE AFVGD-KOKRS, " | |||
| lv_deleted_and_locked | TYPE AFVGD, " | |||
| lv_deleted | TYPE AFVGD, " | |||
| lv_e_kostl | TYPE AFVGD-KOSTL, " | |||
| lv_i_no_kokrs_check | TYPE AFVGD, " | |||
| lv_locked | TYPE AFVGD. " |
|   CALL FUNCTION 'CMOA_CHECK_WORKCENTER' "Check Work Center |
| EXPORTING | ||
| I_GEWRK | = lv_i_gewrk | |
| I_VAPLZ | = lv_i_vaplz | |
| I_VAWRK | = lv_i_vawrk | |
| I_IWERK | = lv_i_iwerk | |
| I_PLNTY | = lv_i_plnty | |
| I_DATE | = lv_i_date | |
| I_NO_KOKRS_CHECK | = lv_i_no_kokrs_check | |
| IMPORTING | ||
| E_GEWRK | = lv_e_gewrk | |
| E_VAPLZ | = lv_e_vaplz | |
| E_VAWRK | = lv_e_vawrk | |
| E_VATXT | = lv_e_vatxt | |
| E_PM_OBJTY | = lv_e_pm_objty | |
| E_KOKRS | = lv_e_kokrs | |
| E_KOSTL | = lv_e_kostl | |
| EXCEPTIONS | ||
| NO_WORKCENTER = 1 | ||
| NO_PLANT = 2 | ||
| WORKCENTER_NOT_FOUND = 3 | ||
| PLNTY_NOT_ALLOWED = 4 | ||
| KOKRS_DIFF = 5 | ||
| DELETED_AND_LOCKED = 6 | ||
| DELETED = 7 | ||
| LOCKED = 8 | ||
| . " CMOA_CHECK_WORKCENTER | ||
ABAP code using 7.40 inline data declarations to call FM CMOA_CHECK_WORKCENTER
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 GEWRK FROM CAUFVD INTO @DATA(ld_e_gewrk). | ||||
| "SELECT single GEWRK FROM CAUFVD INTO @DATA(ld_i_gewrk). | ||||
| "SELECT single VAPLZ FROM CAUFVD INTO @DATA(ld_e_vaplz). | ||||
| "SELECT single VAPLZ FROM CAUFVD INTO @DATA(ld_i_vaplz). | ||||
| "SELECT single VAWRK FROM CAUFVD INTO @DATA(ld_e_vawrk). | ||||
| "SELECT single VAWRK FROM CAUFVD INTO @DATA(ld_i_vawrk). | ||||
| "SELECT single VATXT FROM CAUFVD INTO @DATA(ld_e_vatxt). | ||||
| "SELECT single IWERK FROM CAUFVD INTO @DATA(ld_i_iwerk). | ||||
| "SELECT single PLNTY FROM CAUFVD INTO @DATA(ld_i_plnty). | ||||
| "SELECT single PM_OBJTY FROM CAUFVD INTO @DATA(ld_e_pm_objty). | ||||
| "SELECT single DATLO FROM SY INTO @DATA(ld_i_date). | ||||
| DATA(ld_i_date) | = SY-DATLO. | |||
| "SELECT single KOKRS FROM AFVGD INTO @DATA(ld_e_kokrs). | ||||
| "SELECT single KOSTL FROM AFVGD INTO @DATA(ld_e_kostl). | ||||
Search for further information about these or an SAP related objects