BAPI修改VL02N的出库日付
时间: 2023-10-10 20:15:55 浏览: 102
VL02N 发货过账
5星 · 资源好评率100%
要使用BAPI修改VL02N的出库日期,您可以使用BAPI_GOODSMVT_CHANGE BAPI。以下是一个示例代码片段,演示如何使用该BAPI来修改VL02N的出库日期:
```abap
DATA: lt_item TYPE TABLE OF bapi2017_gm_item_edit,
ls_item TYPE bapi2017_gm_item_edit,
lt_return TYPE TABLE OF bapiret2,
lv_material TYPE matnr VALUE 'MATERIAL_NUMBER'.
* 填写需要更新的过账数据
ls_item-material = lv_material.
ls_item-plant = 'PLANT_CODE'.
ls_item-move_type = 'MOVEMENT_TYPE'.
ls_item-entry_qnt = 'QUANTITY'.
ls_item-entry_uom = 'UNIT_OF_MEASURE'.
ls_item-move_reas = 'MOVEMENT_REASON'.
ls_item-xabdnet = 'X'.
ls_item-abdat = 'DATE_VALUE'.
* 将更新信息添加到表中
APPEND ls_item TO lt_item.
* 调用BAPI进行修改
CALL FUNCTION 'BAPI_GOODSMVT_CHANGE'
EXPORTING
goodsmvt_headret = lt_headret
TABLES
goodsmvt_itemedit = lt_item
return = lt_return.
* 检查修改结果
IF sy-subrc = 0.
WRITE 'Goods movement changed successfully.'.
ELSE.
WRITE 'Failed to change goods movement.'.
ENDIF.
```
请将代码中的MATERIAL_NUMBER替换为实际的物料号码,PLANT_CODE替换为实际的工厂代码,MOVEMENT_TYPE替换为实际的过账类型,QUANTITY替换为实际的数量,UNIT_OF_MEASURE替换为实际的计量单位,MOVEMENT_REASON替换为实际的过账原因,DATE_VALUE替换为要更新的出库日期。请注意,您需要具有适当的权限才能调用和修改该BAPI。
阅读全文