Fonction SAP BAPI_HU_REPACK - Repack HUs and HU items

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
HEADERPROPOSAL BAPIHUHDRPROPOSAL u 520 X Default Data for Creating a Handling Unit
HUKEY BAPIHUKEY-HU_EXID C 20 External Handling Unit Identification

Paramètre Reférence Long. Facultatif Description
ITEMSSERIALNO BAPIHUITMSERIALNO 96 X Serial Number that Belongs to an HU Item (Default)
REPACK BAPIHUREPACK 171 Structure for Repacking Handling Units
RETURN BAPIRET2 548 Return Parameters

Functionality
If quantities are to be repacked from one handling unit (HU) to another(or if entire HUs are to be repacked), you can either access theHU_UNPACK und HU_PACK methods separately or accomplish the same thingin one step by using this method. However, it is not possible to changethe packed quantites with this method; you can only change the packingstructure.

Example

Example 1:
The handling unit PALLET 1 contains 9 boxes and PALLET 2 contains 7boxes. You can use this method to repack one box from PALLET 1 toPALLET 2:
Fill in the HUKEY parameter with the destination HU (PALLET 2).
The REPACK table will then contain an entry that looks like this:
1. SOURCE_HU: BOX 1
2. FLAG_PACKHU: 'X'
Example 2:
PALLET 1 contains 20 pieces of material MAT1. PALLET 2 is empty. 5pieces are to be repacked.
Fill in the HUKEY parameter with the destination HU (PALLET 2).
The REPACK table will then contain an entry that looks like this:
1. SOURCE_HU: PALLET 1
2. FLAG_PACKHU: ' '
3. PACK_QTY: 5
4. BASE_UOM: PC
5. MATERIAL: MAT1
The other stock categories of the material should also bespecified, where necessary.

Notes
When you repack handling units, the HU that is to be repacked is alwaysentered in the SOURCE_HU field. The system can tell whether this HU isalready packed and then unpacks it from its higher-level HU before itis packed in the destination HU (HUKEY).
If the handling unit in question is to become a highest-level handlingunit rather than be repacked into another handling unit, the entry inthe destination HU field should be the identical to the source HUfield.
If you want to repack into a handling unit that does not exist yet,fill in the HEADERPROPOSAL parameter and enter either "$1" or the HUidentification as the destination handling unit, under which the HU isto be created.
INCLUDE 'BAPI_HU_CREATE HEADERPROPOSAL' OBJECT DOKU ID FU

Description
Key for the instance of the handling unit that is to be edited.

Value range
Special case: You want to repack into a new HU. In this case, you canenter $1 as a key instead of an existing handling unit. Or, you couldalso enter the external number under which the HU is to be created.

Description
Serial numbers for the material items that require serial numbers.
ROW_INDEX: Refers to the line of the material that requires serialnumbers in the REPACK import table.
SERIALNO: Serial number
Note: The assignment of serial numbers to materials is made by usingthe ROW_INDEX field. Make sure that the contents of this field point tothe correct data record in the REPACK table.

Description
This table contains instructions about how items or HUs are to berepacked.
Case 1: A handling unit, BOX1, is to be packed into another HU.
SOURCE_HU = BOX1
FLAG_PACKHU = 'X'
All other fields are insignificant.
Case 2: Material MAT is to be repacked from one handling unit, PALLET1,into another handling unit.
SOURCE_HU = PALLET1
FLAG_PACKHU = ' '
MATERIAL = 'MAT'
You should fill in the following fields: BASE_UNIT,QTY_ISO, BASE_UOM,BATCH, PLANT, STGE_LOC, STOCK_CAT, SPEC_STOCK, and so on.
INCLUDE 'BAPI_HU_CREATE RETURN' OBJECT DOKU ID FU

1167867Debugging for handling unit BAPIs