MM
BAPI
RFC
Used the same way in S/4HANA
BAPI_SERVICE_CREATE Create Service Master Record
Creates a service master record (AC01) from basic data, descriptions and long texts and returns the new service number. Developers use it in programs that load service catalogs from legacy systems or spreadsheets. Set the matching flag to 'X' in IM_SERVICE_DATAX for every field you fill, try it first with TESTRUN and call BAPI_TRANSACTION_COMMIT when RETURN has no errors.
- Function group
- BASB
- Remote-enabled (RFC)
- Yes
- Type
- BAPI
Importing parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| IM_SERVICE_DATA | BAPISRV_ASMD | Service master data | Yes |
| IM_SERVICE_DATAX | BAPISRV_ASMDX | Service master data change flags | Yes |
| TESTRUN | BAPIFLAG-BAPIFLAG | Test run (no update) | — |
| NO_NUMBER_RANGE_CHECK | BAPIFLAG-BAPIFLAG | Skip number range check | — |
Exporting parameters
| Parameter | Type | Description |
|---|---|---|
| SERVICE | BAPISRV_ASMD-SERVICE | Created service number |
| 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) | — |
| 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 | — |
Call template (ABAP)
A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.
CALL FUNCTION 'BAPI_SERVICE_CREATE'
EXPORTING
im_service_data = lv_im_service_data
im_service_datax = lv_im_service_datax
IMPORTING
service = lv_service
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
Can't find the report you need?
We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.