10-06-2008 9:29 AM
Hi,
I am interested knowing, if there is any BAPI available for doing Inbound Delivery in SAP.
I have a requirement to do partial inbound delivery which I cant do with VL31n or VL30. even if can do with these transactions,
I will not be able to run them in background.
Any help in this regard is highly appreciated.
10-06-2008 9:31 AM
check them it may be helpful for you
BAPI_IBDLV_CREATE_FROM_OBDLV BAPI Inbound Delivery from Outbound Delivery
BAPI_INB_DELIVERY_CONFIRM_DEC BAPI for Inbound Delivery Confirmation from a Decentralized System
10-06-2008 9:31 AM
check them it may be helpful for you
BAPI_IBDLV_CREATE_FROM_OBDLV BAPI Inbound Delivery from Outbound Delivery
BAPI_INB_DELIVERY_CONFIRM_DEC BAPI for Inbound Delivery Confirmation from a Decentralized System
10-06-2008 10:16 AM
my requirement is to create Inbound delivery with ref. to a purchase order.
Any sample code with functional module or BAPI usage is highly appreciated.
10-06-2008 11:29 AM
Check this :
======
&----
*& Form CREATE_INBOUND_DELIVERY
&----
text
----
--> p1 text
<-- p2 text
----
FORM CREATE_INBOUND_DELIVERY .
DATA : N1(6) TYPE N.
N1 = '000010'.
DEL_HEADER-DELIV_DATE = DEL_DATE.
DEL_HEADER-DELIV_EXT = HEADER-REF_1.
DEL_HEADER-TRANSP_ID = HEADER-OUR_REF.
CLEAR DEL_TAB.
REFRESH DEL_TAB.
CLEAR N1.
LOOP AT POITEM.
DEL_TAB-DELIV_ITEM = N1.
DEL_TAB-MATERIAL = POITEM-MATERIAL.
DEL_TAB-DELIV_QTY = POITEM-QUANTITY.
DEL_TAB-UNIT = 'EA'.
DEL_TAB-PO_NUMBER = PO.
DEL_TAB-PO_ITEM = POITEM-PO_ITEM.
APPEND DEL_TAB.
CLEAR DEL_TAB.
N1 = N1 + 20.
ENDLOOP.
CALL FUNCTION 'BBP_INB_DELIVERY_CREATE'
EXPORTING
IS_INB_DELIVERY_HEADER = DEL_HEADER
IMPORTING
EF_DELIVERY = DEL_NO
TABLES
IT_INB_DELIVERY_DETAIL = DEL_TAB
RETURN = DEL_RET.
IF SY-SUBRC = 0.
ENDIF.
ENDFORM. " CREATE_INBOUND_DELIVERY
======
10-06-2008 6:44 PM
I already solved with above function module but still I am giving full points because some else trying this scenario will know that this is solved.
10-13-2008 11:54 AM
Hi Vinay,
I am facing the same problem can you send the code for that bapi.
I am new for the bapi. Plz help
Thanks.
Rajiv
01-05-2009 2:54 PM
Hello everyone:
Now, I would like to creat a Inbound delivery, Use a BAPI,bapi name is BAPI_INB_DELIVERY_SAVEREPLICA,but I don't know the meaning of each parameter, Can you explain?,Thanks
10-06-2008 9:31 AM
Try -
BAPI_DELIVERYPROCESSING_EXEC
BAPI_DELIVERYFREE_PROXY_CREATE
Regards,
Aparna
10-06-2008 9:33 AM
Hi,
For VL31N you can make use of BBP_INB_DELIVERY_CREATE Function Module.
Regards,
Surinder
02-19-2009 10:45 PM
Surinder,
FM BBP_INB_DELIVERY_CREATE did the magic for transaction VL31N, thanks for that.
Any idea of why there is no BAPI to this? Where did you find this FM?
Thanks,
Pablo.
12-30-2008 7:19 PM
Hi all, was working with similar problem.
I used GN_DELIVERY_CREATE and wrapped it up into method.
May be will be useful.
It creates inbound delivery by PO/STO
Method signature :
I_EBELN Importing Type EBELN Purchasing Document Number
I_COMMIT Importing Type ANY Commit database changes
I_LFDAT Importing Type LFDAT SY-DATUM
E_VBELN Exporting Type VBELN_VL Delivery
ET_LIPS Exporting Type /SAPSLL/LIPS_R3_T
ET_RETURN Exporting Type BAPIRET2_T
E_RC Changing Type SYSUBRC
E_MESSAGE Changing Type ANY
Method itself:
method create_inb_dlvr_by_po.
*-- Logic for current method was extracted from
*-- source code of VL31N dialog transaction
data l_sd_doc_category type vbtyp value 'V'.
data l_ibtyp type t163d-ibtyp value '2'.
data l_func(1) value '1'.
constants c_error(1) value 'E'.
*--
field-symbols <wa_xkomdlgn> type komdlgn.
data lt_lips type table of lips.
data wa_lips type lips.
data lt_errors type table of wuebs.
data wa_errors type wuebs.
data wa_return type bapiret2.
data lt_wueb type table of wueb.
data wa_wueb type wueb.
data vbsk_i type vbsk.
data l_no_commit type char01.
data lt_xkomdlgn type table of komdlgn.
data lt_xvbfs type table of vbfs.
data lt_xvbls type table of vbls.
data vbsk_e type vbsk.
data lt_splitprot type vlikp_t_splitprot.
data wa_tvlk type tvlk.
data wa_likp type likp.
*--
clear: e_rc, e_message.
*-- Prepare data for delivery creation
wa_wueb-ebeln = i_ebeln.
append wa_wueb to lt_wueb.
*-- Get delivery type
call function 'ME_CONFIRMATION_DELIVERY_TYPE'
exporting
i_func = l_func
changing
c_ibtyp = l_ibtyp
c_lfart = wa_likp-lfart
exceptions
function_not_valid = 01
param_value_missing = 02
no_item_found = 03
error_message = 04.
if not sy-subrc is initial.
e_rc = sy-subrc.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 into e_message.
exit.
endif.
*-- Get default order type
select single daart into wa_tvlk-daart
from tvlk
where lfart eq wa_likp-lfart.
if not sy-subrc is initial.
e_rc = sy-subrc.
e_message = 'Delivery type not found'(001).
exit.
endif.
*-- Fill communiaction table from PO data
call function 'ME_CONFIRMATION_READ_AVIS'
exporting
ldate = sy-datum
tables
t_kom = lt_xkomdlgn
t_wueb = lt_wueb
errors = lt_errors
exceptions
error_message = 99.
if et_return is supplied.
clear wa_return.
loop at lt_errors into wa_errors.
wa_return-id = wa_errors-msgid.
wa_return-type = wa_errors-msgty.
wa_return-number = wa_errors-msgno.
wa_return-message_v1 = wa_errors-msgv1.
wa_return-message_v2 = wa_errors-msgv2.
wa_return-message_v3 = wa_errors-msgv3.
wa_return-message_v4 = wa_errors-msgv4.
append wa_return to et_return.
endloop.
endif.
loop at lt_errors into wa_errors where msgty = c_error.
message id wa_errors-msgid
type wa_errors-msgty
number wa_errors-msgno
with wa_errors-msgv1 wa_errors-msgv2
wa_errors-msgv3 wa_errors-msgv4
into e_message.
e_rc = 8.
exit.
endloop.
check e_rc is initial.
*-- Set delivery date
wa_likp-lfdat = i_lfdat.
*-- Prepare General Delivery Interface data
loop at lt_xkomdlgn assigning <wa_xkomdlgn>.
<wa_xkomdlgn>-lfart = wa_likp-lfart.
<wa_xkomdlgn>-auart = wa_tvlk-daart.
<wa_xkomdlgn>-vgtyp = l_sd_doc_category.
<wa_xkomdlgn>-lfdat = wa_likp-lfdat.
<wa_xkomdlgn>-lfuhr = wa_likp-lfuhr.
<wa_xkomdlgn>-bolnr = wa_likp-bolnr.
<wa_xkomdlgn>-verur = wa_likp-verur.
<wa_xkomdlgn>-lifex = wa_likp-verur.
<wa_xkomdlgn>-traty = wa_likp-traty.
<wa_xkomdlgn>-traid = wa_likp-traid.
<wa_xkomdlgn>-kzazu = charx.
endloop.
if i_commit is initial.
l_no_commit = charx.
else.
clear l_no_commit.
endif.
*-- Create delivery
call function 'GN_DELIVERY_CREATE'
exporting
vbsk_i = vbsk_i
no_commit = charx
importing
vbsk_e = vbsk_e
et_splitprot = lt_splitprot
tables
xkomdlgn = lt_xkomdlgn
xxlips = lt_lips
xvbfs = lt_xvbfs
xvbls = lt_xvbls
exceptions
error_message = 99.
if not sy-subrc is initial.
e_rc = 8.
message e398(00) with 'DELIVERY'(003) 'CREATION FAILED'(002)
into e_message.
exit.
endif.
if lt_lips[] is initial.
e_rc = 8.
message e398(00) with 'DELIVERY'(003) 'CREATION FAILED'(002)
into e_message.
exit.
endif.
loop at lt_lips into wa_lips.
exit.
endloop.
et_lips = lt_lips.
delete lt_lips where lfimg <> 0.
if not sy-subrc is initial.
e_rc = 8.
message e398(00) with 'DELIVERY'(003) wa_lips-vbeln
'WITH 0 QTY. NOT SAVED!'(005)
into e_message.
rollback work.
exit.
endif.
if l_no_commit is initial.
commit work and wait.
select single vbeln into e_vbeln from lips
where vbeln = wa_lips-vbeln.
if not sy-subrc is initial.
e_rc = 8.
message e398(00) with 'DELIVERY'(003) 'CREATION FAILED'(002)
into e_message.
exit.
else.
message s398(00) with 'DELIVERY'(003) wa_lips-vbeln
'CREATED'(004)
into e_message.
endif.
else.
rollback work.
message s398(00) with 'DELIVERY'(003) wa_lips-vbeln
'CREATED'(004)
into e_message.
endif.
e_vbeln = wa_lips-vbeln.
endmethod.
02-19-2009 11:09 PM
just info: as u mentioned FM GN_DELIVERY_CREATE is a part of above said FMs, mostly, like BBP_ , SAVEREPLICA, DEC etc. i mean, GN_DELIVERY_CREATE FM will b called in these FMs.
thanq
11-01-2010 5:03 PM
my requirement is to create Inbound delivery with ref. to a purchase order.but the value is updating in likp and lips.but in lips table in matnr field material value is not updated ......so kindly give some idea.....
Edited by: haji mohamed on Nov 1, 2010 10:33 PM