cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI_OUTB_DELIVERY_CREATE_SLS giving random result

imigo
Discoverer
0 Kudos
500

Dear community,

we are using BAPI_OUTB_DELIVERY_CREATE_SLS in our custom FM to create deliveries. Custom FM is calling by RFC call. We have two scenarios when the standard FM generates different results:

1. When we send package from external system with Sales Order number and only 1 line item (in Sales Order in SAP we have 5 line items) there is created delivery for all 5 items. Then when we delete this delivery and send the package with 1 line item again for the same Sales Order there is created delivery with only 1 line item as expected. Same result when we set a break-point and checking in debug mode the variables - everything is fine.

2. Similar situation with order consolidation: we send package from external system with 2 Sales Orders: for the first time system creates only 1 delivery for 1 of the orders, when we delete  delivery and send same package again - it creates one consolidated delivery for both orders. And again with external break-point everything is working as expected from the first attempt.

We placed wait parameter for 1 second before FM but no success. Also we checked some old enhancements in standard FM for some logic, but did not find any impact. Checked external system, the packages of the data sent to SAP with RFC are always the same.

If somebody faced with such issue in the past, could you please share your experience and thoughts.

Thank you!

Accepted Solutions (0)

Answers (2)

Answers (2)

RaymondGiuseppi
Active Contributor
0 Kudos

Entering the order item (SALES_ORDER_ITEMS-REF_ITEM) should have been sufficient.

  • Search for OSS notes for your version
  • Check any modifications to the standard: Enhancements, customer exits, user exits, BadI (BADI_DLV_CREATE_*)
imigo
Discoverer
0 Kudos

Hi Raymond, 

thank you for the hint with closing of RFC call, we will check it.

Regarding the quantities, first we did not provide them from external system and today tried with quantities and also it did not help.

Order items we are getting with the following code (now with quantities):

lf_order_items-ref_doc    = ls_ord_tab-vbeln.
lf_order_items-ref_item   = ls_ord_tab-posnr.
lf_order_items-dlv_qty    = ls_ord_tab-dlv_qty.
lf_order_items-sales_unit = ls_ord_tab-sales_unit.
append lf_order_items.

 Thank you for your help

RaymondGiuseppi
Active Contributor
0 Kudos
Do not use Answer to respond to a comment or answer. Answer is intended to be used to propose a solution to the initial question. Use Comment on the initial question or on any answer instead.