SAP CMO_COUNT_JOB Function Module for CMO: Counts planned jobs per program
CMO_COUNT_JOB is a standard cmo count job SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for CMO: Counts planned jobs per program 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 cmo count job FM, simply by entering the name CMO_COUNT_JOB into the relevant SAP transaction such as SE37 or SE38.
Function Group: CMON
Program Name: SAPLCMON
Main Program: SAPLCMON
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function CMO_COUNT_JOB 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 'CMO_COUNT_JOB'"CMO: Counts planned jobs per program.
EXPORTING
* IV_START_DATE = "Startdate - initial means complete last week
* IV_END_DATE = "Enddate - initial means complete last week
IMPORTING
EV_START_DATE = "Evaluated start date
EV_END_DATE = "Evaluated end date
TABLES
* ET_COUNTJOB = "CMO: Counts Jobs per Programm
EXCEPTIONS
DATE_ERROR = 1
IMPORTING Parameters details for CMO_COUNT_JOB
IV_START_DATE - Startdate - initial means complete last week
Data type: SY-DATUMOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_END_DATE - Enddate - initial means complete last week
Data type: SY-DATUMOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CMO_COUNT_JOB
EV_START_DATE - Evaluated start date
Data type: SY-DATUMOptional: No
Call by Reference: No ( called with pass by value option)
EV_END_DATE - Evaluated end date
Data type: SY-DATUMOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CMO_COUNT_JOB
ET_COUNTJOB - CMO: Counts Jobs per Programm
Data type: CMOCNTJOBOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
DATE_ERROR - Error in start date, end date
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CMO_COUNT_JOB 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_date_error | TYPE STRING, " | |||
| lt_et_countjob | TYPE STANDARD TABLE OF CMOCNTJOB, " | |||
| lv_ev_start_date | TYPE SY-DATUM, " | |||
| lv_iv_start_date | TYPE SY-DATUM, " | |||
| lv_ev_end_date | TYPE SY-DATUM, " | |||
| lv_iv_end_date | TYPE SY-DATUM. " |
|   CALL FUNCTION 'CMO_COUNT_JOB' "CMO: Counts planned jobs per program |
| EXPORTING | ||
| IV_START_DATE | = lv_iv_start_date | |
| IV_END_DATE | = lv_iv_end_date | |
| IMPORTING | ||
| EV_START_DATE | = lv_ev_start_date | |
| EV_END_DATE | = lv_ev_end_date | |
| TABLES | ||
| ET_COUNTJOB | = lt_et_countjob | |
| EXCEPTIONS | ||
| DATE_ERROR = 1 | ||
| . " CMO_COUNT_JOB | ||
ABAP code using 7.40 inline data declarations to call FM CMO_COUNT_JOB
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 DATUM FROM SY INTO @DATA(ld_ev_start_date). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_iv_start_date). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_ev_end_date). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_iv_end_date). | ||||
Search for further information about these or an SAP related objects