# L_TO_CREATE_2_STEP_PICKING — Create Removal Transfer Order for Two-Step Picking

> Creates the removal transfer orders for the first step of two-step picking for a group (reference number). It is used in wave picking programs where materials are first removed for the whole group and then distributed to deliveries. The group must be relevant for two-step picking; otherwise REFNR_NOT_RELEVANT is raised.

- 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-2-step-picking/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| I_LGNUM | LTAK-LGNUM | Warehouse number | Yes |
| I_REFNR | LTAK-REFNR | Group (reference number) | Yes |
| I_BWLVS | LTAK-BWLVS | WM movement type | - |
| 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 |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| T_LTAK | LTAK_VB | Created transfer order headers | - |
| T_LTAP_VB | LTAP_VB | Created transfer order items | - |

## Exceptions

- BENUM_MISSING: Requirement number missing
- BETYP_MISSING: Requirement type missing
- BETYP_WRONG: Invalid requirement type
- BWLVS_WRONG: Invalid WM movement type
- CONTROL_FOR_REFNR_NOT_EXIST: No control data for the group
- DRUKZ_WRONG: Invalid print code
- LDEST_WRONG: Invalid printer
- MANUAL_TO_FORBIDDEN: Manual transfer order not allowed
- NO_ACTIVE_ITEM_FOUND: No active item found
- NO_AUTHORITY: No authorization
- NO_TO_CREATED: No transfer order created
- ONLY_ONE_QUANTITY_SELECTION: Only one quantity selection allowed
- REFNR_DOES_NOT_EXIST: Group does not exist
- REFNR_LOCK: Group is locked
- REFNR_NOT_RELEVANT: Group not relevant for two-step picking
- SQUIT_FORBIDDEN: Immediate confirmation not allowed
- UPDATE_WITHOUT_COMMIT: Update task used without commit
- XFELD_WRONG: Invalid indicator value

## Call template (ABAP)

```abap
CALL FUNCTION 'L_TO_CREATE_2_STEP_PICKING'
  EXPORTING
    i_lgnum = lv_i_lgnum
    i_refnr = lv_i_refnr
  IMPORTING
    e_tanum = lv_e_tanum
  TABLES
    t_ltak = lt_t_ltak
    t_ltap_vb = lt_t_ltap_vb
  EXCEPTIONS
    benum_missing = 1
    betyp_missing = 2
    betyp_wrong = 3
    bwlvs_wrong = 4
    control_for_refnr_not_exist = 5
    drukz_wrong = 6
    ldest_wrong = 7
    manual_to_forbidden = 8
    OTHERS = 9.
```

## Related tables

LTAK, LTAP

