# BAPI_SERVICE_CHANGE — Change Service Master Record

> Changes the basic data, descriptions and long texts of an existing service master record (AC02). Developers use it in mass update programs that keep the service catalog in sync with an external source. Only fields flagged with 'X' in IM_SERVICE_DATAX are updated; the SERVICE_DESCRIPTION table is mandatory, so try it with TESTRUN and then call BAPI_TRANSACTION_COMMIT.

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

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| SERVICENUMBER | BAPISRV_ASMD-SERVICE | Service number | Yes |
| IM_SERVICE_DATA | BAPISRV_ASMD | Service master data | - |
| IM_SERVICE_DATAX | BAPISRV_ASMDX | Service master data change flags | - |
| TESTRUN | BAPIFLAG-BAPIFLAG | Test run (no update) | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| EX_SERVICE_DATA | BAPISRV_ASMD | Saved service master data |
| EX_SERVICE_DATAX | BAPISRV_ASMDX | Saved field flags |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| SERVICE_DESCRIPTION | BAPISRV_ASMDT | Service short texts (by language) | Yes |
| SERVICE_LONG_TEXTS | BAPISRV_TEXT | Service long texts | - |
| EXTENSION_IN | BAPIPAREX | Customer extension fields (input) | - |
| EXTENSION_OUT | BAPIPAREX | Customer extension fields (output) | - |
| RETURN | BAPIRET2 | Return messages | Yes |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_SERVICE_CHANGE'
  EXPORTING
    servicenumber = lv_servicenumber
  IMPORTING
    ex_service_data = lv_ex_service_data
    ex_service_datax = lv_ex_service_datax
  TABLES
    service_description = lt_service_description
    service_long_texts = lt_service_long_texts
    extension_in = lt_extension_in
    extension_out = lt_extension_out
    return = lt_return.
```

## Related tables

ASMD

