on 01-31-2019 1:37 AM
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.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.