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: 

BAPI_SALESORDER_CREATEFROMDAT2 - How to pass Variant Configurator Values?

Former Member
0 Kudos

Hello all,

We are using the bapi BAPI_SALESORDER_CREATEFROMDAT2 to create sales orders. Everything is working except the variant configuration. The VC values are not getting updated. How can we pass values through this bapi to the VC?

I tried using the structure BAPICUVAL and passed the values as below. But nothing happens.

wa_order_cfgs_value-config_id = '000001'.

wa_order_cfgs_value-inst_id = '00000001'.

wa_order_cfgs_value-charc = 'Z_TRADE_NAME'.

wa_order_cfgs_value-value = '0000000302'.

APPEND wa_order_cfgs_value TO i_order_cfgs_value.

Can someone guide?

Thanks and Regards,

Reena

4 REPLIES 4

Former Member
0 Kudos

No OSS account?

bapicucfg and bapicuins are also needed...

bapicucfg-posex = VBAP-POSNR

bapicucfg-config_id =VBAP-POSNR

bapicucfg-root_id = '00000001'.

append bapicucfg

bapicuins-config_id = bapicucfg-config_id.

bapicuins-inst_id = bapicucfg-root_id.

bapicuins-obj_type = 'MARA'.

bapicuins-class_type = '300'.

bapicuins-obj_key = VBAP-MATNR

append bapicuins

and then

bapicuval-charc = CABN-ATNAM.

bapicuval-value =

APPEND bapicuval

Also check OSS 549563, 567348 and 562124

Cheers

carsten

0 Kudos

Hi Carsten,

Thanks a lot for the information. Ill implement it and get back with the result.

Regards,

Reena

0 Kudos

Hi Carsten,

What do you mean by bapicuval-value = ?

Where can I get the value of ATERT from?

Now I am passing the following values:

wa_order_cfgs_ref-posex = '00010'.

wa_order_cfgs_ref-config_id = '00010'.

wa_order_cfgs_ref-root_id = '00000001'.

APPEND wa_order_cfgs_ref TO i_order_cfgs_ref.

wa_order_cfgs_inst-config_id = '00010'.

wa_order_cfgs_inst-inst_id = '00000001'.

wa_order_cfgs_inst-obj_type = 'MARA'.

wa_order_cfgs_inst-class_type = '300'.

wa_order_cfgs_inst-obj_key = it_order_items-material.

APPEND wa_order_cfgs_inst TO i_order_cfgs_inst.

wa_order_cfgs_value-config_id = '00010'.

wa_order_cfgs_value-inst_id = '00000001'.

wa_order_cfgs_value-charc = 'Z_TRADE_NAME'.

wa_order_cfgs_value-value = '0000000302'.

APPEND wa_order_cfgs_value TO i_order_cfgs_value.

But the BAPI returns the following error:

<b>SALES_HEADER_IN has been processed successfully

Internal error: , 000010, CFG_IS_INCONSISTENT_OR_INCOMPLETE,

Error in SALES_ITEM_IN 000010

Condition ZPR0 is not allowed as header condition</b>

Thanks and Regards,

Reena

0 Kudos

Hello,

I managed to remove the above error by making ORDER_ITEMS_IN-PO_ITM_NO = ORDER_CFGS_REF-POSEX.

However, now I get this error:

<b>SALES_HEADER_IN has been processed successfully

Input error with char. Z_TRADE_NAME, value 000000000302; cause: VALUE_NOT_FOUND

Error in SALES_ITEM_IN 000010

Sales document was not changed</b>

Can someone point out where I can get the <b>'order_cfgs_value-value' </b> from ?

Thanks and Regards,

Reena