02-13-2011 12:43 PM
Hi experts,
My requirement is to create inbound delivery by using FM BBP_INB_DELIVERY_CREATE. But I am not able to successfully execute this FM and it is giving me dump everytime saying length of i_itab2 incorrect. Please help me in solving this issue . My code is as below:
DATA: i_itab TYPE STANDARD TABLE OF bbp_inbd_d,
wa_itab LIKE LINE OF i_itab,
return TYPE STANDARD TABLE OF bapireturn,
wa_return LIKE LINE OF return.
DATA: lv_vendor LIKE bapiekko-vendor,
lv_po LIKE bapiekko-po_number.
lv_vendor = '0000100000'.
lv_po = '4500000000'.
CALL FUNCTION 'BBP_INBD_CREATE_PO_GETITEM_31I'
EXPORTING
if_vendor = lv_vendor
if_po_number = lv_po
IF_DELIV_DATE =
IF_DELIV_TIME =
TABLES
et_inb_d_create_po_detail = i_itab
return = return
.
DATA : i_itab2 TYPE TABLE OF bbp_inbd_l,
wa_itab2 TYPE bbp_inbd_l,
del LIKE likp-vbeln.
data: lv_date(12) type c.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = '02/13/2011'
IMPORTING
date_internal = lv_date
EXCEPTIONS
date_external_is_invalid = 1
OTHERS = 2.
MOVE lv_date TO wa_itab2-deliv_date.
APPEND wa_itab2 TO i_itab2.
CALL FUNCTION 'BBP_INB_DELIVERY_CREATE'
EXPORTING
is_inb_delivery_header = i_itab2
IMPORTING
ef_delivery = del
TABLES
it_inb_delivery_detail = i_itab
return = return.
IF sy-subrc = 0.
WRITE : 'Inbound delivery created'.
ENDIF.
02-13-2011 2:31 PM
Your i_itab2 is not declared correctly. The function parameter is a structure, not a table. Use the work area you declared instead of an internal table.
02-14-2011 6:22 AM
Hi ,
The problem of dump is solved but the delivery number is still not getting generated. The BAPI is executed and sy-subrc is 0. BUt still I am not getting the delivery number.