‎2005 Feb 10 10:54 AM
Hi All,
I've a problem with the bapi BAPI_CONTRACT_CREATEFROMDATA. I try to pass item configuration data for multiple items, but when I check the created contract, the configuration is not set up correctly. The values in the configuration for item >= 20 are taken from the confuguration of item 10. In the contract_cfgs_value table the values are set correctly for the items >= 20. I also fill the tables contract_cfgs_ref, contract_cfgs_inst, contract_cfgs_refinst.
I've tried several options with different values for config_id, posex and inst_id fields in the cfg* tables, but nothing seems to work.
Thanks for your quick response!!
‎2005 Feb 10 2:07 PM
Below is some code for filling values for the create sales order bapi. I am assuming it is similar for the contract bapi. My guess is that you are missing the root_id and maybe the inst_id.
LOOP AT epordc ASSIGNING <epordc> WHERE itemno = <epordd>-itemno.
IF first_time IS INITIAL.
* ORDER_CFGS_REF
bapicucfg-posex = <epordd>-itemno.
bapicucfg-config_id = <epordd>-itemno.
bapicucfg-root_id = <epordd>-itemno.
APPEND bapicucfg.
* ORDER_CFGS_REFINST
bapicuref-posex = <epordd>-itemno.
bapicuref-config_id = <epordd>-itemno.
bapicuref-inst_id = <epordd>-itemno.
APPEND bapicuref.
* ORDER_CFGS_INST
bapicuins-config_id = <epordd>-itemno.
bapicuins-inst_id = <epordd>-itemno.
bapicuins-obj_type = 'MARA'.
bapicuins-class_type = '300'.
bapicuins-obj_key = matnr_int.
APPEND bapicuins.
first_time = 'X'.
ENDIF.
* ORDER_CFGS_VALUE
bapicuval-config_id = <epordd>-itemno.
bapicuval-inst_id = <epordd>-itemno.
bapicuval-charc = <epordc>-charname.
bapicuval-value = <epordc>-charval.
APPEND bapicuval.
ENDLOOP.
Brian
‎2005 Feb 10 4:18 PM
Thanks Brian,
It was a good push in the right direction. I had filled the root_id & inst_id, but not all with the same values. Plus I had tried passing on several tables to the bapi.
It now seems to work, but have to check with different options.
Ciao,
Sander
‎2006 Aug 08 11:32 PM
Hi All,
Can I know what type of Data that we need to pass for Configuration data like what is the OBJ_key and the rest of the values. Because I am passing all the values just like the way it has explained here and I am not able to see the data for the configuration.
Thanks
Hima