Con esta BAPI se contabiliza la salida de mercancía, esta es la que ejecuta la VL02N cuando se da clic en el botón "Contabilizar EM"
DATA: it_hd LIKE bapiobdlvhdrcon,
it_hc LIKE bapiobdlvhdrctrlcon,
it_hds LIKE /spe/bapiobdlvhdrconf,
it_hcs LIKE /spe/bapiobdlvhdrctrlcon,
it_ret LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
it_hd-deliv_numb = entrega.
it_hc-deliv_numb = entrega.
it_hc-post_gi_flg = 'X'. "<<<
it_hds-deliv_numb = entrega.
it_hcs-deliv_numb = entrega.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CONFIRM_DEC'
EXPORTING
header_data = it_hd
header_control = it_hc
delivery = entrega
header_data_spl = it_hds
header_control_spl = it_hcs
TABLES
return = it_ret.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.Tomado de :
http://bitacorasap.blogspot.com/2011/10/contabilizar-salida-de-mercancia.html