# SAP_WAPI_CREATE_EVENT — Workflow: Create Event

> Raises a Business Workflow event for a business object or class instance, which starts every workflow linked to that event in the event type linkage (SWE2). Custom programs, user exits and BAdIs use it to trigger approval or notification workflows when data changes. Pass OBJECT_TYPE, OBJECT_KEY and EVENT, fill INPUT_CONTAINER with event parameters if needed, and set COMMIT_WORK or commit yourself; RETURN_CODE 0 means success.

- Modules: CA
- Type: Function module
- Function group: SWRR
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/sap-wapi-create-event/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| OBJECT_TYPE | SWR_STRUCT-OBJECT_TYP | Object type | Yes |
| OBJECT_KEY | SWR_STRUCT-OBJECT_KEY | Object key | Yes |
| EVENT | SWR_STRUCT-EVENT | Event | Yes |
| COMMIT_WORK | SWR_STRUCT-COMMITFLAG | Execute COMMIT WORK | - |
| EVENT_LANGUAGE | SY-LANGU | Event language | - |
| LANGUAGE | SYLANGU | Language | - |
| USER | SYUNAME | User who raises the event | - |
| IFS_XML_CONTAINER | XSTRING | Event container as XML | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| RETURN_CODE | SY-SUBRC | Return code |
| EVENT_ID | SWR_STRUCT-EVENT_ID | Event ID |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| INPUT_CONTAINER | SWR_CONT | Event parameters | - |
| MESSAGE_LINES | SWR_MESSAG | Message lines | - |
| MESSAGE_STRUCT | SWR_MSTRUC | Message structure | - |

## Call template (ABAP)

```abap
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
  EXPORTING
    object_type = lv_object_type
    object_key = lv_object_key
    event = lv_event
  IMPORTING
    return_code = lv_return_code
    event_id = lv_event_id
  TABLES
    input_container = lt_input_container
    message_lines = lt_message_lines
    message_struct = lt_message_struct.
```


