Fonction SAP BAPI_HU_CREATE - Create handling unit with items

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
HEADERPROPOSAL BAPIHUHDRPROPOSAL u 520 Default Data for Creating a Handling Unit

Paramètre Reférence Type Long. Description
HUHEADER BAPIHUHEADER u 724 Handling Unit Header Data
HUKEY BAPIHUKEY-HU_EXID C 20 External Handling Unit Identification

Paramètre Reférence Long. Facultatif Description
HUITEM BAPIHUITEM 384 X Table of Handling Unit Items that Were Created
ITEMSPROPOSAL BAPIHUITMPROPOSAL 236 X Default Tables for the Item to Be Created
ITEMSSERIALNO BAPIHUITMSERIALNO 96 X Serial Numbers for HU Items
RETURN BAPIRET2 548 Return parameter

Functionality
This text similar to function module text BAPI_HU_CREATE IS_HEADER_PROPO
SAL
You can use this method to create non-assigned handling units withoutstock information. These handling units may also be created with items,if you like. Serial numbers can also be included for each handling-unititem at this point.
You can also create nested handling units by accessing this method morethan once.

Example

Example 1:
Creating a non-assigned handling unit with packagingmaterial PALLET with a "Planned HU" physical status:
RESET N1
HEADERPROPOSAL: pack_mat = 'PALETTE'
,,,,,,,, hu_status_init,,= 'A'.

Example 2:
Following access of the above method (example 1), the return parameterHUKEY returns the ID of the handling unit that was created in the KEY =ID1 field. To pack the handling unit that was just created in anotherhandling unit, call up the BAPI_HU_CREATE method again with thefollowing import parameters:
IHEADERPROPOSAL: pack_mat = 'CONTAINER'
ITEMPROPOS AL: hu_item_type = '3'
,,,,,,,, lower_level_key = ID1
You have now created a nested handling unit (a pallet inside acontainer).

Further information
For a more exact description of how a parameter is to be filled in,refer to the documentation for the parameter in question.

Description
This structure returns the handling-unit header data that was created.

Description
Key of the instance that was created. You must use this key in order tofurther process the handling unit that was created.

Description
This text is similar to function module BAPI_HU_CREATE IS_HEADER_PROPOSA
L
Proposal for creating a handling unit header.
The fields that were specified are described below:
HU_STATUS_INIT: You can choose the status of handling units thatcontain no stock: planned = A, implemented = B and in warehouse = C. Ifthe parameters are left blank, handling units are created with a statusof "planned".
PACK_MAT: Mandatory-entry field - packaging material for the handlingunit that is to be created.
PACK_MAT_CUSTOMER: Customer's packaging material; this value can beoptionally specified and will be transferred without being checked.
HU_EXID: Field that identifies the handling unit. If no number isentered, a number is taken from the number range interval that was setin Customizing. Otherwise, the number that was specified is checkedagainst the number assignment that was set in Customizing. The numbermust refer to an external number-range interval.
TOTAL_WGHT, LOAD_WGHT, TARE_WGHT, UNIT_OF_WT_ISO, UNIT_OF_WT,ALLOWED_WGHT, MAX_UNIT_OF_WGHT_ISO, MAX_UNIT_OF_WGHT, WGHT_VOL_FIX,TOTAL_VOL, LOAD_VOL, TARE_VOL, VOLUMEUNIT_ISO, VOLUMEUNIT,ALLOWED_VOL, MAX_VOL_UNIT_ISO, MAX_VOL_UNIT, WGHT_TOL_HU, LENGTH,WIDTH, HEIGHT, UNIT_DIM_ISO, UNIT_DIM, VOL_TOL_HU:
You can include capacity data if it is available. Please note that ifthe "WGHT_VOL_FIX" field is activated, pack/unpack-weights and volumesare not figured into the loading weights and -volumes during packing orunpacking. In other words, you should only select this field if loadingweight and -volume are to be specified instead of determined.
HU_GRP1, HU_GRP2, HU_GRP3, HU_GRP4, HU_GRP5, EXT_ID_HU_2, CONTENT,PLANT, STGE_LOC:
Additional data that you can choose as additional attributes forhandling units. These are transferred without being checked.
LGTH_LOAD, LGTH_LOAD_UNIT_ISO, LGTH_LOAD_UNIT, TRAVEL_TIME,TRAVEL_TIME_UNIT_ISO, TRAVEL_TIME_UNIT, DISTANCE, UNIT_OF_DIST_ISO,UNIT_OF_DIST:
Additional data relevant for transport; if the packaging materialbelongs to the "means of transport" packaging-material type,transport-relevant data can be specified.

