SAP Function Modules

L_TO_CREATE_TR SAP Function module - Create a transfer order for transfer requirement







L_TO_CREATE_TR is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name L_TO_CREATE_TR into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: L03B
Released Date: 19.04.1995
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM L_TO_CREATE_TR - L TO CREATE TR





CALL FUNCTION 'L_TO_CREATE_TR' "Create a transfer order for transfer requirement
  EXPORTING
    i_lgnum =                   " ltak-lgnum    Warehouse number
    i_tbnum =                   " ltak-tbnum    Transfer requirement number
*   i_refnr = SPACE             " ltak-refnr    Reference number
*   i_squit = SPACE             " rl03t-squit   Immed.confirmat.
*   i_nidru = SPACE             " rl03a-nidru   Do not print
*   i_drukz = SPACE             " t329f-drukz   Print code
*   i_ldest = SPACE             " ltap-ldest    Printer
*   i_tbeli = SPACE             " rl03t-tbeli
*   i_nospl = SPACE             " rl03a-nospl   No TO split
*   i_update_task = SPACE       " rl03a-verbu   Indicator: update via update task
*   i_commit_work = 'X'         " rl03b-comit   Indicator whether COMMIT WORK in function module
*   i_bname = SY-UNAME          " ltak-bname    User who is generating the TO
*   i_teilk = SPACE             " t340d-teilv   Partial picking allowed
*   i_solex = 0                 " ltak-solex    Planned Transfer Order Processing Time from External System
*   i_pernr = 0                 " ltak-pernr    Personnel Number
*   i_rsnum = SPACE             " ltak-rsnum    Reservation
*   i_ldest_lang = SPACE        " tsp03l-lname  Spool: Long device names
*   it_trite =                  " l03b_trite_t
  IMPORTING
    e_tanum =                   " ltak-tanum    Transfer order number
    e_teilk =                   " t340d-teilv
* TABLES
*   t_ltak =                    " ltak_vb
*   t_ltap_vb =                 " ltap_vb
*   t_wmgrp_msg =               " wmgrp_msg
  EXCEPTIONS
    FOREIGN_LOCK = 1            "               An SAP block has been set by another user
    QM_RELEVANT = 2             "               TR is resevant for QSS
    TR_COMPLETED = 3            "               TR is already fully supplied
    XFELD_WRONG = 4             "               Incorrect value for checkbox
    LDEST_WRONG = 5             "               Printer does not exist
    DRUKZ_WRONG = 6             "               Print code does not exist
    TR_WRONG = 7                "               TR does not exist
    SQUIT_FORBIDDEN = 8         "               Immediate conf.not allowed for movement type
    NO_TO_CREATED = 9           "               No TO generated
    UPDATE_WITHOUT_COMMIT = 10  "               Update via update task only using Commit
    NO_AUTHORITY = 11           "               No authorization
    PREALLOCATED_STOCK = 12     "               Material is pre-allocated
    PARTIAL_TRANSFER_REQ_FORBIDDEN = 13  "
    INPUT_ERROR = 14            "
    .  "  L_TO_CREATE_TR

ABAP code example for Function Module L_TO_CREATE_TR





The ABAP code below is a full code listing to execute function module L_TO_CREATE_TR including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_e_tanum  TYPE LTAK-TANUM ,
ld_e_teilk  TYPE T340D-TEILV ,
it_t_ltak  TYPE STANDARD TABLE OF LTAK_VB,"TABLES PARAM
wa_t_ltak  LIKE LINE OF it_t_ltak ,
it_t_ltap_vb  TYPE STANDARD TABLE OF LTAP_VB,"TABLES PARAM
wa_t_ltap_vb  LIKE LINE OF it_t_ltap_vb ,
it_t_wmgrp_msg  TYPE STANDARD TABLE OF WMGRP_MSG,"TABLES PARAM
wa_t_wmgrp_msg  LIKE LINE OF it_t_wmgrp_msg .


SELECT single LGNUM
FROM LTAK
INTO @DATA(ld_i_lgnum).


SELECT single TBNUM
FROM LTAK
INTO @DATA(ld_i_tbnum).


SELECT single REFNR
FROM LTAK
INTO @DATA(ld_i_refnr).


DATA(ld_i_squit) = some text here

DATA(ld_i_nidru) = some text here

SELECT single DRUKZ
FROM T329F
INTO @DATA(ld_i_drukz).


SELECT single LDEST
FROM LTAP
INTO @DATA(ld_i_ldest).


DATA(ld_i_tbeli) = some text here

DATA(ld_i_nospl) = some text here

DATA(ld_i_update_task) = some text here

DATA(ld_i_commit_work) = some text here

SELECT single BNAME
FROM LTAK
INTO @DATA(ld_i_bname).


SELECT single TEILV
FROM T340D
INTO @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).


SELECT single LNAME
FROM TSP03L
INTO @DATA(ld_i_ldest_lang).

DATA(ld_it_trite) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_ltak to it_t_ltak.

