SAP L_TO_CREATE_TR Function Module for Create a transfer order for transfer requirement
L_TO_CREATE_TR is a standard l to create tr 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 transfer requirement 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 tr FM, simply by entering the name L_TO_CREATE_TR 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_TR 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_TR'"Create a transfer order for transfer requirement.
EXPORTING
I_LGNUM = "Warehouse number
* 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
* I_RSNUM = ' ' "Reservation
* I_LDEST_LANG = ' ' "Spool: Long device names
* IT_TRITE = "
I_TBNUM = "Transfer requirement number
* I_REFNR = ' ' "Reference number
* I_SQUIT = ' ' "Immed.confirmat.
* I_NIDRU = ' ' "Do not print
* I_DRUKZ = ' ' "Print code
* I_LDEST = ' ' "Printer
* I_TBELI = ' ' "
* I_NOSPL = ' ' "No TO split
IMPORTING
E_TANUM = "Transfer order number
E_TEILK = "
TABLES
* T_LTAK = "
* T_LTAP_VB = "
* T_WMGRP_MSG = "
EXCEPTIONS
FOREIGN_LOCK = 1 UPDATE_WITHOUT_COMMIT = 10 NO_AUTHORITY = 11 PREALLOCATED_STOCK = 12 PARTIAL_TRANSFER_REQ_FORBIDDEN = 13 INPUT_ERROR = 14 QM_RELEVANT = 2 TR_COMPLETED = 3 XFELD_WRONG = 4 LDEST_WRONG = 5 DRUKZ_WRONG = 6 TR_WRONG = 7 SQUIT_FORBIDDEN = 8 NO_TO_CREATED = 9
IMPORTING Parameters details for L_TO_CREATE_TR
I_LGNUM - Warehouse number
Data type: LTAK-LGNUMOptional: No
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)
I_RSNUM - Reservation
Data type: LTAK-RSNUMDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_LDEST_LANG - Spool: Long device names
Data type: TSP03L-LNAMEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IT_TRITE -
Data type: L03B_TRITE_TOptional: Yes
Call by Reference: No ( called with pass by value option)
I_TBNUM - Transfer requirement number
Data type: LTAK-TBNUMOptional: 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_TBELI -
Data type: RL03T-TBELIDefault: 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)
EXPORTING Parameters details for L_TO_CREATE_TR
E_TANUM - Transfer order number
Data type: LTAK-TANUMOptional: No
Call by Reference: No ( called with pass by value option)
E_TEILK -
Data type: T340D-TEILVOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for L_TO_CREATE_TR
T_LTAK -
Data type: LTAK_VBOptional: Yes
Call by Reference: No ( called with pass by value option)
T_LTAP_VB -
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)
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)
PREALLOCATED_STOCK - Material is pre-allocated
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
PARTIAL_TRANSFER_REQ_FORBIDDEN -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INPUT_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
QM_RELEVANT - TR is resevant for QSS
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TR_COMPLETED - TR is already fully supplied
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)
TR_WRONG - TR 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_TR 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_update_task | TYPE RL03A-VERBU, " SPACE | |||
| lv_update_without_commit | TYPE RL03A, " | |||
| lv_no_authority | TYPE RL03A, " | |||
| lv_i_commit_work | TYPE RL03B-COMIT, " 'X' | |||
| lv_i_bname | TYPE LTAK-BNAME, " SY-UNAME | |||
| lv_preallocated_stock | TYPE LTAK, " | |||
| lv_i_teilk | TYPE T340D-TEILV, " SPACE | |||
| lv_partial_transfer_req_forbidden | TYPE T340D, " | |||
| lv_i_solex | TYPE LTAK-SOLEX, " 0 | |||
| lv_input_error | TYPE LTAK, " | |||
| lv_i_pernr | TYPE LTAK-PERNR, " 0 | |||
| lv_i_rsnum | TYPE LTAK-RSNUM, " SPACE | |||
| lv_i_ldest_lang | TYPE TSP03L-LNAME, " SPACE | |||
| lv_it_trite | TYPE L03B_TRITE_T, " | |||
| lv_e_teilk | TYPE T340D-TEILV, " | |||
| lv_i_tbnum | TYPE LTAK-TBNUM, " | |||
| lt_t_ltap_vb | TYPE STANDARD TABLE OF LTAP_VB, " | |||
| lv_qm_relevant | TYPE LTAP_VB, " | |||
| lv_i_refnr | TYPE LTAK-REFNR, " SPACE | |||
| lt_t_wmgrp_msg | TYPE STANDARD TABLE OF WMGRP_MSG, " | |||
| lv_tr_completed | 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_tr_wrong | TYPE LTAP, " | |||
| lv_i_tbeli | TYPE RL03T-TBELI, " SPACE | |||
| lv_squit_forbidden | TYPE RL03T, " | |||
| lv_i_nospl | TYPE RL03A-NOSPL, " SPACE | |||
| lv_no_to_created | TYPE RL03A. " |
|   CALL FUNCTION 'L_TO_CREATE_TR' "Create a transfer order for transfer requirement |
| EXPORTING | ||
| I_LGNUM | = lv_i_lgnum | |
| 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 | |
| I_RSNUM | = lv_i_rsnum | |
| I_LDEST_LANG | = lv_i_ldest_lang | |
| IT_TRITE | = lv_it_trite | |
| I_TBNUM | = lv_i_tbnum | |
| 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_TBELI | = lv_i_tbeli | |
| I_NOSPL | = lv_i_nospl | |
| 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 | ||
| UPDATE_WITHOUT_COMMIT = 10 | ||
| NO_AUTHORITY = 11 | ||
| PREALLOCATED_STOCK = 12 | ||
| PARTIAL_TRANSFER_REQ_FORBIDDEN = 13 | ||
| INPUT_ERROR = 14 | ||
| QM_RELEVANT = 2 | ||
| TR_COMPLETED = 3 | ||
| XFELD_WRONG = 4 | ||
| LDEST_WRONG = 5 | ||
| DRUKZ_WRONG = 6 | ||
| TR_WRONG = 7 | ||
| SQUIT_FORBIDDEN = 8 | ||
| NO_TO_CREATED = 9 | ||
| . " L_TO_CREATE_TR | ||
ABAP code using 7.40 inline data declarations to call FM L_TO_CREATE_TR
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 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 RSNUM FROM LTAK INTO @DATA(ld_i_rsnum). | ||||
| DATA(ld_i_rsnum) | = ' '. | |||
| "SELECT single LNAME FROM TSP03L INTO @DATA(ld_i_ldest_lang). | ||||
| DATA(ld_i_ldest_lang) | = ' '. | |||
| "SELECT single TEILV FROM T340D INTO @DATA(ld_e_teilk). | ||||
| "SELECT single TBNUM FROM LTAK INTO @DATA(ld_i_tbnum). | ||||
| "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 TBELI FROM RL03T INTO @DATA(ld_i_tbeli). | ||||
| DATA(ld_i_tbeli) | = ' '. | |||
| "SELECT single NOSPL FROM RL03A INTO @DATA(ld_i_nospl). | ||||
| DATA(ld_i_nospl) | = ' '. | |||
Search for further information about these or an SAP related objects