# SD_SHIPMENT_STATUS_SET — Set Status in Shipment

> Sets one of the statuses of a shipment such as planning, check-in, loading start/end, shipment completion, shipment start/end, and runs the processing linked to that status (e.g. triggering goods issue). It is used in programs that automate the transportation flow and in handheld terminal applications. Pass the status value according to the VTTK-STTRG codes, read the log from the C_LOGFILE table and handle the STATUS_NOT_SET exception.

- Modules: SD
- Type: Function module
- Function group: V56C
- Remote-enabled (RFC): No
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/sd-shipment-status-set/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| I_TKNUM | VTTK-TKNUM | Shipment number | Yes |
| I_STATUS | VTTK-STTRG | Status to be set | Yes |
| OPT_DIALOG | RV56A-SELKZ | Run in dialog mode | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| E_SAVE_LOG | C | Save log indicator |

## Changing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| C_ERROR_WARNING_OCCURED | C | Error/warning occurred indicator | Yes |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| C_LOGFILE | SPROT_U | Processing log | Yes |

## Exceptions

- STATUS_NOT_SET: Status not set

## Call template (ABAP)

```abap
CALL FUNCTION 'SD_SHIPMENT_STATUS_SET'
  EXPORTING
    i_tknum = lv_i_tknum
    i_status = lv_i_status
  IMPORTING
    e_save_log = lv_e_save_log
  CHANGING
    c_error_warning_occured = lv_c_error_warning_occured
  TABLES
    c_logfile = lt_c_logfile
  EXCEPTIONS
    status_not_set = 1
    OTHERS = 2.
```

## Related tables

VTTK

