# BAPI_INSPLOT_SETUSAGEDECISION — Set Usage Decision

> Makes the usage decision for an inspection lot, like QA11, using the code and code group in UD_DATA, and can post the inspection stock. It is used by LIMS or automatic release programs once all results are recorded. Pass stock posting fields in UD_DATA if the stock must be moved, check RETURN and call BAPI_TRANSACTION_COMMIT.

- Modules: QM
- Type: BAPI
- Function group: 2045
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/bapi-insplot-setusagedecision/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| NUMBER | BAPI2045UD-INSPLOT | Inspection lot number | Yes |
| UD_DATA | BAPI2045UD | Usage decision data (code, code group) | Yes |
| LANGUAGE | BAPI2045LA | Language for texts | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| UD_RETURN_DATA | BAPI2045UD_RETURN | Usage decision result |
| STOCK_DATA | BAPI2045D_IL2 | Stock posting data of the decision |
| RETURN | BAPIRETURN1 | Return messages |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| SYSTEM_STATUS | BAPI2045SS | System statuses | - |
| USER_STATUS | BAPI2045US | User statuses | - |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_INSPLOT_SETUSAGEDECISION'
  EXPORTING
    number = lv_number
    ud_data = lv_ud_data
  IMPORTING
    ud_return_data = lv_ud_return_data
    stock_data = lv_stock_data
    return = lv_return
  TABLES
    system_status = lt_system_status
    user_status = lt_user_status.
```

## Related tables

JEST, QALS, QAVE

