# BAPI_AR_ACC_GETSTATEMENT — Customer Account Statement for a Period

> Returns all line items posted to a customer account in a company code within a date range. Typical uses are customer portals, account statement printouts and collection tools. Pass the customer number with leading zeros and set NOTEDITEMS if noted items such as down payment requests are needed.

- Modules: FI
- Type: BAPI
- Function group: 3007
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/bapi-ar-acc-getstatement/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| COMPANYCODE | BAPI3007_1-COMP_CODE | Company code | Yes |
| CUSTOMER | BAPI3007_1-CUSTOMER | Customer | Yes |
| DATE_FROM | BAPI3007-FROM_DATE | Date from | Yes |
| DATE_TO | BAPI3007-TO_DATE | Date to | Yes |
| NOTEDITEMS | BAPI3007-NTDITMS_RQ | Include noted items | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| RETURN | BAPIRETURN | Return message |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| LINEITEMS | BAPI3007_2 | Line items | Yes |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_AR_ACC_GETSTATEMENT'
  EXPORTING
    companycode = lv_companycode
    customer = lv_customer
    date_from = lv_date_from
    date_to = lv_date_to
  IMPORTING
    return = lv_return
  TABLES
    lineitems = lt_lineitems.
```

## Related tables

BSAD, BSID

