# BAPI_MATPHYSINV_GETDETAIL — Read Physical Inventory Document Details

> Returns the header data and items of a physical inventory document (material, storage location, batch, book and counted quantity, difference status). It is used in programs that print count lists, send items to handheld terminals for counting or analyse differences. Pass the document number together with the fiscal year; posting the differences after counting is a separate step.

- Modules: MM
- Type: BAPI
- Function group: MB_BUS2028
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/bapi-matphysinv-getdetail/

## ABAP Cloud and clean core status

Not to be released for ABAP Cloud (MM-IM). SAP does not release this object for ABAP Cloud. It keeps working in classic ABAP; in ABAP Cloud and clean core development use the successor below.

- Use instead in ABAP Cloud: I_PHYSICALINVENTORYDOCUMENTTP

Source: SAP's list of released objects (S/4HANA Cloud Private Edition, latest), SAP Cloudification Repository (https://github.com/SAP/abap-atc-cr-cv-s4hc)

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| PHYSINVENTORY | IKPF-IBLNR | Physical inventory document | Yes |
| FISCALYEAR | IKPF-GJAHR | Fiscal year | Yes |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| HEAD | BAPI_PHYSINV_HEAD | Document header |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| ITEMS | BAPI_PHYSINV_ITEM | Document items | - |
| RETURN | BAPIRET2 | Return messages | Yes |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_MATPHYSINV_GETDETAIL'
  EXPORTING
    physinventory = lv_physinventory
    fiscalyear = lv_fiscalyear
  IMPORTING
    head = lv_head
  TABLES
    items = lt_items
    return = lt_return.
```

## Related tables

IKPF, ISEG

