08-01-2007 11:17 PM
Has anyone been able to perform batch splits via the bapi BAPI_OUTB_DELIVERY_CHANGE? Not positive this is the correct module to use, but best I can tell it is.
My goad is to be able to determine how to update a standard Inventory Managed delivery (no WM, decentralized warehouses, or ALE systems) with multiple batch splits per line item. Need to know if this is the correct FM to call and which tables you had to populate to pass the material, batch, quantities, unit of measure.....
Any help would be greatly appreciated.
thanks,
Chip
08-02-2007 6:29 AM
Hi Sanders,
The BAPI (BAPI_OUTB_DELIVERY_CHANGE) is populated with the following export parameters and tables.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
EXPORTING
HEADER_DATA = header_data
HEADER_CONTROL = header_control
DELIVERY = Delivery_Number
TABLES
ITEM_DATA = Item_data
ITEM_CONTROL = Item_control
RETURN = Return.
HEADER_DATA: Populate the header_data with delivery number. (Field DELIV_NUMB)
HEADER_CONTROL: Populate the header_control with delivery number. (Field DELIV_NUMB)
DELIVERY: Input delivery number directly
ITEM_DATA: Input the following parameters
Delivery Number (DELIV_NUMB) with LIPS-VBELN
Delivery Item number (DELIV_ITEM) with LIPS-POSNR
Material Number (MATERIAL) with LIPS-MATNR
Batch Number (BATCH) with batch number you have
Superior Hierarchy (HIERARITEM) with LIPS-POSNR
Hierarchy Item (USEHIERITM) with '1' always for Batch split
Actual quantity (DLV_QTY) with batch quantity
Actual quantity (DLV_QTY_IMUNIT) with batch quantity
Numerator (FACT_UNIT_NOM) with LIPS-UMVKZ
Denominator (FACT_UNIT_DENOM) with LIPS-UMVKN
Sales Unit (SALES_UNIT) with LIPS-VRKME
For Item details if one material has two batches, append the records with only difference in quantity and batch.
ITEM_CONTROL: Delivery Number (DELIV_NUMB) with LIPS-VBELN
Delivery Item (DELIV_ITEM) with LIPS-POSNR
Change del. quantity (CHG_DELQTY) with 'X'
Item control can have one record for one line item of delivery. Say if you have two batches for a single material, even then you can have one item.
Hope this resolves you problem. Reply back if you need any further clarifcation.
<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>
Regards,
Senthil G.
Edited by: Alvaro Tejada Galindo on Dec 17, 2009 9:45 AM
04-24-2009 12:44 PM
08-05-2010 3:02 PM
Hi Senthil , I have Similar problem but it is with inbound delivery , I am using bapi BAPI_INB_DELIVERY_CHANGE ,
In my case inbound delivery is automatically created using idoc , I want to add batch numbers to this inbound delivery , I am using this bapi , but it is not updation batch numbers ,
please help
10-16-2013 6:54 AM
Hello Senthil Sir
Can we insert these batches while creating delivery only???
I want to use single bapi which create delivery and insert batches in it in a single step.
Thanks
08-02-2007 6:32 AM
BAPI_INB_DELIVERY_CHANGE - Change inbound delivery
BAPI_INB_DELIVERY_CONFIRM_DEC - for inbound delivery verification from a decentralized system
BAPI_INB_DELIVERY_SAVEREPLICA - Function Module for Replication of Inbound Deliveries
BAPI_OUTB_DELIVERY_CHANGE - for Change to Outbound Delivery
BAPI_OUTB_DELIVERY_CONFIRM_DEC - for Outbound Delivery Verification from a Decentralized System
BAPI_OUTB_DELIVERY_SAVEREPLICA - Function Module for Replication of Outbound Deliveries
08-02-2007 1:24 PM
Senthil,
Thank you very much for your very detailed reply - very helpful.
I am already filling in all of the fields that you have suggested and it appears to update the delivery and create the split items. However I cannot seem to get it to populate picked quantity field (LIPSD-PIKMG) in the batch split items.
Any idea what I am missing?
thanks,
Chip
08-07-2007 4:24 AM
Just trying to make sure I am using a BAPI that is intended for picking... updating the quantity that was picked against the delivery.
It seems to let me update just about anything else but the pick quantity field outlined in my last update.
thanks,
Chip
08-07-2007 7:17 AM
Hello Chip,
I checked the BAPI_OUTB_DELIVERY_CHANGE but I dont find any possibility of entering the picking quantity.
(While using transaction SE37, I can find CWM_ITEM_DATA in the tables of this BAPI. This table has parameters to enter picking quantity. But this table is neither used anywhere in the BAPI nor displayed in the patterns. Note that this bapi is not released. )
I think you have to do a BDC for this. If you find any other alternate solution, please update this thread.
Regards, Senthil G.
08-08-2007 12:26 PM
Thanks for your feedback on this. I will probably go the BDC route.
It is a little disappointing that there is not a BAPI or SAP supplied RFC that allows updating of the delivery with the picked quantity. I have to believe this is something that applications need to do and get real time feedback, where ALE wouldn't be a possibility.
thanks,
Chip
12-22-2015 7:11 AM
Hi Chip,
Did you use a BDC or found any FM for you requirement? (regarding picked quantity update along with batch split)
12-17-2009 2:37 PM
Hi,
Try FM L_TO_CREATE_DN
We use this and it works great.
If 1 batch it will put the batch on the line item.
If multiple batchs they will be in sub item (BATCH SPLIT)
Regards!
Curtis
10-20-2010 4:24 PM
Hello Curtis,
Could you please tell me how did you manage to make MF L_TO_CREATE_DN working ?
I didn't succeed in making it work.
Thanks
Blsap
05-02-2011 4:00 PM
Fill in the following fields
lv_lgnum.
lt_wa_delit-vltyp.
lt_wa_delit-vlpla.
lt_wa_delit-anfme.
lt_wa_delit-altme.
lt_wa_delit-posnr.
lt_wa_delit-charg.
APPEND lt_wa_delit TO lt_delit.
CALL FUNCTION 'L_TO_CREATE_DN'
EXPORTING
i_lgnum = lv_lgnum " Warehouse number
i_vbeln = t_batch-vbeln
i_update_task = ' '
i_commit_work = ' '
i_bname = sy-uname
i_komim = '1' " Adopt picked qty
i_squit = ' ' " Confirmation Yes or No
it_delit = lt_delit
IMPORTING
e_tanum = rt_tanum
TABLES
t_ltak = lt_ltak
t_ltap_vb = lt_ltap_vb
t_wmgrp_msg = lt_msg
EXCEPTIONS
foreign_lock = 1
dn_completed = 2
partial_delivery_forbidden = 3
xfeld_wrong = 4
ldest_wrong = 5
drukz_wrong = 6
dn_wrong = 7
squit_forbidden = 8
no_to_created = 9
teilk_wrong = 10
update_without_commit = 11
no_authority = 12
no_picking_allowed = 13
dn_hu_not_choosable = 14
input_error = 15.
Hope this helps!
Curtis
10-20-2010 9:00 PM
Hello!
Have you tried the transaction VLSP for splitting? If it fits your requirements, then you can use the FM "LE_DSP_ALL_STEPS". It works for me.
09-24-2015 4:02 PM
Hello Stanislav,
Can you please share some more information about LE_DSP_ALL_STEPS as to how you have made it work for splitting.
Thanks,
Briston
10-11-2012 11:20 AM
Give this a try.
REPORT z_delivery_batch_split.
DATA:header_data LIKE bapiibdlvhdrchg,
header_control LIKE bapiibdlvhdrctrlchg,
delivery LIKE bapiibdlvhdrchg-deliv_numb,
ls_return LIKE bapiret2,
item_data TYPE TABLE OF bapiibdlvitemchg,
item_control TYPE TABLE OF bapiibdlvitemctrlchg,
ls_item_data LIKE bapiibdlvitemchg,
ls_item_control LIKE bapiibdlvitemctrlchg,
return TYPE TABLE OF bapiret2 WITH NON-UNIQUE KEY type.
header_data-deliv_numb = '1800005005'.
header_control-deliv_numb = '1800005005'.
delivery = '1800005005'.
ls_item_data-deliv_numb = '1800005005'.
ls_item_data-deliv_item = '900001'.
ls_item_data-material = '000000000020067722'.
PERFORM create_batch CHANGING ls_item_data-batch.
ls_item_data-hieraritem = '000010'.
ls_item_data-usehieritm = '1'.
ls_item_data-dlv_qty = 80.
ls_item_data-dlv_qty_imunit = 80.
ls_item_data-fact_unit_nom = '1'.
ls_item_data-fact_unit_denom = '1'.
ls_item_data-sales_unit = 'EA'.
ls_item_data-base_uom = 'EA'.
APPEND ls_item_data TO item_data.
ls_item_data-deliv_numb = '1800005005'.
ls_item_data-deliv_item = '900002'.
ls_item_data-material = '000000000020067722'.
PERFORM create_batch CHANGING ls_item_data-batch.
ls_item_data-hieraritem = '000010'.
ls_item_data-usehieritm = '1'.
ls_item_data-dlv_qty = 60.
ls_item_data-dlv_qty_imunit = 60.
ls_item_data-fact_unit_nom = '1'.
ls_item_data-fact_unit_denom = '1'.
ls_item_data-sales_unit = 'EA'.
ls_item_data-base_uom = 'EA'.
APPEND ls_item_data TO item_data.
ls_item_control-deliv_numb = '1800005005'.
ls_item_control-deliv_item = '900001'.
ls_item_control-chg_delqty = 'X'.
APPEND ls_item_control TO item_control.
ls_item_control-deliv_numb = '1800005005'.
ls_item_control-deliv_item = '900002'.
ls_item_control-chg_delqty = 'X'.
APPEND ls_item_control TO item_control.
break cgavin.
CALL FUNCTION 'BAPI_INB_DELIVERY_CHANGE'
EXPORTING
header_data = header_data
header_control = header_control
delivery = delivery
* TECHN_CONTROL = TECHN_CONTROL
TABLES
* HEADER_PARTNER = HEADER_PARTNER
* HEADER_PARTNER_ADDR = HEADER_PARTNER_ADDR
* HEADER_DEADLINES = HEADER_DEADLINES
item_data = item_data
item_control = item_control
* ITEM_SERIAL_NO = ITEM_SERIAL_NO
* EXTENSION1 = EXTENSION1
* EXTENSION2 = EXTENSION2
return = return
* TOKENREFERENCE = TOKENREFERENCE
* HANDLING_UNIT_HEADER = HANDLING_UNIT_HEADER
* HANDLING_UNIT_ITEM = HANDLING_UNIT_ITEM
* PARTIAL_GR_OBJECTS = PARTIAL_GR_OBJECTS
.
READ TABLE return
INTO ls_return
WITH TABLE KEY type = 'E'.
IF sy-subrc = 0.
MESSAGE ID ls_return-id TYPE ls_return-type NUMBER ls_return-number WITH ls_return-message_v1 ls_return-message_v2
ls_return-message_v3 ls_return-message_v4.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
break cgavin.
*&---------------------------------------------------------------------*
*& Form CREATE_BATCH
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_LS_ITEM_DATA_BATCH text
*----------------------------------------------------------------------*
FORM create_batch CHANGING p_ls_item_data_batch.
DATA: ls_bncom TYPE bncom.
ls_bncom-matnr = ls_item_data-material.
ls_bncom-werks = 'C333'.
ls_bncom-lgort = '3000'.
SELECT SINGLE mtart
FROM mara
INTO ls_bncom-mtart
WHERE matnr = ls_bncom-matnr.
CALL FUNCTION 'VB_NEXT_BATCH_NUMBER'
EXPORTING
matnr = ls_bncom-matnr
werks = ls_bncom-werks
check_batch = 'X'
check_material = ''
message_when_auto = ' '
x_bncom = ls_bncom
lock_batch = ' '
IMPORTING
new_charg = p_ls_item_data_batch
EXCEPTIONS
no_material = 1
no_plant = 2
material_not_found = 3
plant_not_found = 4
no_batch_handling = 5
batch_exist = 6
no_number = 7
illegal_batch_number = 8
interval_not_found = 9
object_not_found = 10
interval_overflow = 11
error_automatic_batch_number = 12
cancelled = 13
automatic_batch_num_not_active = 14
OTHERS = 15.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
ENDFORM. " CREATE_BATCH
03-15-2023 12:24 PM
Pls use program.
DATA : LT_HEADER_DATA TYPE TABLE OF BAPIOBDLVHDRCHG,