# L_TO_CREATE_SINGLE — Create Transfer Order with One Item

> Creates a transfer order with one item for a material, plant, quantity and WM movement type, like LT01; source and destination can be given or determined by the warehouse strategies. It is widely used in RF transactions and custom putaway or replenishment programs. The function commits by default (I_COMMIT_WORK), so set it to space inside a larger LUW, and evaluate the classic exceptions with sy-subrc and the system message fields.

- Modules: WM
- Type: Function module
- Function group: L03B
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/l-to-create-single/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| I_LGNUM | LTAK-LGNUM | Warehouse number | Yes |
| I_BWLVS | LTAK-BWLVS | WM movement type | Yes |
| I_MATNR | LTAP-MATNR | Material number | Yes |
| I_WERKS | LTAP-WERKS | Plant | Yes |
| I_ANFME | RL03T-ANFME | Requested quantity | Yes |
| I_ALTME | LTAP-ALTME | Unit of measure | Yes |
| I_LGORT | LTAP-LGORT | Storage location | - |
| I_CHARG | LTAP-CHARG | Batch | - |
| I_VLTYP | LTAP-VLTYP | Source storage type | - |
| I_VLPLA | LTAP-VLPLA | Source storage bin | - |
| I_NLTYP | LTAP-NLTYP | Destination storage type | - |
| I_NLPLA | LTAP-NLPLA | Destination storage bin | - |
| I_SQUIT | RL03T-SQUIT | Confirm immediately | - |
| I_COMMIT_WORK | RL03B-COMIT | Commit inside the function | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| E_TANUM | LTAK-TANUM | Created transfer order number |
| E_LTAP | LTAP | Created transfer order item |

## Exceptions

- NO_TO_CREATED: No transfer order created
- MATERIAL_NOT_FOUND: Material not found
- BWLVS_WRONG: Invalid WM movement type
- VLTYP_WRONG: Invalid source storage type
- VLPLA_WRONG: Invalid source storage bin
- NLTYP_WRONG: Invalid destination storage type
- NLPLA_WRONG: Invalid destination storage bin
- VLTYP_MISSING: Source storage type missing
- NLTYP_MISSING: Destination storage type missing
- SQUIT_FORBIDDEN: Immediate confirmation not allowed
- MANUAL_TO_FORBIDDEN: Manual transfer order not allowed
- FOREIGN_LOCK: Object locked by another user
- NO_AUTHORITY: No authorization
- UPDATE_WITHOUT_COMMIT: Update task used without commit

## Call template (ABAP)

```abap
CALL FUNCTION 'L_TO_CREATE_SINGLE'
  EXPORTING
    i_lgnum = lv_i_lgnum
    i_bwlvs = lv_i_bwlvs
    i_matnr = lv_i_matnr
    i_werks = lv_i_werks
    i_anfme = lv_i_anfme
    i_altme = lv_i_altme
  IMPORTING
    e_tanum = lv_e_tanum
    e_ltap = lv_e_ltap
  EXCEPTIONS
    no_to_created = 1
    material_not_found = 2
    bwlvs_wrong = 3
    vltyp_wrong = 4
    vlpla_wrong = 5
    nltyp_wrong = 6
    nlpla_wrong = 7
    vltyp_missing = 8
    OTHERS = 9.
```

## Related tables

LAGP, LQUA, LTAK, LTAP

