Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

HU_PACKING_AND_UNPACKING - HU not found

FilipSt
Explorer
0 Kudos

Hello,

here is short description of my problem:

1. HU is beeing created with HU02 transaction (I can seen relevant entries in table VEKP with SE16)

2. My task is to pack an inbound delivery materials into previously created HU. It is supposed to work similar to LM71 transaction (entering delivery no) or LM24 (entering plant, sor. loc etc). I have tried PROCESS_HU_INBOUND_DLVRY, but I am not sure if that was a good choice (had to feed it with many parameters I did not know). Then I have found HU_PACKING_AND_UNPACKING and it seems to be the perfect FM to do the job ... but it does not work. Every time I try to run it (even in test mode of SE37) I get the same error message: "HU into which you want to pack could not be found". I have tried to enter VENUM, EXIDV and both with or without leading zeros. Any ideas what's wrong? I know that the problem is in fact caused by FM V51P_FIND_HEADER which does not work ... it tries to read some data from internal table gt_xvekp ... but this table is empty

Please let me know if HU_PACKING_AND_UNPACKING is the right FM to do the job and what I have to do to make it work.

Regards,

FS

1 ACCEPTED SOLUTION

maciej_domagaa
Contributor

>

> I know that the problem is in fact caused by FM V51P_FIND_HEADER which does not work ... it tries to read some data from internal table gt_xvekp ... but this table is empty

Befre you can use these modules you must first call fm HU_GET_HUS - this way you populate the internal table gt_xvekp.

regards

9 REPLIES 9

maciej_domagaa
Contributor

>

> I know that the problem is in fact caused by FM V51P_FIND_HEADER which does not work ... it tries to read some data from internal table gt_xvekp ... but this table is empty

Befre you can use these modules you must first call fm HU_GET_HUS - this way you populate the internal table gt_xvekp.

regards

0 Kudos

Hi,

tried with HU_GET_HUS and it gave me ET_HEADER and other results (do I need them?) ... but it did not help to solve the problem. I've tried to feed HU_PACKING_AND_UNPACKING CS_HEADER with ET_HEADER which causes HUGENERAL089: "Handling unit xxxxxxxx was not blocked - action cancelled" ... any ideas?

Regards,

FS

0 Kudos

Check parameter IF_LOCK_HUS of fm HU_GET_HUS.

Check also module HU_INITIALIZE_PACKING. Generally try using modules from function group V51E instead of directly calling modules from group V51P. Check if there is one that suits your requirement (maybe HU_CREATE_ITEM).

After you finish processing call fm HU_POST to save the data in database.

regards

FilipSt
Explorer
0 Kudos

Hello,

thank you again for tips. I did another step but am still far from calling it a day. 'HU_GET_HUS' works fine, no HUGENERAL089 error, but now 'HU_PACKING_AND_UNPACKING' throws' Packing not possible since there is no quantity to be packed' as you can see below I am filling QUANTITY with value ... any ideas?

Here is my code (excerpt) maybe it will help you to find some errors:


CALL FUNCTION 'HU_GET_HUS'
  EXPORTING
*   IF_OBJECT                =
*   IF_NO_DB_SELECT          = ' '
    IF_LOCK_HUS              = 'X'
*   IF_WITH_TEXT             = ' '
*   IF_NO_LOOP               = 'X'
*   IF_MORE_HUS              =
*   IS_OBJECTS               =
*   IT_OBJECTS               =
*   IT_HUS                   =
    IT_VENUM                 = LT_VENOM
*   IT_HANDLE                =
*   IF_MARA_PACKMITTEL       = ' '
  IMPORTING
    ET_HEADER                = lwa_header
*   ET_ITEMS                 =
*   ET_ITEM_SERIALNO         =
*   ET_HISTORY               =
*   ET_HIGHEST_LEVELS        =
*   ET_MESSAGES              =
 EXCEPTIONS
   HUS_LOCKED               = 1
   NO_HU_FOUND              = 2
   FATAL_ERROR              = 3
   OTHERS                   = 4


lwa_packing_request-VENUM = '184'.
lwa_packing_request-VELIN = '1'.
lwa_packing_request-QUANTITY = '10'.
*lwa_packing_request-BELNR = '180000101'.
*lwa_packing_request-POSNR = '10'.
lwa_packing_request-VEANZ = '1'. 
lwa_packing_request-MATNR = '1000000-000001'.
lwa_packing_request-WERKS = 'X001'.
lwa_packing_request-LGORT = '1010'.
lwa_packing_request-LGNUM = 'X01'.
lwa_packing_request-LGTYP = 'A01'.
lwa_packing_request-LGPLA = '4500000056'.

CALL FUNCTION 'HU_PACKING_AND_UNPACKING'
  EXPORTING
*    IF_REPACK                = 'X'
    is_packing_request       = lwa_packing_request
  IMPORTING
    EF_RCODE                 = lv_rcode
    ES_P_REQUEST             = lwa_e_packing_item_hu
    ES_ITEM                  = lwa_es_item
  CHANGING
    CS_HEADER                = lwa_header
  EXCEPTIONS
    MISSING_DATA             = 1
    HU_NOT_CHANGEABLE        = 2
    NOT_POSSIBLE             = 3
    CUSTOMIZING              = 4
    WEIGHT                   = 5
    VOLUME                   = 6
    SERIAL_NR                = 7
    FATAL_ERROR              = 8
    OTHERS                   = 9

0 Kudos

Try to fill MEINS / ALTME fields.

0 Kudos

Hi,

it is working! HU_INITIALIZE_PACKING helped (did not realize it before, because had some typing errors in IT_VENUM. There is one more problem. My program created another position in VEPO for the same MATNR which already existed. Items added with my sample coding and FM sum up in one position, and items created with LM71 in other. MATNR, VBELN etc are the same Any idea why?

Thank you,

F

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hello most learned heros.

I am in need of help.

I have a case where I need to maintain the lines of an existing HU that is tied to an existing outbound delivery.  I need to be able to remove existing HU lines, Create new HU lines, and change the Qty on existing HU lines.

I have spent the last week experimenting with the FMs that are suggested to be used, but have been unsuccessful.   I have tried several ways to use both WS_DELIVERY_UPDATE and also tried using HU_PACKING_AND_UNPACKING.

Is it possible to outline exactly what I need to do in order to do all three?  My thinking is that I will need to do the following...

1) pull the existing HU into global data using HU_GET_HUS  (seems to run OK)

2) adjust qty using HU_PACKING_AND_UNPACKING within a loop (keeps giving me "not possible").

3) post changes using HU_Post.

I am at my wit's end.  Please help!

johnT.

former_member724697
Discoverer
0 Kudos

Hello All, does this work? I am facing the same issue. Please help.