SAP L_TO_CREATE_DN Function Module for Create a transfer order for delivery note
L_TO_CREATE_DN is a standard l to create dn SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create a transfer order for delivery note 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 l to create dn FM, simply by entering the name L_TO_CREATE_DN into the relevant SAP transaction such as SE37 or SE38.
Function Group: L03B
Program Name: SAPLL03B
Main Program: SAPLL03B
Appliation area: L
Release date: 19-Apr-1995
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function L_TO_CREATE_DN 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 'L_TO_CREATE_DN'"Create a transfer order for delivery note.
EXPORTING
I_LGNUM = "Warehouse number
* I_EINTA = ' ' "Processing for putaway transfer order
* I_NOSPL = ' ' "No TO split
* I_UPDATE_TASK = ' ' "Indicator: update via update task
* I_COMMIT_WORK = 'X' "Indicator whether COMMIT WORK in function module
* I_BNAME = SY-UNAME "User who is generating the TO
* I_TEILK = ' ' "Partial picking allowed
* I_SOLEX = 0 "Planned Transfer Order Processing Time from External System
* I_PERNR = 0 "Personnel Number
* IT_DELIT = "Partial creation: Details
I_VBELN = "Delivery Note Number
* I_REFNR = ' ' "Reference number
* I_SQUIT = ' ' "Immed.confirmat.
* I_NIDRU = ' ' "Do not print
* I_DRUKZ = ' ' "Print code
* I_LDEST = ' ' "Printer
* I_KOMIM = ' ' "Copy pick quantities into delivery / Post GI
* I_EINLM = ' ' "Copy putaway quantities into delivery / post GR
IMPORTING
E_TANUM = "Transfer order number
E_TEILK = "Partial pick executed
TABLES
* T_LTAK = "Table of created TO headers
* T_LTAP_VB = "Table of created TO items
* T_WMGRP_MSG = "
EXCEPTIONS
FOREIGN_LOCK = 1 TEILK_WRONG = 10 UPDATE_WITHOUT_COMMIT = 11 NO_AUTHORITY = 12 NO_PICKING_ALLOWED = 13 DN_HU_NOT_CHOOSABLE = 14 INPUT_ERROR = 15 DN_COMPLETED = 2 PARTIAL_DELIVERY_FORBIDDEN = 3 XFELD_WRONG = 4 LDEST_WRONG = 5 DRUKZ_WRONG = 6 DN_WRONG = 7 SQUIT_FORBIDDEN = 8 NO_TO_CREATED = 9
IMPORTING Parameters details for L_TO_CREATE_DN
I_LGNUM - Warehouse number
Data type: LTAK-LGNUMOptional: No
Call by Reference: No ( called with pass by value option)
I_EINTA - Processing for putaway transfer order
Data type: RL03T-EINTADefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_NOSPL - No TO split
Data type: RL03A-NOSPLDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_UPDATE_TASK - Indicator: update via update task
Data type: RL03A-VERBUDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_COMMIT_WORK - Indicator whether COMMIT WORK in function module
Data type: RL03B-COMITDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_BNAME - User who is generating the TO
Data type: LTAK-BNAMEDefault: SY-UNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_TEILK - Partial picking allowed
Data type: T340D-TEILVDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SOLEX - Planned Transfer Order Processing Time from External System
Data type: LTAK-SOLEXOptional: Yes
Call by Reference: No ( called with pass by value option)
I_PERNR - Personnel Number
Data type: LTAK-PERNROptional: Yes
Call by Reference: No ( called with pass by value option)
IT_DELIT - Partial creation: Details
Data type: L03B_DELIT_TOptional: Yes
Call by Reference: No ( called with pass by value option)
I_VBELN - Delivery Note Number
Data type: LTAK-VBELNOptional: No
Call by Reference: No ( called with pass by value option)
I_REFNR - Reference number
Data type: LTAK-REFNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_SQUIT - Immed.confirmat.
Data type: RL03T-SQUITDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_NIDRU - Do not print
Data type: RL03A-NIDRUDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_DRUKZ - Print code
Data type: T329F-DRUKZDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_LDEST - Printer
Data type: LTAP-LDESTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_KOMIM - Copy pick quantities into delivery / Post GI
Data type: RL03T-KOMIMDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_EINLM - Copy putaway quantities into delivery / post GR
Data type: RL03T-EINLMDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for L_TO_CREATE_DN
E_TANUM - Transfer order number
Data type: LTAK-TANUMOptional: No
Call by Reference: No ( called with pass by value option)
E_TEILK - Partial pick executed
Data type: T340D-TEILVOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for L_TO_CREATE_DN
T_LTAK - Table of created TO headers
Data type: LTAK_VBOptional: Yes
Call by Reference: No ( called with pass by value option)
T_LTAP_VB - Table of created TO items
Data type: LTAP_VBOptional: Yes
Call by Reference: No ( called with pass by value option)
T_WMGRP_MSG -
Data type: WMGRP_MSGOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
FOREIGN_LOCK - An SAP block has been set by another user
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TEILK_WRONG - Partial picking not allowed in warehouse
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UPDATE_WITHOUT_COMMIT - Update via update task only using Commit
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_AUTHORITY - No authorization
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_PICKING_ALLOWED - Picking not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DN_HU_NOT_CHOOSABLE - TO for delivery items or HU not clear
Data type:Optional: No
Call by Reference: Yes
INPUT_ERROR - Missing item entry
Data type:Optional: No
Call by Reference: Yes
DN_COMPLETED - Delivery note does not contain any open items
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
PARTIAL_DELIVERY_FORBIDDEN - Delivery note must be picked for entire qty
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
XFELD_WRONG - Incorrect value for checkbox
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LDEST_WRONG - Printer does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DRUKZ_WRONG - Print code does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DN_WRONG - Delivery note does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SQUIT_FORBIDDEN - Immediate conf.not allowed for movement type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_TO_CREATED - No TO generated
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for L_TO_CREATE_DN 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: | ||||
| lt_t_ltak | TYPE STANDARD TABLE OF LTAK_VB, " | |||
| lv_e_tanum | TYPE LTAK-TANUM, " | |||
| lv_i_lgnum | TYPE LTAK-LGNUM, " | |||
| lv_foreign_lock | TYPE LTAK, " | |||
| lv_i_einta | TYPE RL03T-EINTA, " SPACE | |||
| lv_teilk_wrong | TYPE RL03T, " | |||
| lv_i_nospl | TYPE RL03A-NOSPL, " SPACE | |||
| lv_update_without_commit | TYPE RL03A, " | |||
| lv_no_authority | TYPE RL03A, " | |||
| lv_i_update_task | TYPE RL03A-VERBU, " SPACE | |||
| lv_i_commit_work | TYPE RL03B-COMIT, " 'X' | |||
| lv_no_picking_allowed | TYPE RL03B, " | |||
| lv_i_bname | TYPE LTAK-BNAME, " SY-UNAME | |||
| lv_dn_hu_not_choosable | TYPE LTAK, " | |||
| lv_i_teilk | TYPE T340D-TEILV, " SPACE | |||
| lv_input_error | TYPE T340D, " | |||
| lv_i_solex | TYPE LTAK-SOLEX, " 0 | |||
| lv_i_pernr | TYPE LTAK-PERNR, " 0 | |||
| lv_it_delit | TYPE L03B_DELIT_T, " | |||
| lv_e_teilk | TYPE T340D-TEILV, " | |||
| lv_i_vbeln | TYPE LTAK-VBELN, " | |||
| lt_t_ltap_vb | TYPE STANDARD TABLE OF LTAP_VB, " | |||
| lv_dn_completed | TYPE LTAP_VB, " | |||
| lv_i_refnr | TYPE LTAK-REFNR, " SPACE | |||
| lt_t_wmgrp_msg | TYPE STANDARD TABLE OF WMGRP_MSG, " | |||
| lv_partial_delivery_forbidden | TYPE WMGRP_MSG, " | |||
| lv_i_squit | TYPE RL03T-SQUIT, " SPACE | |||
| lv_xfeld_wrong | TYPE RL03T, " | |||
| lv_i_nidru | TYPE RL03A-NIDRU, " SPACE | |||
| lv_ldest_wrong | TYPE RL03A, " | |||
| lv_i_drukz | TYPE T329F-DRUKZ, " SPACE | |||
| lv_drukz_wrong | TYPE T329F, " | |||
| lv_i_ldest | TYPE LTAP-LDEST, " SPACE | |||
| lv_dn_wrong | TYPE LTAP, " | |||
| lv_i_komim | TYPE RL03T-KOMIM, " SPACE | |||
| lv_squit_forbidden | TYPE RL03T, " | |||
| lv_i_einlm | TYPE RL03T-EINLM, " SPACE | |||
| lv_no_to_created | TYPE RL03T. " |
|   CALL FUNCTION 'L_TO_CREATE_DN' "Create a transfer order for delivery note |
| EXPORTING | ||
| I_LGNUM | = lv_i_lgnum | |
| I_EINTA | = lv_i_einta | |
| I_NOSPL | = lv_i_nospl | |
| I_UPDATE_TASK | = lv_i_update_task | |
| I_COMMIT_WORK | = lv_i_commit_work | |
| I_BNAME | = lv_i_bname | |
| I_TEILK | = lv_i_teilk | |
| I_SOLEX | = lv_i_solex | |
| I_PERNR | = lv_i_pernr | |
| IT_DELIT | = lv_it_delit | |
| I_VBELN | = lv_i_vbeln | |
| I_REFNR | = lv_i_refnr | |
| I_SQUIT | = lv_i_squit | |
| I_NIDRU | = lv_i_nidru | |
| I_DRUKZ | = lv_i_drukz | |
| I_LDEST | = lv_i_ldest | |
| I_KOMIM | = lv_i_komim | |
| I_EINLM | = lv_i_einlm | |
| IMPORTING | ||
| E_TANUM | = lv_e_tanum | |
| E_TEILK | = lv_e_teilk | |
| TABLES | ||
| T_LTAK | = lt_t_ltak | |
| T_LTAP_VB | = lt_t_ltap_vb | |
| T_WMGRP_MSG | = lt_t_wmgrp_msg | |
| EXCEPTIONS | ||
| FOREIGN_LOCK = 1 | ||
| TEILK_WRONG = 10 | ||
| UPDATE_WITHOUT_COMMIT = 11 | ||
| NO_AUTHORITY = 12 | ||
| NO_PICKING_ALLOWED = 13 | ||
| DN_HU_NOT_CHOOSABLE = 14 | ||
| INPUT_ERROR = 15 | ||
| DN_COMPLETED = 2 | ||
| PARTIAL_DELIVERY_FORBIDDEN = 3 | ||
| XFELD_WRONG = 4 | ||
| LDEST_WRONG = 5 | ||
| DRUKZ_WRONG = 6 | ||
| DN_WRONG = 7 | ||
| SQUIT_FORBIDDEN = 8 | ||
| NO_TO_CREATED = 9 | ||
| . " L_TO_CREATE_DN | ||
ABAP code using 7.40 inline data declarations to call FM L_TO_CREATE_DN
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 TANUM FROM LTAK INTO @DATA(ld_e_tanum). | ||||
| "SELECT single LGNUM FROM LTAK INTO @DATA(ld_i_lgnum). | ||||
| "SELECT single EINTA FROM RL03T INTO @DATA(ld_i_einta). | ||||
| DATA(ld_i_einta) | = ' '. | |||
| "SELECT single NOSPL FROM RL03A INTO @DATA(ld_i_nospl). | ||||
| DATA(ld_i_nospl) | = ' '. | |||
| "SELECT single VERBU FROM RL03A INTO @DATA(ld_i_update_task). | ||||
| DATA(ld_i_update_task) | = ' '. | |||
| "SELECT single COMIT FROM RL03B INTO @DATA(ld_i_commit_work). | ||||
| DATA(ld_i_commit_work) | = 'X'. | |||
| "SELECT single BNAME FROM LTAK INTO @DATA(ld_i_bname). | ||||
| DATA(ld_i_bname) | = SY-UNAME. | |||
| "SELECT single TEILV FROM T340D INTO @DATA(ld_i_teilk). | ||||
| DATA(ld_i_teilk) | = ' '. | |||
| "SELECT single SOLEX FROM LTAK INTO @DATA(ld_i_solex). | ||||
| "SELECT single PERNR FROM LTAK INTO @DATA(ld_i_pernr). | ||||
| "SELECT single TEILV FROM T340D INTO @DATA(ld_e_teilk). | ||||
| "SELECT single VBELN FROM LTAK INTO @DATA(ld_i_vbeln). | ||||
| "SELECT single REFNR FROM LTAK INTO @DATA(ld_i_refnr). | ||||
| DATA(ld_i_refnr) | = ' '. | |||
| "SELECT single SQUIT FROM RL03T INTO @DATA(ld_i_squit). | ||||
| DATA(ld_i_squit) | = ' '. | |||
| "SELECT single NIDRU FROM RL03A INTO @DATA(ld_i_nidru). | ||||
| DATA(ld_i_nidru) | = ' '. | |||
| "SELECT single DRUKZ FROM T329F INTO @DATA(ld_i_drukz). | ||||
| DATA(ld_i_drukz) | = ' '. | |||
| "SELECT single LDEST FROM LTAP INTO @DATA(ld_i_ldest). | ||||
| DATA(ld_i_ldest) | = ' '. | |||
| "SELECT single KOMIM FROM RL03T INTO @DATA(ld_i_komim). | ||||
| DATA(ld_i_komim) | = ' '. | |||
| "SELECT single EINLM FROM RL03T INTO @DATA(ld_i_einlm). | ||||
| DATA(ld_i_einlm) | = ' '. | |||
Search for further information about these or an SAP related objects