SAP CFG_API_CREATE_CONFIG Function Module for Creates a configuration and assigns a configuration id
CFG_API_CREATE_CONFIG is a standard cfg api create config SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Creates a configuration and assigns a configuration id 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 cfg api create config FM, simply by entering the name CFG_API_CREATE_CONFIG into the relevant SAP transaction such as SE37 or SE38.
Function Group: COM_CFG_API_ENGINE_COMMAND
Program Name: SAPLCOM_CFG_API_ENGINE_COMMAND
Main Program: SAPLCOM_CFG_API_ENGINE_COMMAND
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled JAVA Module
Update:

Function CFG_API_CREATE_CONFIG 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 'CFG_API_CREATE_CONFIG'"Creates a configuration and assigns a configuration id.
EXPORTING
* EXT_CONFIG_ID = "External Configuration Id
* KB_VERSION = "KB Version
* KB_PROFILE = "Profile name
* KB_ID = "Internal identifier of a knowledge base
* EXT_CONFIG = "External Interface Configuration
* CONTEXT = "Configuration Context
* USE_TRACE = 'F' "Use Trace (T=True, F=False, Blank=False)
* PRODUCT_ID = "Product Id
* PRODUCT_TYPE = "Product Type
* EXT_PRODUCT_ID = "External Product Id
* EXT_PRODUCT_TYPE = "External Product Type
* EXT_PRODUCT_LOGSYS = "External Logical system
* KB_DATE = "KB validity date (YYYYMMDD)
* KB_LOGSYS = "Logical System
* KB_NAME = "KB Name
IMPORTING
CONFIG_ID = "Configuration Identifier
RETURN_CODE = "0=OK, 1=Warning, 2=Error
EXCEPTIONS
PARAMETER_EXCEPTION = 1 COMMAND_EXCEPTION = 2 EXCEPTION_CONFIG_EXISTS = 3
IMPORTING Parameters details for CFG_API_CREATE_CONFIG
EXT_CONFIG_ID - External Configuration Id
Data type: COMT_CFGM_CONFIG_IDOptional: Yes
Call by Reference: No ( called with pass by value option)
KB_VERSION - KB Version
Data type: COMT_CFGD_KBVERSIONOptional: Yes
Call by Reference: No ( called with pass by value option)
KB_PROFILE - Profile name
Data type: COMT_CFGD_PROFNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
KB_ID - Internal identifier of a knowledge base
Data type: COMT_CFGD_KBIDOptional: Yes
Call by Reference: No ( called with pass by value option)
EXT_CONFIG - External Interface Configuration
Data type: COMT_CFGM_CONFIGOptional: Yes
Call by Reference: No ( called with pass by value option)
CONTEXT - Configuration Context
Data type: COMT_CFGM_CONTEXT_IOptional: Yes
Call by Reference: No ( called with pass by value option)
USE_TRACE - Use Trace (T=True, F=False, Blank=False)
Data type: COMT_CFGM_BOOLEANDefault: 'F'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PRODUCT_ID - Product Id
Data type: COMT_CFGM_PRODUCT_IDOptional: Yes
Call by Reference: No ( called with pass by value option)
PRODUCT_TYPE - Product Type
Data type: COMT_CFGM_PRODUCT_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXT_PRODUCT_ID - External Product Id
Data type: COMT_CFGM_PRODUCT_IDOptional: Yes
Call by Reference: No ( called with pass by value option)
EXT_PRODUCT_TYPE - External Product Type
Data type: COMT_CFGM_PRODUCT_TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXT_PRODUCT_LOGSYS - External Logical system
Data type: LOGSYSOptional: Yes
Call by Reference: No ( called with pass by value option)
KB_DATE - KB validity date (YYYYMMDD)
Data type: COMT_CFGM_DATEOptional: Yes
Call by Reference: No ( called with pass by value option)
KB_LOGSYS - Logical System
Data type: COMT_CFGD_KBLOGSYSOptional: Yes
Call by Reference: No ( called with pass by value option)
KB_NAME - KB Name
Data type: COMT_CFGD_KBNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CFG_API_CREATE_CONFIG
CONFIG_ID - Configuration Identifier
Data type: COMT_CFGM_CONFIG_IDOptional: No
Call by Reference: No ( called with pass by value option)
RETURN_CODE - 0=OK, 1=Warning, 2=Error
Data type: COMT_CFGM_INTEGEROptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
PARAMETER_EXCEPTION - Problem in using an import parameter
Data type:Optional: No
Call by Reference: Yes
COMMAND_EXCEPTION - Problem in executing the configuration command
Data type:Optional: No
Call by Reference: Yes
EXCEPTION_CONFIG_EXISTS - Problem when configuration doesn't exist
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CFG_API_CREATE_CONFIG 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_config_id | TYPE COMT_CFGM_CONFIG_ID, " | |||
| lv_ext_config_id | TYPE COMT_CFGM_CONFIG_ID, " | |||
| lv_parameter_exception | TYPE COMT_CFGM_CONFIG_ID, " | |||
| lv_kb_version | TYPE COMT_CFGD_KBVERSION, " | |||
| lv_kb_profile | TYPE COMT_CFGD_PROFNAME, " | |||
| lv_kb_id | TYPE COMT_CFGD_KBID, " | |||
| lv_ext_config | TYPE COMT_CFGM_CONFIG, " | |||
| lv_context | TYPE COMT_CFGM_CONTEXT_I, " | |||
| lv_use_trace | TYPE COMT_CFGM_BOOLEAN, " 'F' | |||
| lv_product_id | TYPE COMT_CFGM_PRODUCT_ID, " | |||
| lv_return_code | TYPE COMT_CFGM_INTEGER, " | |||
| lv_command_exception | TYPE COMT_CFGM_INTEGER, " | |||
| lv_product_type | TYPE COMT_CFGM_PRODUCT_TYPE, " | |||
| lv_exception_config_exists | TYPE COMT_CFGM_PRODUCT_TYPE, " | |||
| lv_ext_product_id | TYPE COMT_CFGM_PRODUCT_ID, " | |||
| lv_ext_product_type | TYPE COMT_CFGM_PRODUCT_TYPE, " | |||
| lv_ext_product_logsys | TYPE LOGSYS, " | |||
| lv_kb_date | TYPE COMT_CFGM_DATE, " | |||
| lv_kb_logsys | TYPE COMT_CFGD_KBLOGSYS, " | |||
| lv_kb_name | TYPE COMT_CFGD_KBNAME. " |
|   CALL FUNCTION 'CFG_API_CREATE_CONFIG' "Creates a configuration and assigns a configuration id |
| EXPORTING | ||
| EXT_CONFIG_ID | = lv_ext_config_id | |
| KB_VERSION | = lv_kb_version | |
| KB_PROFILE | = lv_kb_profile | |
| KB_ID | = lv_kb_id | |
| EXT_CONFIG | = lv_ext_config | |
| CONTEXT | = lv_context | |
| USE_TRACE | = lv_use_trace | |
| PRODUCT_ID | = lv_product_id | |
| PRODUCT_TYPE | = lv_product_type | |
| EXT_PRODUCT_ID | = lv_ext_product_id | |
| EXT_PRODUCT_TYPE | = lv_ext_product_type | |
| EXT_PRODUCT_LOGSYS | = lv_ext_product_logsys | |
| KB_DATE | = lv_kb_date | |
| KB_LOGSYS | = lv_kb_logsys | |
| KB_NAME | = lv_kb_name | |
| IMPORTING | ||
| CONFIG_ID | = lv_config_id | |
| RETURN_CODE | = lv_return_code | |
| EXCEPTIONS | ||
| PARAMETER_EXCEPTION = 1 | ||
| COMMAND_EXCEPTION = 2 | ||
| EXCEPTION_CONFIG_EXISTS = 3 | ||
| . " CFG_API_CREATE_CONFIG | ||
ABAP code using 7.40 inline data declarations to call FM CFG_API_CREATE_CONFIG
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.| DATA(ld_use_trace) | = 'F'. | |||
Search for further information about these or an SAP related objects