Hello,

Sign up to join our community!

Welcome Back,

Please sign in to your account!

Forgot Password,

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

You must login to ask a question.

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

SAP EWM Help Latest Questions

  • 0
  • 0
basantbharti

How to Pallet Packing in SAP ECC

Related Questions

Leave an answer

Leave an answer

1 Him Answer

  1. How to Do Pallet Packing in SAP ECC (Nesting an Outer Box HU into a Pallet HU)

    Question

    I need to pack an already-built outer box (a lower-level Handling Unit) onto a pallet HU in SAP ECC using standard function modules. What’s the correct sequence, and how do I build the packing request so the box gets nested inside the pallet? Below is the approach I used.

    Answer

    The concept here is HU nesting — like Russian nesting dolls: the product sits in a box, and that box (the outer box HU) sits on a pallet (the pallet HU). This routine performs one nesting step: placing the outer box into the pallet.

    The key is to follow the standard sequence in order — Refresh → Get/Lock HUs → Pack → Post. Skipping any step (especially the refresh or the lock) is the usual cause of packing that “works once then silently fails.”

    Building the packing request (ls_pack_req):

    • venum / exidv → the target pallet HU (what you pack into)
    • sub_hu_venum / sub_hu_exidv → the content outer box HU (what gets packed)
    • pagewweight, veanz = 1 → one unit, velin = 3 → item category for HU-in-HU (packing a whole HU, not loose material)

    The four SAP standard function modules used:

    Function ModulePurpose
    HU_PACKING_REFRESHClears the HU work buffer for a clean start
    HU_GET_HUSReads and locks both HUs for exclusive access
    HU_PACKING_AND_UNPACKINGPerforms the actual packing in the buffer
    HU_POST (if_commit = 'X')Saves and commits the result to the database

    After each call, sy-subrc is checked. On failure, the SAP message is captured into the status field and the routine exits; on success, the record is stamped with status, date, time, and user.

    Code

    ls_pack_req-venum = ls_vekp_pal-venum.
    ls_pack_req-exidv = ls_vekp_pal-exidv.

    *–Fill Outerbox as lower level HU
    ls_pack_req-sub_hu_venum = ls_vekp_out-venum.
    ls_pack_req-sub_hu_exidv = ls_vekp_out-exidv.

    *–Fill quantity
    ls_pack_req-pagew = ls_pallet-pallet_wt.
    ls_pack_req-veanz = ‘1’.
    ls_pack_req-velin = ‘3’.

    ls_venom-venum = ls_vekp_out-venum.
    append ls_venom to lt_venom.
    clear ls_venom.
    ls_venom-venum = ls_vekp_pal-venum. “gs_pallet-venum.
    append ls_venom to lt_venom.
    clear ls_venom.
    *–Refresh
    call function ‘HU_PACKING_REFRESH’.
    *–Get HU headers
    call function ‘HU_GET_HUS’
    exporting
    if_object = ’04’
    if_lock_hus = ‘X’
    it_venum = lt_venom
    importing
    et_header = lt_header
    exceptions
    hus_locked = 1
    no_hu_found = 2
    fatal_error = 3
    others = 4.
    *–Do the packing
    if sy-subrc eq 0.
    call function ‘HU_PACKING_AND_UNPACKING’
    exporting
    is_packing_request = ls_pack_req
    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.

    if sy-subrc = 0.
    call function ‘HU_POST’
    exporting
    if_synchron = ‘X’
    if_commit = ‘X’.

    <lfs_data>-status = text-020.
    <lfs_data>-error_msg = text-s01.
    <lfs_data>-idate = sy-datum.
    <lfs_data>-itime = sy-uzeit.
    <lfs_data>-iuser = sy-uname.
    else.
    <lfs_data>-status = text-019.
    message id sy-msgid
    type sy-msgty
    number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
    into <lfs_data>-error_msg.
    lv_error = abap_true.
    lv_msg = <lfs_data>-error_msg.
    exit.
    endif.
    else.
    <lfs_data>-idate = sy-datum.
    <lfs_data>-itime = sy-uzeit.
    <lfs_data>-iuser = sy-uname.
    <lfs_data>-status = text-019.
    message id sy-msgid
    type sy-msgty
    number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
    into <lfs_data>-error_msg.
    lv_error = abap_true.
    lv_msg = <lfs_data>-error_msg.
    exit.
    endif.