2005 Apr 21 7:50 AM
Hi,
I am using BAPI_SALESORDER_CHANGE to change the target quantity ( ZMENG ) of the Standard sales order.
I am getting no error message in the bapi return table but the data is not getting updated in the database.
I am also calling commit work 'BAPI_transaction_Commit'. Please let me know if there is an alternative to this BAPI. I have tried BAPI_SALESDOCUMENT_CHANGE also.
thanks,
Hitanshu
2005 Apr 21 8:12 AM
Hi Himanshu,
I have a feeling that you may not be filling in all the details required. Just ckeck out if you are filling out
TARGET_QTY and TARGET_QU in the tables parameter ORDER_ITEM_INX, for the relevant item.
If your problem is still not resolved, please let us know which version of SAP you're using.
Regards,
Anand Mandalika.
2005 Apr 21 8:16 AM
Hitanshu,
You need to use as well the schedule line table and change the qty overthere. Did you use the schedule_linesx and order_item_inx to tell which fields you want to update?
Example code:
orderch_header_inx-updateflag = 'U'.
orderch_item_in-itm_number = it_vbap_old-posnr.
orderch_item_inx-itm_number = it_vbap_old-posnr.
orderch_item_inx-updateflag = 'U'.
APPEND : orderch_item_in, orderch_item_inx.
orderch_header_inx-updateflag = 'U'.
schedulech_lines-itm_number = it_vbap_old-posnr.
schedulech_lines-sched_line = '0001'.
schedulech_linesx-itm_number = it_vbap_old-posnr.
schedulech_lines-req_qty = it_vbap-kwmeng.
schedulech_linesx-sched_line = '0001'.
schedulech_linesx-req_qty = 'X'.
schedulech_linesx-updateflag = 'U'.
APPEND : schedulech_lines, schedulech_linesx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = order_number
order_header_in = orderch_header_in
order_header_inx = orderch_header_inx
SIMULATION =
BEHAVE_WHEN_ERROR = ' '
INT_NUMBER_ASSIGNMENT = ' '
LOGIC_SWITCH =
TABLES
return = return
order_item_in = orderch_item_in
order_item_inx = orderch_item_inx
PARTNERS =
partnerchanges = partnerch
PARTNERADDRESSES =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
schedule_lines = schedulech_lines
schedule_linesx = schedulech_linesx
ORDER_TEXT =
ORDER_KEYS =
CONDITIONS_IN =
CONDITIONS_INX =
EXTENSIONIN =
.