# CSAP_MAT_BOM_READ — Display Material BOM

> Reads a material BOM with header, items and sub-items for a material, plant, usage and alternative on a given date, like CS03. It is used in reports and outbound interfaces that need one BOM level without exploding the whole structure. For multi-level explosions use CS_BOM_EXPL_MAT_V2 instead, and handle the ERROR exception when no BOM exists.

- 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-read/

## 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 | - |
| VALID_TO | CSAP_MBOM-DATUB | Valid-to date | - |
| CHANGE_NO | CSAP_MBOM-AENNR | Change number | - |

## Exporting parameters

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

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| T_STKO | STKO_API02 | BOM headers | - |
| T_STPO | STPO_API02 | BOM items | - |
| T_STPU | STPU_API01 | BOM sub-items | - |

## Exceptions

- ERROR: Error occurred (see log)

## Call template (ABAP)

```abap
CALL FUNCTION 'CSAP_MAT_BOM_READ'
  EXPORTING
    material = lv_material
    bom_usage = lv_bom_usage
  IMPORTING
    fl_warning = lv_fl_warning
  TABLES
    t_stko = lt_t_stko
    t_stpo = lt_t_stpo
    t_stpu = lt_t_stpu
  EXCEPTIONS
    error = 1
    OTHERS = 2.
```

## Related tables

MAST, STAS, STKO, STPO

