# L_TR_CANCEL — Cancel Transfer Requirement

> Cancels transfer requirement items passed in T_LTBC. It is used in clean-up programs and interfaces when a requested stock movement is no longer needed. Set I_SAVE_ONLY_ALL to avoid partial results and handle TR_LOCKED when another user is processing the requirement.

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

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| I_SAVE_ONLY_ALL | RL02A-SNWAR | Save only if all items are error-free | - |
| I_UPDATE_TASK | RL02A-VERBU | Update via update task | - |
| I_COMMIT_WORK | RL02A-COMMI | Commit inside the function | - |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| T_LTBC | LTBC | Transfer requirement items to cancel | Yes |

## Exceptions

- ITEM_ERROR: Error in an item
- NO_UPDATE_ITEM_ERROR: Not saved because of item errors
- NO_UPDATE_NO_ENTRY: Not saved: no entries
- TR_LOCKED: Transfer requirement is locked

## Call template (ABAP)

```abap
CALL FUNCTION 'L_TR_CANCEL'
  TABLES
    t_ltbc = lt_t_ltbc
  EXCEPTIONS
    item_error = 1
    no_update_item_error = 2
    no_update_no_entry = 3
    tr_locked = 4
    OTHERS = 5.
```

## Related tables

LTBK, LTBP

