*"*"Local interface:
*" IMPORTING
*" REFERENCE(W_VBELN) LIKE LIKP-VBELN
*" REFERENCE(W_NEW_DELV_BLOCK) LIKE LIKP-LIFSK
*"--------------------------------------------------------------------
DATA: W_HEADER_DATA like BAPIOBDLVHDRCHG,
W_HEADER_CONTROL like BAPIOBDLVHDRCTRLCHG,
W_DELIVERY like BAPIOBDLVHDRCHG-DELIV_NUMB,
T_RETURN like BAPIRET2 occurs 0 with header line.
CLEAR: W_HEADER_DATA, W_HEADER_CONTROL, W_DELIVERY, T_RETURN.
REFRESH T_RETURN.
W_HEADER_DATA-DELIV_NUMB = W_VBELN.
W_Header_data-dlv_block = W_NEW_DELV_BLOCK.
W_HEADER_CONTROL-DELIV_NUMB = W_VBELN.
W_header_control-dlv_block_flg = 'X'.
W_DELIVERY = W_VBELN.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
HEADER_DATA = W_HEADER_DATA
HEADER_CONTROL = W_HEADER_CONTROL
DELIVERY = W_DELIVERY
TABLES
RETURN = T_RETURN.
READ TABLE T_RETURN WITH KEY TYPE = 'E'.
IF NOT SY-SUBRC IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF.
*" IMPORTING
*" REFERENCE(W_VBELN) LIKE LIKP-VBELN
*" REFERENCE(W_NEW_DELV_BLOCK) LIKE LIKP-LIFSK
*"--------------------------------------------------------------------
DATA: W_HEADER_DATA like BAPIOBDLVHDRCHG,
W_HEADER_CONTROL like BAPIOBDLVHDRCTRLCHG,
W_DELIVERY like BAPIOBDLVHDRCHG-DELIV_NUMB,
T_RETURN like BAPIRET2 occurs 0 with header line.
CLEAR: W_HEADER_DATA, W_HEADER_CONTROL, W_DELIVERY, T_RETURN.
REFRESH T_RETURN.
W_HEADER_DATA-DELIV_NUMB = W_VBELN.
W_Header_data-dlv_block = W_NEW_DELV_BLOCK.
W_HEADER_CONTROL-DELIV_NUMB = W_VBELN.
W_header_control-dlv_block_flg = 'X'.
W_DELIVERY = W_VBELN.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
HEADER_DATA = W_HEADER_DATA
HEADER_CONTROL = W_HEADER_CONTROL
DELIVERY = W_DELIVERY
TABLES
RETURN = T_RETURN.
READ TABLE T_RETURN WITH KEY TYPE = 'E'.
IF NOT SY-SUBRC IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
ENDIF.
No comments:
Post a Comment