# BAPI_CUSTOMER_GETDETAIL2 — Read Customer Details

> Reads customer master data: general data, address, company code data and bank, IBAN and SEPA details. It is used in reports and interfaces that need customer information without reading the master tables directly. Pass COMPANYCODE to get company code data and use the ALPHA conversion exit for the customer number.

- Modules: SD
- Type: BAPI
- Function group: LC01
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/bapi-customer-getdetail2/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| CUSTOMERNO | BAPICUSTOMER_ID-CUSTOMER | Customer number | Yes |
| COMPANYCODE | BAPICUSTOMER_ID-COMP_CODE | Company code | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| CUSTOMERADDRESS | BAPICUSTOMER_04 | Customer address |
| CUSTOMERGENERALDETAIL | BAPICUSTOMER_KNA1 | General customer data (KNA1) |
| CUSTOMERCOMPANYDETAIL | BAPICUSTOMER_05 | Company code data |
| RETURN | BAPIRET1 | Return messages |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| CUSTOMERBANKDETAIL | BAPICUSTOMER_02 | Bank details | - |
| CUSTOMERIBANDETAIL | BAPICUSTOMER_03 | IBAN details | - |
| CUSTOMERSEPADETAIL | BAPICUSTOMER_06 | SEPA mandate details | - |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_CUSTOMER_GETDETAIL2'
  EXPORTING
    customerno = lv_customerno
  IMPORTING
    customeraddress = lv_customeraddress
    customergeneraldetail = lv_customergeneraldetail
    customercompanydetail = lv_customercompanydetail
    return = lv_return
  TABLES
    customerbankdetail = lt_customerbankdetail
    customeribandetail = lt_customeribandetail
    customersepadetail = lt_customersepadetail.
```

## Related tables

ADRC, KNA1, KNB1, KNBK

