11-04-2005 10:49 AM
Hi All,
I am using FM WS_DELIVERY_UPDATE for picking, packing and post goods issue of outbound delivery. I am able to achieve picking and goods issue and not packing.
I am using BAPI_HU_CREATE and BAPI_HU_CHANGE_HEADER to create HU and then assign it to outbound delivery. But the handling unit is not actually getting created. I am getting the message 'HU functions outside of the delivery only'.
Any help on this greatly appreciated. More so, if any one can give me the exact process flow of calling and the key parameters to pass to these function modules.
Thanks,
Sudeep
11-04-2005 2:26 PM
Are you using packing proposal or are using custom code to decide packing? When is the HU assignment done to the delivery...during picking?
11-04-2005 11:21 PM
11-04-2005 11:26 PM
> Srinivas,
>
> The packing is done during picking itself.
>
> Thanks,
> Sudeep
Additionally, no packing proposal is being used. Custom code throuhgout.
11-04-2005 6:50 PM
Hi,
Below is simple program which works for me. Of course you must adjust data according to your system configuration.
DATA: HEADERPROPOSAL LIKE BAPIHUHDRPROPOSAL,
ITEMSPROPOSAL LIKE BAPIHUITMPROPOSAL OCCURS 0 WITH HEADER LINE,
HUHEADER LIKE BAPIHUHEADER,
HUKEY LIKE BAPIHUKEY-HU_EXID,
RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE,
HUITEM LIKE BAPIHUITEM OCCURS 0 WITH HEADER LINE.
HEADERPROPOSAL-PACK_MAT = '000000000000600001'.
* Creation of HU
ITEMSPROPOSAL-HU_ITEM_TYPE = 1.
ITEMSPROPOSAL-PACK_QTY = 5.
ITEMSPROPOSAL-BASE_UNIT_QTY = 'KG'.
ITEMSPROPOSAL-MATERIAL = '000000000000706602'.
ITEMSPROPOSAL-BATCH = '0000800468'.
ITEMSPROPOSAL-PLANT = '0000'.
ITEMSPROPOSAL-STGE_LOC = '0000'.
APPEND ITEMSPROPOSAL.
CALL FUNCTION 'BAPI_HU_CREATE'
EXPORTING
HEADERPROPOSAL = HEADERPROPOSAL
IMPORTING
HUHEADER = HUHEADER
HUKEY = HUKEY
TABLES
ITEMSPROPOSAL = ITEMSPROPOSAL
RETURN = RETURN
HUITEM = HUITEM.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
* Assigning HU to delivery
HUHEADER-PACK_MAT_OBJECT = '01'. "Outbound delivery
HUHEADER-PACK_MAT_OBJ_KEY = '0080002891'. "Delivery no
CALL FUNCTION 'BAPI_HU_CHANGE_HEADER'
EXPORTING
HUKEY = HUKEY
HUCHANGED = HUHEADER
IMPORTING
HUHEADER = HUHEADER
TABLES
RETURN = RETURN.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
* Packing delivery
DATA: LS_VBKOK_WA TYPE VBKOK,
LT_PROT TYPE TABLE OF PROTT,
LT_REHANG TYPE TABLE OF HUM_REHANG_HU,
LT_REHANG_WA TYPE HUM_REHANG_HU.
LS_VBKOK_WA-VBELN = '0080002891'.
LS_VBKOK_WA-WABUC = 'X'.
LS_VBKOK_WA-VBELN_VL = '0080002891'.
LS_VBKOK_WA-VBTYP_VL = '7'.
LOOP AT HUITEM.
LT_REHANG_WA-VENUM = HUHEADER-HU_ID.
LT_REHANG_WA-VEPOS = HUITEM-HU_ITEM_NUMBER.
LT_REHANG_WA-RFBEL = '0080002891'.
LT_REHANG_WA-RFPOS = '000010'.
APPEND LT_REHANG_WA TO LT_REHANG.
ENDLOOP.
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
VBKOK_WA = LS_VBKOK_WA
SYNCHRON = 'X'
COMMIT = 'X'
DELIVERY = '0080002891'
NICHT_SPERREN = space
TABLES
PROT = LT_PROT
IT_HANDLING_UNITS = LT_REHANG.
Krzys
11-04-2005 11:24 PM
Krzys,
I had tried out this, but it is giving me an error 'Handling unit is already being used in XXXXXXXX'. When I checked out XXXXXXXX delivery note, I didnt see any handling units. I didnt get enough time to debug but it doesnt matter what parameters I supply I always get the same error.
Thanks,
Sudeep
11-07-2005 2:08 AM
Actually BAPI_HU_CREATE is creating a handling unit, but the BAPI_HU_CHANGE_HEADER is not linking the HU with the delivery note.
Thanks,
Sudeep
11-07-2005 9:38 PM
Hi,
Do you have any error messages from BAPI_HU_CHANGE_HEADER ?
Krzys
11-08-2005 2:08 AM
The error is same 'HU functions outside of the delivery only'. I checked OSS and found that BAPI_HU_CHANGE_HEADER cannot be used for assigning HUs.
11-21-2005 11:52 AM
Hi
You should use WS_DELIVERY_UPDATE for doing that. This FM could create HUs and assign those HUs to a delivery. I'm not sure, but i think it's possible to pack items into created HUs ussingn this FM.
I can provide you an example on how to create a HU an assigning to a delivery with WS_DELIVERY_UPDATE. Unfortunately, i haven't any example about packing with this FM.
Regards
11-22-2005 10:34 PM
Can you give me that example for assigning HU to outbound delivery?
11-24-2005 8:24 AM
Here is the code
vbkok_wa-vbeln = '0187000063'.
vbkok_wa-wabuc = 'X'.
vbkok_wa-vbeln_vl = '0187000063'.
vbkok_wa-vbtyp_vl = 'J'.
i_verko-vstel = 'PE01'.
i_verko-vhilm = p_matnr.
i_verko-exida = 'E'.
i_verko-brgew = p_weight.
i_verko-werks = p_werks.
i_verko-lgort = p_lgort.
i_verko-object = '01'.
i_verko-objkey = '0187000063'.
APPEND i_verko.
CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
vbkok_wa = vbkok_wa
synchron = 'X'
NO_MESSAGES_UPDATE = ' '
commit = 'X'
delivery = '0187000063'
UPDATE_PICKING = ' '
nicht_sperren = ' '
IF_CONFIRM_CENTRAL = ' '
IF_WMPP = ' '
IF_GET_DELIVERY_BUFFERED = ' '
IF_NO_GENERIC_SYSTEM_SERVICE = ' '
IF_DATABASE_UPDATE = '1'
IF_NO_INIT = ' '
IF_NO_READ = ' '
IF_ERROR_MESSAGES_SEND_0 = 'X'
IF_NO_BUFFER_REFRESH = ' '
IF_NO_MES_UPD_PACK = ' '
IMPORTING
EF_ERROR_ANY_0 =
EF_ERROR_IN_ITEM_DELETION_0 =
EF_ERROR_IN_POD_UPDATE_0 =
EF_ERROR_IN_INTERFACE_0 =
EF_ERROR_IN_GOODS_ISSUE_0 =
EF_ERROR_IN_FINAL_CHECK_0 =
TABLES
VBPOK_TAB =
prot = i_prott
verko_tab = i_verko
VERPO_TAB =
VBSUPCON_TAB =
IT_VERPO_SERNR =
IT_PACKING =
IT_PACKING_SERNR =
IT_REPACK =
IT_HANDLING_UNITS =
et_created_hus = i_hus.
I hope this example will be useful for you.
Regards