# CSAP_MAT_BOM_DELETE — Delete Material BOM

> Deletes a material BOM for a material, plant, usage and alternative. It is used in master data clean-up programs. Pass a change number when the deletion must be traceable, and handle the ERROR exception when the BOM is still used or does not exist.

- Modules: PP
- Type: Function module
- Function group: CSAP
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/csap-mat-bom-delete/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| MATERIAL | CSAP_MBOM-MATNR | Material number | Yes |
| PLANT | CSAP_MBOM-WERKS | Plant | - |
| BOM_USAGE | CSAP_MBOM-STLAN | BOM usage | Yes |
| ALTERNATIVE | CSAP_MBOM-STLAL | Alternative BOM | - |
| VALID_FROM | CSAP_MBOM-DATUV | Valid-from date | - |
| CHANGE_NO | CSAP_MBOM-AENNR | Change number | - |
| FL_COMMIT_AND_WAIT | CAPIFLAG-COMM_WAIT | Commit and wait for update | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| FL_WARNING | CAPIFLAG-FLWARNING | Log contains warnings |

## Exceptions

- ERROR: Error occurred (see log)

## Call template (ABAP)

```abap
CALL FUNCTION 'CSAP_MAT_BOM_DELETE'
  EXPORTING
    material = lv_material
    bom_usage = lv_bom_usage
  IMPORTING
    fl_warning = lv_fl_warning
  EXCEPTIONS
    error = 1
    OTHERS = 2.
```

## Related tables

MAST, STKO

