BBP_INB_DELIVERY_CREATE function is used for creating inbound delivery. Normaly created delivery number and error messages are returned, but sometimes function exports empty delivery number, inspite of return table without errors. In this case system actually creates delivery, if you query tables after commit, you will find delivery number.
Sytem Info that i faced the bug:
SAP ECC 6.0
SAP_ABA | 701 | 0009 | SAPKA70109 |
SAP_BASIS | 701 | 0009 | SAPKB70109 |
DATA: _header LIKE bbp_inbd_l,
_delivery LIKE likp-vbeln,
_it_detail TYPE STANDARD TABLE OF bbp_inbd_d WITH HEADER LINE,
_it_return TYPE STANDARD TABLE OF bapireturn WITH HEADER LINE.
DATA: _vbeln TYPE ekes-vbeln.
SELECT * FROM ekpo WHERE ebeln = 'PO Number'.
_it_detail-material = ekpo-matnr.
_it_detail-matl_desc = ekpo-txz01.
_it_detail-deliv_qty = ekpo-menge.
_it_detail-unit = ekpo-meins.
_it_detail-po_number = ekpo-ebeln.
_it_detail-po_item = ekpo-ebelp.
APPEND _it_detail.
CLEAR _it_detail.
ENDSELECT.
_header-deliv_date = sy-datum.
_header-deliv_time = sy-uzeit.
CALL FUNCTION 'BBP_INB_DELIVERY_CREATE'
EXPORTING
is_inb_delivery_header = _header
IMPORTING
ef_delivery = _delivery
TABLES
it_inb_delivery_detail = _it_detail[]
return = _it_return[].
LOOP AT _it_return WHERE type = 'A'
OR type = 'E'
OR type = 'X'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
IF _delivery IS INITIAL.
SELECT SINGLE vbeln
INTO _vbeln
FROM ekes
WHERE ebeln = p_ebeln
AND ebtyp = 'LA'."Inbound Delivery
ENDIF:
ENDIF.