Description
Export table:
The item table contains all item data for the handling unit that wascreated.

Description
Text is similar to function module text BAPI_HU_CREATE IT_ITEMS_PROPOSAL
Defaults for handling-unit items.
Significance of the fields:
RESET N1
HU_ITEM_TYPE: (mandatory-entry field) Describes the item's contents.
,,,,,,,,'1' Material item
,,,,,,,,'2' Auxiliary packaging-material item
,,,,,,,,'3' Item is a handling unit
LOWER_LEVEL_KEY: Mandatory-entry field for items that are handlingunits. If an existing HU is to be packed in the HU that is beingcreated (HU_ITEM_TYPE = 3), the ID of the existing handling unit mustbe specified either in this field or in the LOWER_LEVEL_ID field.
MATERIAL: Mandatory-entry field for material items and auxiliarypackaging-material items.
PACK_QTY: May only be set for material items and describes the quantitythat is to be packed in the base unit of measure. Mandatory-entry fieldfor material items.
BASE_UNIT_QTY_ISO, BASE_UNIT_QTY: Base unit of measure for thematerial. It is checked against the material master and changed, ifnecessary.
PLANT: Plant in which the material is found. Mandatory-entry field formaterial items and auxiliary packaging-material items.
NUMBER_PACK_MAT: May only be set for auxiliary packaging-material itemsand describes the number of packaging materials in the base unit ofmeasure for the item. Mandatory-entry field for auxiliarypackaging-material items.
BATCH: Only for material items. The batch must be specified formaterials subject to batch management.
NO_OF_SERIAL_NUMBERS: If you are dealing with serialized materials, theserial numbers can be specified as the items are created. If serialnumbers are specified in the IT_SERIAL_NR table, the number of serialnumbers that are specified must appear in this field.
FLAG_SUPLMT_ITEM: Indicates that the item is an auxiliarypackaging-material item. This field is transferred without beingchecked.

Description
Text similar to function module text BAPI_HU_CREATE IT_ITEMS_SERIALNO
Serial numbers for material items that require serial numbers.
ROW_INDEX: Refers to the rows of the materials that need serial numbersin the ITEMSPROPOSAL import table.
SERIALNO: Serial number
Note: If serial numbers are specified for a material that requiresthem, the corresponding item in the ITEMSPROPOSAL import table must bespecified with a plant (PLANT field) and the value of theNO_OF_SERIAL_NUMBERS field must be equal to the number of serialnumbers.
Example:
Import table ITEMSPROPOSAL, record 1:
,,,,,,,,HU_ITEM_TYPE ='1'
,,,,,,,,MATERIAL = 'Serialmaterial1'
,,,,,,,,PLANT = 'Plant1'
,,,,,,,,PACK_QTY = 2
,,,,,,,,NO_OF_SERIAL_NUMBERS = 2.
Import table ITEMSSERIALNO, record 1:
,,,,,,,,ROW_INDEX = 1
,,,,,,,,SERIALNO = '10'
Import table ITEMSSERIALNO, record 2:
,,,,,,,,ROW_INDEX = 1
,,,,,,,,SERIALNO = '11'
Note that the assignment of serial numbers to materials occurs via theROW_INDEX field. Make sure that the content of this field points to thecorrect data record of the ITEMSPROPOSAL table.

Description
Export table:
All information, warnings and errors that occurred as the functionmodule was processed are listed in the RETURN table.

1167867Debugging for handling unit BAPIs