Using BAPI_SALESORDER_CREATEFROMDAT2 for variant material

Question: I'm trying to get the BAPI_SALESORDER_CREATEFROMDAT2 to work with variant config materials. I have no problem with non-variant materials. There are a number of structures that are included with the bapi that support variant config. However, I've tried a hundred times and can't figure out how to populate them. Has anyone had success here?

What is object key where I can find it in SAP.

Answer:
we are having the same problem,,, did you find an answer?

Answer:
Hi,

this is a how we use the bapi in our system !!!
good luck

SSII


     
      ...
     
      T_CFGVAL-INST_ID   = T_ITEM-ITM_NUMBER.
      T_CFGVAL-CONFIG_ID = T_ITEM-ITM_NUMBER.
      T_CFGVAL-CHARC = CABN-ATNAM.
      T_CFGVAL-VALUE = ZTSDSQTCAR2-ATWRT.

      ...

      T_CFGREF-POSEX = T_ITEM-ITM_NUMBER.
      T_CFGREF-CONFIG_ID = T_ITEM-ITM_NUMBER.
      T_CFGREF-ROOT_ID = T_ITEM-ITM_NUMBER.

      ...

      T_CFGINS-CONFIG_ID  = T_ITEM-ITM_NUMBER.
      T_CFGINS-INST_ID    =  T_ITEM-ITM_NUMBER.
      T_CFGINS-OBJ_TYPE   = 'MARA'.
      T_CFGINS-CLASS_TYPE = '300'.
      T_CFGINS-OBJ_KEY    = T_ITEM-MATERIAL.
      T_CFGINS-QUANTITY   = T_ITEM-TARGET_QTY.

      ...
     
      CALL FUNCTION 'CUXC_INIT'.

      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
           EXPORTING
                ORDER_HEADER_IN     = R_HEADER
                TESTRUN             = P_SIMUL
           IMPORTING
                SALESDOCUMENT_EX    = W_NEWCDE
           TABLES
                RETURN              = T_RETURN2
                ORDER_ITEMS_IN      = T_ITEM
                ORDER_PARTNERS      = T_PART
                ORDER_SCHEDULES_IN  = T_ECHE
                ORDER_CONDITIONS_IN = T_COND
                ORDER_CFGS_REF      = T_CFGREF
                ORDER_CFGS_INST     = T_CFGINS
                ORDER_CFGS_PART_OF  = T_CFGPAR
                ORDER_CFGS_VALUE    = T_CFGVAL.

      ...



Answer:
Hi.

We are having the same problem. The issue does not seem to be the BAPI itself. All the BAPI does is export the configuration data to memory and perform no further processing.

It appears that a subsequent function module call is required. This would import the data from memory and assign it to the relevant sales order line item. But, which function module should be used here??????

Anthony
Copyright ?2007 - 2008 www.jt77.com