# BAPI_MATPHYSINV_COUNT — Enter Physical Inventory Count

> Enters count results (MI04) for selected items of an existing physical inventory document. Developers use it in interfaces that transfer counted quantities from handhelds, RF devices or external warehouse systems. Match items by document item number, set the zero-count indicator where needed, and call BAPI_TRANSACTION_COMMIT after checking RETURN; posting the differences 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-count/

## 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 |
| PERCENTAGE_VARIANCE | IIKPF-ABWEI | Percentage variance of count to book quantity | - |
| COUNT_DATE | IIKPF-ZLDAT | Count date | - |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| ITEMS | BAPI_PHYSINV_COUNT_ITEMS | Items to enter the count for | Yes |
| SERIALNUMBERS | BAPI_PHYSINV_SERIALNUMBERS | Serial numbers | - |
| EXTENSIONIN | BAPIPAREX | Customer extension fields | - |
| RETURN | BAPIRET2 | Return messages | Yes |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_MATPHYSINV_COUNT'
  EXPORTING
    physinventory = lv_physinventory
    fiscalyear = lv_fiscalyear
  TABLES
    items = lt_items
    serialnumbers = lt_serialnumbers
    extensionin = lt_extensionin
    return = lt_return.
```

## Related tables

IKPF, ISEG

