SAP MC_CREATE_UTILITY_MCO Function Module for









MC_CREATE_UTILITY_MCO is a standard mc create utility mco SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 mc create utility mco FM, simply by entering the name MC_CREATE_UTILITY_MCO into the relevant SAP transaction such as SE37 or SE38.

Function Group: SMC0
Program Name: SAPLSMC0
Main Program:
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function MC_CREATE_UTILITY_MCO 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 'MC_CREATE_UTILITY_MCO'"
EXPORTING
MCONAME = "Name of an MCO

EXCEPTIONS
ERROR_FUNCTION_CR = 1 MCO_MISSING_FIELD_DESC = 10 MCO_NOT_ACTIVE = 11 MCO_NOT_FOUND = 12 MCO_NO_FOREIGN_KEY_FIELD = 13 MCO_NO_LANG_FIELD = 14 MCO_NO_MCID = 15 TOO_MANY_FUNCTIONS = 16 INVALID_PHYSICAL_POOL = 17 ERROR_FUNCTION_DELETE = 18 NO_FUNCTION_GENERATED = 19 ERROR_MCO_DEFINITION = 2 FUNCTION_ALREADY_EXISTS = 3 GLOBAL_DATA_FREE = 4 GLOBAL_DATA_LOCK = 5 GLOBAL_DATA_LOCK_ERR = 6 INVALID_FUNCTION_POOL = 7 MCO_DEF_ERROR = 8 MCO_INTERNAL_ERROR = 9
.



IMPORTING Parameters details for MC_CREATE_UTILITY_MCO

MCONAME - Name of an MCO

Data type: DD20L-MCONAME
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

ERROR_FUNCTION_CR - Error generating the function module

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MCO_MISSING_FIELD_DESC - Field description for an MCO field missing in DD

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MCO_NOT_ACTIVE - MC object not active

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MCO_NOT_FOUND - MC object does not exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MCO_NO_FOREIGN_KEY_FIELD - Foreign key fields for foreign key missing

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MCO_NO_LANG_FIELD - Text table without language key

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MCO_NO_MCID - No MC IDs found

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

TOO_MANY_FUNCTIONS - No further function modules can be generated

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INVALID_PHYSICAL_POOL -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ERROR_FUNCTION_DELETE - Error when deleting a function module

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_FUNCTION_GENERATED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ERROR_MCO_DEFINITION - Error in the definition of the MCO

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

FUNCTION_ALREADY_EXISTS -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

GLOBAL_DATA_FREE - Release error in the global data of the function group

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

GLOBAL_DATA_LOCK - Other user locks global data of function group

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

GLOBAL_DATA_LOCK_ERR - Error when locking the global data

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INVALID_FUNCTION_POOL - Function groups SnMC (n=0,1...,9) not created

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MCO_DEF_ERROR - Natchcode object not correctly defined

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MCO_INTERNAL_ERROR - Error in MC_ELAB_DESCR_MCO - in a module

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for MC_CREATE_UTILITY_MCO 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_mconame  TYPE DD20L-MCONAME, "   
lv_error_function_cr  TYPE DD20L, "   
lv_mco_missing_field_desc  TYPE DD20L, "   
lv_mco_not_active  TYPE DD20L, "   
lv_mco_not_found  TYPE DD20L, "   
lv_mco_no_foreign_key_field  TYPE DD20L, "   
lv_mco_no_lang_field  TYPE DD20L, "   
lv_mco_no_mcid  TYPE DD20L, "   
lv_too_many_functions  TYPE DD20L, "   
lv_invalid_physical_pool  TYPE DD20L, "   
lv_error_function_delete  TYPE DD20L, "   
lv_no_function_generated  TYPE DD20L, "   
lv_error_mco_definition  TYPE DD20L, "   
lv_function_already_exists  TYPE DD20L, "   
lv_global_data_free  TYPE DD20L, "   
lv_global_data_lock  TYPE DD20L, "   
lv_global_data_lock_err  TYPE DD20L, "   
lv_invalid_function_pool  TYPE DD20L, "   
lv_mco_def_error  TYPE DD20L, "   
lv_mco_internal_error  TYPE DD20L. "   

  CALL FUNCTION 'MC_CREATE_UTILITY_MCO'  "
    EXPORTING
         MCONAME = lv_mconame
    EXCEPTIONS
        ERROR_FUNCTION_CR = 1
        MCO_MISSING_FIELD_DESC = 10
        MCO_NOT_ACTIVE = 11
        MCO_NOT_FOUND = 12
        MCO_NO_FOREIGN_KEY_FIELD = 13
        MCO_NO_LANG_FIELD = 14
        MCO_NO_MCID = 15
        TOO_MANY_FUNCTIONS = 16
        INVALID_PHYSICAL_POOL = 17
        ERROR_FUNCTION_DELETE = 18
        NO_FUNCTION_GENERATED = 19
        ERROR_MCO_DEFINITION = 2
        FUNCTION_ALREADY_EXISTS = 3
        GLOBAL_DATA_FREE = 4
        GLOBAL_DATA_LOCK = 5
        GLOBAL_DATA_LOCK_ERR = 6
        INVALID_FUNCTION_POOL = 7
        MCO_DEF_ERROR = 8
        MCO_INTERNAL_ERROR = 9
. " MC_CREATE_UTILITY_MCO




ABAP code using 7.40 inline data declarations to call FM MC_CREATE_UTILITY_MCO

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 MCONAME FROM DD20L INTO @DATA(ld_mconame).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!