2016 Jul 25 4:18 PM
Hello, We are trying to remove billing block from delivery via a custom program using BAPI_OUTB_DELIVERY_CHANGE. Set the header DLV_BLOCK field to blank and DLV_BLOCK_FLAG field to 'X'. and populated delivery number on both the header structures. However, the Delivery document is not being updated. Please let me know any suggestions for updating the billing block via a custom program.
*-Populate the header structures---
S_BAPI_DELIVERY_HDR-DELIV_NUMB = PI_VBELN.
S_BAPI_DELIVERY_HDR-DLV_BLOCK = ''.
S_BAPI_DELIVERY_HDRX-DELIV_NUMB = PI_VBELN.
S_BAPI_DELIVERY_HDRX-DLV_BLOCK_FLG = C_YES.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
HEADER_DATA = S_BAPI_DELIVERY_HDR
HEADER_CONTROL = S_BAPI_DELIVERY_HDRX
DELIVERY = PI_VBELN
TABLES
EXTENSION2 = LT_EXT2
RETURN = T_RETURN.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
Thanks in Advance,
Zack.
2016 Jul 25 4:25 PM
May be some other enhancement inside delivery is putting that block back on.
Thanks,
Juwin
2016 Jul 25 10:52 PM
Um, maybe it's not working because you want to update billing block but are using the field labeled "delivery block"?
Have you tried typing "BAPI_OUTB_DELIVERY_CHANGE billing block" into Google? It's much faster than posting a new discussion...