"populate fields of struture and append to itab
append wa_t_ltap_vb to it_t_ltap_vb.

"populate fields of struture and append to itab
append wa_t_wmgrp_msg to it_t_wmgrp_msg. . CALL FUNCTION 'L_TO_CREATE_TR' EXPORTING i_lgnum = ld_i_lgnum i_tbnum = ld_i_tbnum * i_refnr = ld_i_refnr * i_squit = ld_i_squit * i_nidru = ld_i_nidru * i_drukz = ld_i_drukz * i_ldest = ld_i_ldest * i_tbeli = ld_i_tbeli * i_nospl = ld_i_nospl * i_update_task = ld_i_update_task * i_commit_work = ld_i_commit_work * i_bname = ld_i_bname * i_teilk = ld_i_teilk * i_solex = ld_i_solex * i_pernr = ld_i_pernr * i_rsnum = ld_i_rsnum * i_ldest_lang = ld_i_ldest_lang * it_trite = ld_it_trite IMPORTING e_tanum = ld_e_tanum e_teilk = ld_e_teilk * TABLES * t_ltak = it_t_ltak * t_ltap_vb = it_t_ltap_vb * t_wmgrp_msg = it_t_wmgrp_msg EXCEPTIONS FOREIGN_LOCK = 1 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 UPDATE_WITHOUT_COMMIT = 10 NO_AUTHORITY = 11 PREALLOCATED_STOCK = 12 PARTIAL_TRANSFER_REQ_FORBIDDEN = 13 INPUT_ERROR = 14 . " L_TO_CREATE_TR
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 12. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 13. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 14. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_e_tanum  TYPE LTAK-TANUM ,
ld_i_lgnum  TYPE LTAK-LGNUM ,
it_t_ltak  TYPE STANDARD TABLE OF LTAK_VB ,
wa_t_ltak  LIKE LINE OF it_t_ltak,
it_t_ltap_vb  TYPE STANDARD TABLE OF LTAP_VB ,
wa_t_ltap_vb  LIKE LINE OF it_t_ltap_vb,
ld_i_tbnum  TYPE LTAK-TBNUM ,
ld_e_teilk  TYPE T340D-TEILV ,
ld_i_refnr  TYPE LTAK-REFNR ,
it_t_wmgrp_msg  TYPE STANDARD TABLE OF WMGRP_MSG ,
wa_t_wmgrp_msg  LIKE LINE OF it_t_wmgrp_msg,
ld_i_squit  TYPE RL03T-SQUIT ,
ld_i_nidru  TYPE RL03A-NIDRU ,
ld_i_drukz  TYPE T329F-DRUKZ ,
ld_i_ldest  TYPE LTAP-LDEST ,
ld_i_tbeli  TYPE RL03T-TBELI ,
ld_i_nospl  TYPE RL03A-NOSPL ,
ld_i_update_task  TYPE RL03A-VERBU ,
ld_i_commit_work  TYPE RL03B-COMIT ,
ld_i_bname  TYPE LTAK-BNAME ,
ld_i_teilk  TYPE T340D-TEILV ,
ld_i_solex  TYPE LTAK-SOLEX ,
ld_i_pernr  TYPE LTAK-PERNR ,
ld_i_rsnum  TYPE LTAK-RSNUM ,
ld_i_ldest_lang  TYPE TSP03L-LNAME ,
ld_it_trite  TYPE L03B_TRITE_T .


SELECT single LGNUM
FROM LTAK
INTO ld_i_lgnum.


"populate fields of struture and append to itab
append wa_t_ltak to it_t_ltak.

"populate fields of struture and append to itab
append wa_t_ltap_vb to it_t_ltap_vb.

SELECT single TBNUM
FROM LTAK
INTO ld_i_tbnum.


SELECT single REFNR
FROM LTAK
INTO ld_i_refnr.


"populate fields of struture and append to itab
append wa_t_wmgrp_msg to it_t_wmgrp_msg.

ld_i_squit = some text here

ld_i_nidru = some text here

SELECT single DRUKZ
FROM T329F
INTO ld_i_drukz.


SELECT single LDEST
FROM LTAP
INTO ld_i_ldest.


ld_i_tbeli = some text here

ld_i_nospl = some text here

ld_i_update_task = some text here

ld_i_commit_work = some text here

SELECT single BNAME
FROM LTAK
INTO ld_i_bname.


SELECT single TEILV
FROM T340D
INTO ld_i_teilk.


SELECT single SOLEX
FROM LTAK
INTO ld_i_solex.


SELECT single PERNR
FROM LTAK
INTO ld_i_pernr.


SELECT single RSNUM
FROM LTAK
INTO ld_i_rsnum.


SELECT single LNAME
FROM TSP03L
INTO ld_i_ldest_lang.

ld_it_trite = 'Check type of data required'.

SAP Documentation for FM L_TO_CREATE_TR


With this function module you can create a transfer order for a transfer requirement. For more information, refer to the detailed ...See here for full SAP fm documentation

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name L_TO_CREATE_TR or its description.