Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI to remove billing block on delivery

zackpatel
Explorer
0 Kudos
1,572

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.

2 REPLIES 2

Juwin
Active Contributor
0 Kudos
527

May be some other enhancement inside delivery is putting that block back on.

Thanks,

Juwin

Jelena_Perfiljeva
Active Contributor
0 Kudos
527

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...