SAP Function Modules

SAP_WAPI_CREATE_EVENT SAP Function module - Workflow Interfaces: Create Event (BOR)







SAP_WAPI_CREATE_EVENT is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name SAP_WAPI_CREATE_EVENT into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SWRR
Released Date: 14.01.2009
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM SAP_WAPI_CREATE_EVENT - SAP WAPI CREATE EVENT





CALL FUNCTION 'SAP_WAPI_CREATE_EVENT' "Workflow Interfaces: Create Event (BOR)
  EXPORTING
    object_type =               " swr_struct-object_typ  Business Object Repository object type
    object_key =                " swr_struct-object_key  Business Object Repository object key
    event =                     " swr_struct-event  Event
*   commit_work = 'X'           " swr_struct-commitflag  Do not trigger "Commit Work" at end
*   event_language = SY-LANGU   " sy-langu      Event language
*   language = SY-LANGU         " sylangu       SAP System, Current Language
*   user = SY-UNAME             " syuname       ABAP System, User Logon Name
*   ifs_xml_container =         " xstring       Event Container as XML Data Stream
  IMPORTING
    return_code =               " sy-subrc      Return code (0 - 3, 999)
    event_id =                  " swr_struct-event_id  Event ID
* TABLES
*   input_container =           " swr_cont      Input container (name-value pairs)
*   message_lines =             " swr_messag    Message Lines
*   message_struct =            " swr_mstruc    Message Structure
    .  "  SAP_WAPI_CREATE_EVENT

ABAP code example for Function Module SAP_WAPI_CREATE_EVENT





The ABAP code below is a full code listing to execute function module SAP_WAPI_CREATE_EVENT including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_return_code  TYPE SY-SUBRC ,
ld_event_id  TYPE SWR_STRUCT-EVENT_ID ,
it_input_container  TYPE STANDARD TABLE OF SWR_CONT,"TABLES PARAM
wa_input_container  LIKE LINE OF it_input_container ,
it_message_lines  TYPE STANDARD TABLE OF SWR_MESSAG,"TABLES PARAM
wa_message_lines  LIKE LINE OF it_message_lines ,
it_message_struct  TYPE STANDARD TABLE OF SWR_MSTRUC,"TABLES PARAM
wa_message_struct  LIKE LINE OF it_message_struct .


DATA(ld_object_type) = some text here

DATA(ld_object_key) = some text here

DATA(ld_event) = some text here

DATA(ld_commit_work) = some text here
DATA(ld_event_language) = 'Check type of data required'.
DATA(ld_language) = 'Check type of data required'.
DATA(ld_user) = 'some text here'.
DATA(ld_ifs_xml_container) = 'some text here'.

"populate fields of struture and append to itab
append wa_input_container to it_input_container.

"populate fields of struture and append to itab
append wa_message_lines to it_message_lines.

"populate fields of struture and append to itab
append wa_message_struct to it_message_struct. . CALL FUNCTION 'SAP_WAPI_CREATE_EVENT' EXPORTING object_type = ld_object_type object_key = ld_object_key event = ld_event * commit_work = ld_commit_work * event_language = ld_event_language * language = ld_language * user = ld_user * ifs_xml_container = ld_ifs_xml_container IMPORTING return_code = ld_return_code event_id = ld_event_id * TABLES * input_container = it_input_container * message_lines = it_message_lines * message_struct = it_message_struct . " SAP_WAPI_CREATE_EVENT
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_return_code  TYPE SY-SUBRC ,
ld_object_type  TYPE SWR_STRUCT-OBJECT_TYP ,
it_input_container  TYPE STANDARD TABLE OF SWR_CONT ,
wa_input_container  LIKE LINE OF it_input_container,
ld_event_id  TYPE SWR_STRUCT-EVENT_ID ,
ld_object_key  TYPE SWR_STRUCT-OBJECT_KEY ,
it_message_lines  TYPE STANDARD TABLE OF SWR_MESSAG ,
wa_message_lines  LIKE LINE OF it_message_lines,
ld_event  TYPE SWR_STRUCT-EVENT ,
it_message_struct  TYPE STANDARD TABLE OF SWR_MSTRUC ,
wa_message_struct  LIKE LINE OF it_message_struct,
ld_commit_work  TYPE SWR_STRUCT-COMMITFLAG ,
ld_event_language  TYPE SY-LANGU ,
ld_language  TYPE SYLANGU ,
ld_user  TYPE SYUNAME ,
ld_ifs_xml_container  TYPE XSTRING .


ld_object_type = some text here

"populate fields of struture and append to itab
append wa_input_container to it_input_container.

ld_object_key = some text here

"populate fields of struture and append to itab
append wa_message_lines to it_message_lines.

ld_event = some text here

"populate fields of struture and append to itab
append wa_message_struct to it_message_struct.

ld_commit_work = some text here
ld_event_language = 'Check type of data required'.
ld_language = 'Check type of data required'.
ld_user = 'some text here'.
ld_ifs_xml_container = 'some text here'.

SAP Documentation for FM SAP_WAPI_CREATE_EVENT


An event is generated for a business object.
The object is identified using parameters OBJECT_TYPE and ...See here for full SAP fm documentation







Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name SAP_WAPI_CREATE_EVENT or its description.