Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use FM bapi_cfg_create???

Former Member
0 Kudos

Hello folks,

can anybody tell me how to use bapi bapi_cfg_create.

i want to configure material characteristic values... i have difficulties to understand this function module.. so plz help.

-Shweta

6 REPLIES 6

former_member181995
Active Contributor
0 Kudos
CALL FUNCTION 'BAPI_CFG_CREATE'
       EXPORTING
            OBJECT_ID               = OBJECT_ID                  ROOT_TYPE               = ROOT_TYPE
            ROOT_NAME               = ROOT_NAME        
            QUANTITY                = QUANTITY
            PLANT                   = PLANT
            DATE                    = L_DATE
            CFG_HEADER_TO_BE_LOADED = CFGREF
      IMPORTING
            CFG_HANDLE              = CFG_HANDLE
            ROOT_INSTANCE           = ROOT_INSTANCE
       TABLES
           INSTANCES_TO_BE_LOADED  = INSTANCES_TO_BE_LOADED
           VALUES_TO_BE_LOADED     = VALUES_TO_BE_LOADED
           PART_OF_TO_BE_LOADED    = PART_OF_TO_BE_LOADED
       EXCEPTIONS
            ERROR                   = 1
            OTHERS                  = 2.

Pass all madatory fields.

Edited by: Amit Gujargoud on Sep 8, 2008 4:20 PM

Former Member
0 Kudos

Hi Shweta,

BAPI_CFG_CREATE Starts a new configuration (root item, initializes configurator)

Check this one:

http://apolemia.blogspot.com/2005_06_01_archive.html

Regards,

Chandra Sekhar

Edited by: Chandrasekhar Gandla on Sep 10, 2008 10:04 AM

Former Member
0 Kudos

hi,

go to se 38 if you are creating a report.click on pattern and type the name of function module.following will come when you press enter.

CALL FUNCTION 'BAPI_CFG_CREATE'

EXPORTING

object_id =

  • ROOT_TYPE = 'MARA'

root_name =

  • QUANTITY = 1

  • PLANT = 0001

  • DATE = SY-DATUM

  • CFG_HEADER_TO_BE_LOADED =

  • IMPORTING

  • CFG_HANDLE =

  • ROOT_INSTANCE =

  • TABLES

  • INSTANCES_TO_BE_LOADED =

  • VALUES_TO_BE_LOADED =

  • PART_OF_TO_BE_LOADED =

  • EXCEPTIONS

  • ERROR = 1

  • OTHERS = 2.

pass all the mandatory fields which are there

Former Member
0 Kudos

thnks folks. but m still not satisfied.

My task is i want to upload configuration of product variants in mrp3 view.

my input file contain material, parent material, c/s and value. one of my frnd suggest me to use this FM bapi_cfg_create. but i m not getting what r exactly the parameters? what should i pass to this FM...

what does this fm do? is this change material or create new instance and then we

have to link that instance to material... what???

if anyone had already worked on this plz give me sapmle code.

-shweta.

Former Member
0 Kudos

Create a purchase order with configuration using the BAPI

This took some time to figure out how to setup. It may be useful.

call function 'BAPI_CFG_CREATE' exporting object_id = 'MYMATCODE' root_type = 'MARA' root_name = 'MYMATCODE' plant = 'MYPLANT' importing cfg_handle = l_handle root_instance = l_instance exceptions error = 1 others = 2.l_characts_vals-atnam = 'WIDTH'.l_characts_vals-atwtb = '500'.append l_characts_vals to it_characts_vals.

call function 'BAPI_CFGINST_CHARCS_VALS_SET' exporting object_id = 'MYMATCODE' instance = l_instance tables characts_vals = it_characts_vals characts_vals_err = it_characts_vals_err.

call function 'CE_C_SET_CBASE'....l_poitem-int_obj_no = l_handle....c

all function 'BAPI_PO_CREATE1' exporting poheader = l_poheader poheaderx = l_poheaderx importing expheader = l_expheader exppurchaseorder = l_exppurchaseorder tables poitem = lt_poitem poitemx = lt_poitemx poschedule = lt_poschedule poschedulex = lt_poschedulex return = lt_return.

call function 'BAPI_TRANSACTION_COMMIT'.Labels: code

0 Kudos

Hi Gaurav,

Can you please suggest me or send me the code on how to create a PO for a configurable material using BAPI_PO_CREATE1. I too have same requirement, what you suggested seem to be useful but i dont know how to use CE_C_SET_CBASE.

Srikanth.