how to Pack Pallet in SAP, Please help with sample code
Sign up to join our community!
Please sign in to your account!
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
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)pagew→ weight,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:
HU_PACKING_REFRESHHU_GET_HUSHU_PACKING_AND_UNPACKINGHU_POST(if_commit = 'X')After each call,
sy-subrcis 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