SAP Function CFG_API_CREATE_CONFIG - Configuration Command: CreateConfig

Parameter Reference Type Length Default Optional Text
CONTEXT COMT_CFGM_CONTEXT_I h 150 X Configuration Context
EXT_CONFIG COMT_CFGM_CONFIG v 416 X External Interface Configuration
KB_DATE COMT_CFGM_DATE C 8 X KB validity date (YYYYMMDD)
KB_ID COMT_CFGD_KBID I 4 X Internal identifier of a knowledge base
KB_LOGSYS COMT_CFGD_KBLOGSYS C 10 X Logical System
KB_NAME COMT_CFGD_KBNAME C 50 X KB Name
KB_PROFILE COMT_CFGD_PROFNAME C 30 X Profile name
KB_VERSION COMT_CFGD_KBVERSION C 30 X KB Version
PRODUCT_ID COMT_CFGM_PRODUCT_ID C 40 X Product Id
PRODUCT_TYPE COMT_CFGM_PRODUCT_TYPE C 4 X Product Type
USE_TRACE COMT_CFGM_BOOLEAN C 1 'F' X Use Trace (T=True, F=False, Blank=False)

Parameter Reference Type Length Text
CONFIG_ID COMT_CFGM_CONFIG_ID g 8 Configuration Identifier
RETURN_CODE COMT_CFGM_INTEGER I 4 0=OK, 1=Warning, 2=Error

Exception Text
COMMAND_EXCEPTION Problem in executing the configuration command
PARAMETER_EXCEPTION Problem in using an import parameter

Functionality
The function module creates a configuration and returns a correspondentCONFIG_ID. It is usually the first call in a configuration session.Multiple tuple from its input parameters are valid to create aconfiguration, while unsupported tuple will result in a thrownCOMMAND_EXCEPTION.
Supported tuples have paramaters describing the product and theknowledgebase (kb), therefore valid are:
1. ,,
,,PRODUCT_ID + optional PRODUCT_TYPE and KB_ID +optional KB_PROFILE
,,If a KB_ID is given the according kb is used. If this is not thecase, the other kb search parameter are used.
2.,,
,,PRODUCT_ID + optional PRODUCT_TYPE and KB_NAME +KB_VERSION + optional KB_LOGSYS + optional KB_PROFILE

,,If a kb is found using KB_NAME, KB_VERSION andKB_LOGSYS the other kb search parameters are ignored.
,,If no suitable kb was found the other kb search parameters are used.
,,Using only KB_NAME and KB_VERSION is a depracated way ofdeterminig the kb.
3. ,,
,,PRODUCT_ID+ optional PRODUCT_TYPE and KB_DATE + KB_LOGSYS
,,In this case the most recent kb (with the greatest fromDate KB_DATE )is determined, other parameters are ,,ignored.
Additionally the KB_CONTEXT parameter can be used to enable theconfigurator the use of reference characteristics which are not coveredby the standard by passing tuples of fieldnames and the accordingvalues.
Alternatively a external representation of a configuration, a kind ofsnapshot of a configuration, can be passed via the EXT_CONFIGparameter. You can get this snapshot via the CFG_API_GET_EXT_CONFIGfunction module, persist it and restore it afterwards that way.

  • PRODUCT_TYPE should be used if PRODUCT_ID is ambigous
  • (when multile products with different product types use the samePRODUCT_ID)
    • KB_DATE expects the YYYYMMDD pattern.

    • Additional info regarding reference characteristics can be found at
    • help.sap.com
      • If the PRODUCT_TYPE is not provided it will be defaulted to MARA
      • (Material)

        Further information
        Take a look at the function module CFG_API_GET_EXT_CONFIG to learn howto get the external represantation of a configuration.