Code: Alles auswählen.
DATA: HEADERDATA_DET LIKE BAPIPLAF_E1,
RET_DETAIL LIKE BAPIRETURN1,
PLANNEDORDER TYPE BAPI_PLDORD-PLDORD_NUM,
HEADERDATA tYPE BAPIPLAF_I2,
HEADERDATAX TYPE BAPIPLAF_I2X,
RET_CHANGE LIKE BAPIRETURN1,
CHANGEDHEADERDATA LIKE BAPIPLAF_E1.
PARAMETERS:
plnum TYPE plnum,
date type d.
" getting details to plannedorder
plannedorder = plnum.
CALL FUNCTION 'BAPI_PLANNEDORDER_GET_DETAIL'
EXPORTING
PLANNEDORDER = plannedorder
IMPORTING
RETURN = RET_DETAIL
HEADERDATA = HEADERDATA_DET.
" changing plannedorder
MOVE-CORRESPONDING headerdata_det to headerdata.
HEADERDATA-ORDER_START_DATE = date.
headerdataX-ORDER_START_DATE = 'X'.
CALL FUNCTION 'BAPI_PLANNEDORDER_CHANGE'
EXPORTING
PLANNEDORDER = PLANNEDORDER
HEADERDATA = headerdata
HEADERDATAX = HEADERDATAX
IMPORTING
RETURN = RET_CHANGE
CHANGEDHEADERDATA = CHANGEDHEADERDATA.