Application Development and Automation 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: 
Read only

Variant Config in BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Likes
1,425

Hi,

We are creating sales order using the BAPI_SALESORDER_CREATEFROMDAT2 FM but we also want to update variant configuration values in those sales orders. I'm not sure of the internal tables to be passed and fields in those internal tables to be filled.

Sure many would have done this before... can any one show some light on this???

Regards,

PB

Hi,

We are creating sales order using the BAPI_SALESORDER_CREATEFROMDAT2 FM but we also want to update variant configuration values in those sales orders. I'm not sure of the internal tables to be passed and fields in those internal tables to be filled.

Sure many would have done this before... can any one show some light on this???

Regards,

PB

7 REPLIES 7
Read only

amit_khare
Active Contributor
0 Likes
1,055

Hi,

For the fields in internal table you can always check in SE37 click on IMPORT/EXPORT/CHANGING/TABLE tabs and double click on the associated type to check the values there.

You may also refer to this program - MWWMJF32

Regards,

Amit

Reward all helpful replies.

Read only

Former Member
0 Likes
1,055

use ORDER_CFGS_VALUE this table parameter to pass characteristics name & values.

create an internal table with this type & pass the values to the parameter.

Read only

0 Likes
1,055

MWWMJF32 doesn't seems to handle config values.. it's just passing empty IT to the bapi...

and kalpana, I don think just order_cfgs_value is enough.. coz I already tried that..

Correct me if i'm wrong...

Regards,

PB

Read only

0 Likes
1,055

Its not passing blank values, its an include, check the program where it is called and how the values are passed to it.

You can even take help from the documentation available in SE37, its good.

Regards,

Amit

Reward all helpful replies.

Read only

0 Likes
1,055

Thanks Amit, I'll check it out.

Regards,

PB

PS : I don't forget to give rewards once if the problem is solved.

Read only

0 Likes
1,055

ORDER_CFGS_VALUE is not enough, you have to pass different internal tables like

ORDER_CFGS_REF, ORDER_CFGS_INST, ORDER_CFGS_VALUE.

Read only

Former Member
0 Likes
1,055

I solved this problem using the fm CUXI_GET_MULTI_CONFIGURATION before the call of BAPI.

This is a short example:

loop at lt_vbap into ls_vbap

     where pstyv = 'ZTAC'. "Configurable item

  da_appl-posnr     = ls_vbap-posnr.

  da_appl-cuobj     = ls_vbap-cuobj.

  append da_appl to da_appl_t.

endloop.

call function 'CUXI_GET_MULTI_CONFIGURATION'

       exporting

         it_appl_instances = da_appl_t

         iv_idoc_format    = 'X'

       importing

         et_return         = da_return

       tables

         et_reference      = curef

         e_tab_cfg_headers = cucfg

         e_tab_instances   = cuins

         e_tab_part_of     = cuprt

         e_tab_values      = cuval

         e_tab_var_keys    = cuvk

         e_tab_blob        = cublb

       exceptions

         invalid_instance  = 1

         no_root_instance  = 2

         internal_error    = 4

         invalid_data      = 5

         others            = 6.

Then, do move-corresponding from these tables to BAPI ones and also remember to fill the po_itm_no = ls_vbap-posnr in the order_items_in table only for configurable items.

Regards,

RG