cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_SALESORDER_CHANGE to change plant and route

0 Kudos
How can I use BAPI_SALESORDER_CHANGE to change plant and route?

I am trying to change a sales contract as follows:

    l_bapisdh1x-updateflag = 'U'.

    lw_item-itm_number = wa_vbap-posnr.
    lw_item-material = wa_vbap-matnr.
    lw_item-plant = 'C071'.
    lw_item-route = 'ZFOB'.
    *lw_item-wbs_elem = ls_wbs_element_table-wbs_element.
    *lw_item-profit_ctr = l_profit_ctr.

    APPEND lw_item TO lt_item.

    lw_item_id-itm_number = wa_vbap-posnr.
    lw_item_id-updateflag = 'U'.
    lw_item_id-plant = abap_true.
    lw_item_id-route = abap_true.
    *lw_item_id-wbs_elem = abap_true.
    *lw_item_id-profit_ctr = abap_true.
    APPEND lw_item_id TO lt_item_id.


    CALL FUNCTION 'BAPI_CUSTOMERCONTRACT_CHANGE'
      EXPORTING
        salesdocument = l_vbeln
        contract_header_in = l_bapisdh1
        contract_header_inx = l_bapisdh1x
      Tables
        return = lt_return
        contract_item_in = lt_item
        contract_item_inx = lt_item_id.



Return message
W V1 555 Sales document and distribution is still incomplete -> complete

When I run a function in sequence with Commit, I can save the document, and when I check the incomplete log, the Route field is not filled.

Has anyone gone through this? How can I solve it?

Thank you.
raymond_giuseppi
Active Contributor
0 Kudos

Not since 2003, what's your version?

Accepted Solutions (0)

Answers (0)