当采购信息记录更新价格后,可以透过前台ME22N项目-->条件-->更新 来修改采购单的价格
注意:采购单部分收货、收货已完成、结案状态不可更新,更新价格后采购单可能需要重新签核
批量执行改功能则使用函数BAPI_PO_CHANGE,代码如下:
REPORT ZMMRTEST. DATA: lv_ebeln TYPE ebeln, lt_item TYPE TABLE OF bapimepoitem, ls_item TYPE bapimepoitem, lt_itemx TYPE TABLE OF bapimepoitemx, ls_itemx TYPE bapimepoitemx, lt_return TYPE TABLE OF bapiret2. lv_ebeln = '6200016316'. ls_item-po_item = '00010'. ls_item-calctype ='B'. APPEND ls_item TO lt_item. ls_itemx-po_item = '00010'. ls_itemx-calctype ='X'. APPEND ls_itemx TO lt_itemx. CALL FUNCTION 'BAPI_PO_CHANGE' EXPORTING purchaseorder = lv_ebeln TABLES return = lt_return poitem = lt_item poitemx = lt_itemx. READ TABLE lt_return WITH KEY type = 'E' TRANSPORTING NO FIELDS. IF sy-subrc = 0. ROLLBACK WORK. ELSE. COMMIT WORK AND WAIT. ENDIF. cl_demo_output=>write( lt_return ). cl_demo_output=>display( ).
效果: