Skip to Content
author's profile photo Former Member
Former Member

Packing Delivery

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 04, 2005 at 02: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?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 04, 2005 at 06: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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Nov 07, 2005 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 08, 2005 at 02: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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.