11-05-2014 5:17 AM
Hi All,
im using function module bbp_inb_delivery_create in a report program to create inbound delivery w.r.t., PO but it is not creating delivery document. Below is my code which im using in my report program. please note that when im executin this FM directly in SE37 with same parameters it is creating delivery document correctly. could anybody please give any idea why it is working fine in SE37 but not via. SE38.
Thank you
DATA: WA_INB TYPE BBP_INBD_L,
IT_INB_DEL TYPE TABLE OF BBP_INBD_D,
WA_INB_DEL TYPE BBP_INBD_D,
IT_RET TYPE TABLE OF BAPIRETURN.
PARAMETERS : P_DEL_TI TYPE LFDAT_V.
WA_INB-DELIV_DATE = P_DEL_TI. "'09082014'.
WA_INB-DELIV_EXT = '12345677'.
WA_INB_DEL-DELIV_ITEM = '000010'.
WA_INB_DEL-MATERIAL = '5010CK14 9300'.
WA_INB_DEL-MATL_DESC = 'STIFFNER HEAD PIPE SUB COMP'.
WA_INB_DEL-DELIV_QTY = '1.000'.
WA_INB_DEL-UNIT = 'PC'.
WA_INB_DEL-PO_NUMBER = '9700000003'.
WA_INB_DEL-PO_ITEM = '00010'.
APPEND WA_INB_DEL TO IT_INB_DEL.
DATA VBELN TYPE VBELN_VL. "LIKP-VBELN.
CALL FUNCTION 'BBP_INB_DELIVERY_CREATE'
EXPORTING
IS_INB_DELIVERY_HEADER = WA_INB
IMPORTING
EF_DELIVERY = VBELN
TABLES
IT_INB_DELIVERY_DETAIL = IT_INB_DEL
RETURN = IT_RET
.
BREAK-POINT.
11-07-2014 2:02 PM
Im now able to create delivery by using this function module. problem was with unit of measurement. i converted commercial uom to internal uom by using fm conversion*cuint_input and passed it to fm bbp_inb* and it is creating delivery document. however this fm is not importing delivery document number in ef_delivery parameter. i can see new delivery document in LIKP table but not in importing param of this fm. could any body please help me further in this.
Rgds
11-05-2014 5:39 AM
Hello,
Are you getting any message in RETURN table when you execute in SE38 and SE37 ?
If you are getting any message, try to find the reason behind the error, if not paste a message here, we will try to help you.
Regards,
Thanga
11-05-2014 5:56 AM
Hello Prakash,
In either case (via. se37 or se38) im not getting any message in RETURN table. however in case im executing this fm via. SE37 it is creating delivery which im able to see in LIKP table.
Rgds
11-05-2014 5:57 AM
Hello,
I've seen this scenario before. Normally, created delivery document and error messages are returned, but sometimes the function exports empty delivery number, in spite of return table without errors.In this case, system actually created delivery. If you query tables after COMMIT, you will find the delivery number.
Check out this code.
********************************************************
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.
***************************************
Reward points if helpful.
Thanks and regards,
Ambareesh J.
11-05-2014 6:12 AM
Hello Ambareesh,
Thanks for sharing code. What i understood from your blog is to put COMMIT after FM call. i did same but still same result. it is not creating any delivery doc.
04-05-2016 2:49 PM
11-05-2014 6:19 AM
Hi,
is that correct that you have a space within the material number?
Please also check line
WA_INB_DEL-DELIV_QTY = '1.000'.
against
WA_INB_DEL-DELIV_QTY = '1000'.
in debugger.
Please check also that fixed point arithmetic flag in the report's attributes is set or not.
And finally check, if this function module has been released in your SAP release. It is not released in our systems.
Regards,
Klaus
11-05-2014 6:22 AM
Hello Klaus,
Quantity conversion and space in material numbers are fine. how would i check if this FM has been release in my system. im in a brand new system so this may be the issue. please advise.
Rgds
11-05-2014 6:28 AM
Hello Test,
Goto the attributes of the FM and check released status under the general data.
Regards,
Thanga
11-05-2014 6:47 AM
Yes, issue is with its Release status. it is showing Not Release and i guess that is the reason im not able to create delivery. i raised this with concerning people and will update forum accordingly. Thanks for your inputs and time!
rgds
11-05-2014 8:19 AM
11-05-2014 6:27 AM
Hello,
Try to convert the input into the SAP input format by using the conversion routines for all the relevant fields given as a input to the function module.
Regards,
Thanga
11-06-2014 8:33 AM
Im still not able to create inbound delivery by this function module. could anybody please share any idea. details are as above.
Rgds
11-07-2014 2:02 PM
Im now able to create delivery by using this function module. problem was with unit of measurement. i converted commercial uom to internal uom by using fm conversion*cuint_input and passed it to fm bbp_inb* and it is creating delivery document. however this fm is not importing delivery document number in ef_delivery parameter. i can see new delivery document in LIKP table but not in importing param of this fm. could any body please help me further in this.
Rgds
11-07-2014 3:58 PM
HI Test match,
The FM which you are using it is not released so you can not use that because it will create issue if system get update.
However you can use BDC to create inbound delivery and call it in background mode so that you can get messages also in BDCMSGCOL. Do recording of transaction Vl31N using SHDB as per your requirement and you can use that in your program or custom FM.
Please check.
Regards,
Santosh
11-08-2014 8:41 AM
how about copying the FM in a Z version and release it accordingly. Can i use this Z fm..please advise.
11-30-2014 5:10 PM
12-01-2014 4:30 AM
Hello Prakash,
yes, it has been resolved. Issue was with UOM. i changed commercial uom to internal by using an FM and it went fine to me. I will close the thread accordingly. Thanks for reminder.
Rgds
08-26-2016 4:53 PM
Hi,
pls elaborate how u capture new inbound del. no?
Thanks,
abhijeet.