‎2007 Apr 17 5:28 PM
Hello All:
Here is the code I am using to develope a function to automate the packing process.. (VL02n). I am able to create a HU, but I am not able to assign the delivery number to the HU created. The error Message "Required handling units could not be found". I am not sure, what is that I am not doing right. Any help will be appreciated. Thanks.
report ztom_pack .
data: delivery_number type likp-vbeln,
headerproposal_in type bapihuhdrproposal,
huheader_out type bapihuheader,
huheader_in type bapihuheader,
hukey_out type bapihukey-hu_exid,
hukey_in type bapihukey-hu_exid,
itemproposal type bapihuitmproposal occurs 10 with
header line,
return1 like bapiret2 occurs 10,
return2 like bapiret2 occurs 10,
return3 like bapiret2 occurs 10,
huitem_out like bapihuitem.
delivery_number = '0080000221'.
headerproposal_in-hu_status_init = 'A'.
headerproposal_in-pack_mat = '000000000000009100'.
headerproposal_in-plant = '0010'.
headerproposal_in-stge_loc = '0010'.
call function 'BAPI_HU_CREATE'
exporting
headerproposal = headerproposal_in
importing
huheader = huheader_out
hukey = hukey_out
tables
return = return1.
break gautam.
ITab_VENUM-VENUM = huheader_out-HU_ID.
append itab_venum.
CALL FUNCTION 'HU_PACKING_REFRESH'
EXPORTING
IF_SOFORTAUFTRAG = ' '
IF_GET_HUS =
IF_DEQUEUE =
IT_VENUM = ITab_VENUM[]
IMPORTING
ET_VEKP =
ET_VEPO =
.
hukey_in = hukey_out.
itemproposal-hu_item_type = '1'.
**itemproposal-lower_level_exid = hukey_out.
itemproposal-pack_qty = '1'.
itemproposal-material = '000000000000006210'.
itemproposal-plant = '0010'.
itemproposal-stge_loc = '0010'.
**itemproposal-no_of_serial_numbers = '1'.
append itemproposal.
call function 'BAPI_HU_PACK'
exporting
hukey = hukey_in
itemproposal = itemproposal
IMPORTING
HUITEM = huitem_out
HUHEADER = huheader_out
tables
return = return3 .
‎2007 Jun 07 2:27 AM
Hi Gautam ,
I am facing the same problem....
I my case
'BAPI_HU_PACK' function moudle doesnt return anything when hadling unit number consists of only number. But it is working fine when the Handling unit number start with some alphabet.
I give the message Handling units couldnt be found.
Any break through in your case.
Please let me know.
‎2007 Jun 11 11:03 PM