直接上代码
代码语言: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 .