1

我调用BAPI BAPI_SALESORDER_CHANGE更新销售订单,需要在项目级别更改 edatu,BAPI 的返回是销售订单已更改但未进行任何更改。

我在调用 BAPI BAPI BAPI_SALESORDER_CHANGE后提交,但更改不会影响数据库。

 ls_header_x-updateflag = 'U'.

  assign ls_schdl to <schdl>.
  assign ls_schdlx to <schdlx>.
  assign ls_items to <items2>.
  assign ls_itemsx to <items2x>.

  <schdl>-itm_number = '000010'.
  <schdlx>-itm_number = '000010'.

  <schdl>-sched_line = '0001'.
  <schdlx>-sched_line = '0001'.

  <items2>-itm_number = '000010'.
  <items2x>-itm_number = '000010'.

  <schdlx>-itm_number = '000010'.
   <schdl>-dlv_date = '20181111'.

  append <schdl> to lt_schdl.

  <schdlx>-dlv_date = 'U'.
  <schdlx>-updateflag = 'U'.
  append <schdlx> to lt_schdlx.

  <items2x>-updateflag = 'U'.
  append <items2> to lt_items.
 append <items2x> to lt_itemsx.



*update the data

  call function 'BAPI_SALESORDER_CHANGE'

    exporting

      salesdocument    = p_vbeln

      order_header_inx = ls_header_x

    tables

      order_item_in    = lt_items
      order_item_inx   = lt_itemsx
      return           = lt_return
      schedule_lines   = lt_schdl
      schedule_linesx  = lt_schdlx.

  read table lt_return assigning <return> with key type = 'E'.

  if sy-subrc ne 0.

    call function 'BAPI_TRANSACTION_COMMIT'
      exporting
        wait   = 'X'
      importing
       return = ls_return.

  endif.
4

1 回答 1

2

您需要用“X”填写 order_item_inx 和 schedule_linesx 项目字段。忽略其他值。

于 2018-11-03T12:51:08.770 回答