matinal:SAP ABAP 如何用BAPI实现MD12删除计划订单

2023-10-14 15:28:27 浏览数 (1)

直接上代码

代码语言:javascript复制
DATA:ls_return TYPE bapireturn1,
     ls_plaf   TYPE plaf.

CALL FUNCTION 'BAPI_PLANNEDORDER_DELETE'
  EXPORTING
    plannedorder = ls_plaf-plnum
*   USE_COLL_UPDATE       = ' '
*   LAST_ORDER   = ' '
  IMPORTING
    return       = ls_return.

IF ls_return-type = 'S' .

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait = 'X'.

ELSE .

  CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

ENDIF .

0 人点赞