Skip to Content
author's profile photo Former Member
Former Member

How to Update Variant Configurator from BAPI

I've seen several posts about creating Variant Configurator in a Sales Order, but not Updating the values.

Code I am using:

TYPES: BEGIN of Typ_cuvals.

INCLUDE STRUCTURE BAPICUVALM.

TYPES: END of Typ_cuvals.

FIELD-SYMBOLS:

<fs_cuvals> TYPE typ_cuvals.

... more table definitions here - did not include

call function 'BAPISDORDER_GETDETAILEDLIST'

exporting

i_bapi_view = orderview

tables

sales_documents = h_vbeln

order_headers_out = t_sdhd

order_items_out = t_sdit

order_schedules_out = t_sdhedu

order_business_out = t_sdbusi

order_partners_out = t_sdpart

ORDER_CFGS_CUREFS_OUT = t_curefs

ORDER_CFGS_CUCFGS_OUT = t_cucfgs

ORDER_CFGS_CUINS_OUT = t_cuins

ORDER_CFGS_CUPRTS_OUT = t_cuprts

ORDER_CFGS_CUVALS_OUT = t_cuvals

ORDER_CFGS_CUBLBS_OUT = t_cublbs

ORDER_CFGS_CUVKS_OUT = t_cuvks.

loop at t_cuvals assigning <fs_cuvals>.

  • change some configuration values here ...

endloop.

call function 'BAPI_SALESORDER_CHANGE'

exporting

SALESDOCUMENT = w_vbeln

ORDER_HEADER_INX = wa_order_header_inx

tables

RETURN = t_bapiret2

ORDER_CFGS_CUREFS_OUT = t_curefs

ORDER_CFGS_CUCFGS_OUT = t_cucfgs

ORDER_CFGS_CUINS_OUT = t_cuins

ORDER_CFGS_CUPRTS_OUT = t_cuprts

ORDER_CFGS_CUVALS_OUT = t_cuvals

ORDER_CFGS_CUBLBS_OUT = t_cublbs

ORDER_CFGS_CUVKS_OUT = t_cuvks.

CALL function 'BAPI_TRANSACTION_COMMIT'

importing return = t_bapiret2.

I verified the table t_cuvals has been updated with the new values.

After the call to 'BAPI_SALESORDER_CHANGE', t_bapiret2 has 2 messages.. 1) Order Header Processed 2) No Data was changed.

What am I missing? Thanks in advance for your help!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2006 at 12:28 PM

    That would be interesting for me too!

    I found out that in the itemX table there is the config_id and inst_id too.

    But if i flag these two fields in the itemx table,

    the bapi_salesorder_change will run, but not change

    the characteristic values.

    Maybe because the sales order is still incomplete in my test case but anyway, it's possible to change schedule line data.

    So maybe the itemx-config_id + inst_id is just a hint.

    The issue is still open for me

    Thomas

    PS: If I have to create a new item incl. configuration, I can't use BAPISDORDER_GETDETAILEDLIST

    for defaulting the cfg-tables for BAPI_SALESORDER_CREATEFROMDAT2. So what should i use in this case?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks for the info -- I did rerun and flagged these fields, but looks like still nothing happens with the Config Data.

      I've debugged thru the SAP BAPI code, and I can see it write the Config Values to Memory using the FM CUXC_IDOC_TO_MEMORY, but it doesn't look like it does anything with it once that is done!

      Any other ideas would be appreciated!

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2006 at 04:42 AM

    check these in ur code:

    FU BAPI_SALESORDER_CHANGE
    ____________________________________________________
    Text
    Sales order: Change Sales Order
    
    Functionality
    You can use this method to change or delete sales orders.
    
    You can change header, item, schedule line and configuration data.
    
    In general, note that you should:
    
    Only specify fields that should be changed
    Select these fields by entering an X in the checkboxes
    Enter a U in the UPDATEFLAG field
    Always specify key fields when changing the data, including in the checkboxes
    The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
    Maintain quantities and dates in the schedule line data
    Possible UPDATEFLAGS:
    U = change
    D = delete
    I = add

    regards

    Prabhu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2006 at 05:54 PM

    What I'm unable to resolve is determining how to set the flag in the function module that the Configuration Values need to be updated.

    The export parameter ORDER_HEADER_INX contains value 'U' and looks like it has flags to tell the function to which data to update. However, there aren't any flags for configuration, or, if there are, I'm unable to determine what they are.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2006 at 08:12 PM

    I found the answer in OSS Note 549563. My update works now.

    - The connection between sales order item and configuration (BAPICUFG-POSEX)must be defined via field POSEX (PO_ITM_NO) (ORDER_ITEMS_IN-PO_ITM_NO = ORDER_CFGS_REF-POSEX). If the item number is, for example, '000010', fill ORDER_ITEMS_IN-PO_ITM_NO = '000010' and ORDER_ITEM_INX-PO_ITM_NO = 'X' so that the configuration is called.

    - Configuration tables CFGS_REF, CFGS_INST, CFGS_PART_OF and CFGS_VALUEmust be filledduring the creation and change that is, the complete configuration data of the item to be changed must be specified.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.