SAP LEINT_HU_FOR_DOCUMENTS_CREATE Function Module for Creates an HU for a reference document when required
LEINT_HU_FOR_DOCUMENTS_CREATE is a standard leint hu for documents create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Creates an HU for a reference document when required processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for leint hu for documents create FM, simply by entering the name LEINT_HU_FOR_DOCUMENTS_CREATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: LEINT_LYSRV
Program Name: SAPLLEINT_LYSRV
Main Program: SAPLLEINT_LYSRV
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function LEINT_HU_FOR_DOCUMENTS_CREATE pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'LEINT_HU_FOR_DOCUMENTS_CREATE'"Creates an HU for a reference document when required.
EXPORTING
IV_LYARD = "Yard
IV_DOCTY = "Packing Object
IV_CONT_PACK = "Packaging Materials
IV_LOG_HU_PACK = "Packaging Materials
* IF_GROUP = "General Flag
* IS_HU_HEADER = "Work Structure for Handling Unit Header
* IT_DOCUMENT = "Table type of a Range for a (10) Character Field
* IT_LIKP = "Logistic document view - table
* IT_VTTK = "Table type for shipment headers
IMPORTING
ET_HU_HEADERS = "Table Type for Handling Units
EXCEPTIONS
LOGICAL_HU_CREATION_FAILED = 1 PHYSICAL_HU_CREATION_FAILED = 2 NESTING_FAILED = 3
IMPORTING Parameters details for LEINT_HU_FOR_DOCUMENTS_CREATE
IV_LYARD - Yard
Data type: LXYRD_YARDOptional: No
Call by Reference: No ( called with pass by value option)
IV_DOCTY - Packing Object
Data type: LXYRD_RFDTYOptional: No
Call by Reference: No ( called with pass by value option)
IV_CONT_PACK - Packaging Materials
Data type: LEINT_YHU_HEADER-VHILMOptional: No
Call by Reference: No ( called with pass by value option)
IV_LOG_HU_PACK - Packaging Materials
Data type: LEINT_YHU_HEADER-VHILMOptional: No
Call by Reference: No ( called with pass by value option)
IF_GROUP - General Flag
Data type: FLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
IS_HU_HEADER - Work Structure for Handling Unit Header
Data type: LEINT_YHU_HEADEROptional: Yes
Call by Reference: No ( called with pass by value option)
IT_DOCUMENT - Table type of a Range for a (10) Character Field
Data type: LXHME_RANGE_C10_TOptional: Yes
Call by Reference: Yes
IT_LIKP - Logistic document view - table
Data type: LEINT_LIKP_TOptional: Yes
Call by Reference: Yes
IT_VTTK - Table type for shipment headers
Data type: LEINT_VTTK_TOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for LEINT_HU_FOR_DOCUMENTS_CREATE
ET_HU_HEADERS - Table Type for Handling Units
Data type: LEINT_YHU_HEADER_TOptional: No
Call by Reference: Yes
EXCEPTIONS details
LOGICAL_HU_CREATION_FAILED -
Data type:Optional: No
Call by Reference: Yes
PHYSICAL_HU_CREATION_FAILED -
Data type:Optional: No
Call by Reference: Yes
NESTING_FAILED -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for LEINT_HU_FOR_DOCUMENTS_CREATE Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_iv_lyard | TYPE LXYRD_YARD, " | |||
| lv_et_hu_headers | TYPE LEINT_YHU_HEADER_T, " | |||
| lv_logical_hu_creation_failed | TYPE LEINT_YHU_HEADER_T, " | |||
| lv_iv_docty | TYPE LXYRD_RFDTY, " | |||
| lv_physical_hu_creation_failed | TYPE LXYRD_RFDTY, " | |||
| lv_iv_cont_pack | TYPE LEINT_YHU_HEADER-VHILM, " | |||
| lv_nesting_failed | TYPE LEINT_YHU_HEADER, " | |||
| lv_iv_log_hu_pack | TYPE LEINT_YHU_HEADER-VHILM, " | |||
| lv_if_group | TYPE FLAG, " | |||
| lv_is_hu_header | TYPE LEINT_YHU_HEADER, " | |||
| lv_it_document | TYPE LXHME_RANGE_C10_T, " | |||
| lv_it_likp | TYPE LEINT_LIKP_T, " | |||
| lv_it_vttk | TYPE LEINT_VTTK_T. " |
|   CALL FUNCTION 'LEINT_HU_FOR_DOCUMENTS_CREATE' "Creates an HU for a reference document when required |
| EXPORTING | ||
| IV_LYARD | = lv_iv_lyard | |
| IV_DOCTY | = lv_iv_docty | |
| IV_CONT_PACK | = lv_iv_cont_pack | |
| IV_LOG_HU_PACK | = lv_iv_log_hu_pack | |
| IF_GROUP | = lv_if_group | |
| IS_HU_HEADER | = lv_is_hu_header | |
| IT_DOCUMENT | = lv_it_document | |
| IT_LIKP | = lv_it_likp | |
| IT_VTTK | = lv_it_vttk | |
| IMPORTING | ||
| ET_HU_HEADERS | = lv_et_hu_headers | |
| EXCEPTIONS | ||
| LOGICAL_HU_CREATION_FAILED = 1 | ||
| PHYSICAL_HU_CREATION_FAILED = 2 | ||
| NESTING_FAILED = 3 | ||
| . " LEINT_HU_FOR_DOCUMENTS_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM LEINT_HU_FOR_DOCUMENTS_CREATE
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single VHILM FROM LEINT_YHU_HEADER INTO @DATA(ld_iv_cont_pack). | ||||
| "SELECT single VHILM FROM LEINT_YHU_HEADER INTO @DATA(ld_iv_log_hu_pack). | ||||
Search for further information about these or an SAP related objects