SAP SWE_EVENT_CREATE Function Module for Generate an event (public)









SWE_EVENT_CREATE is a standard swe event create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Generate an event (public) processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for swe event create FM, simply by entering the name SWE_EVENT_CREATE into the relevant SAP transaction such as SE37 or SE38.

Function Group: SWEA
Program Name: SAPLSWEA
Main Program: SAPLSWEA
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function SWE_EVENT_CREATE pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'SWE_EVENT_CREATE'"Generate an event (public)
EXPORTING
OBJTYPE = "Type of triggering object
* NO_LOGGING = ' ' "Flag for no logging
* IDENT = "ID of event (only if previously in queue)
OBJKEY = "ID (key) of triggering object
EVENT = "Name of Event
* CREATOR = ' ' "Event creator
* TAKE_WORKITEM_REQUESTER = ' ' "Flag for using last WI as requester
* START_WITH_DELAY = ' ' "Flag for delayed start of aRFC
* START_RECFB_SYNCHRON = ' ' "Flag for synchronous call to receiver FM
* NO_COMMIT_FOR_QUEUE = ' ' "Entry in event queue without explicit COMMIT
* DEBUG_FLAG = ' ' "Flag for debugging in receiver FM

IMPORTING
EVENT_ID = "ID of triggered event
RECEIVER_COUNT = "ID of an event instance

TABLES
* EVENT_CONTAINER = "Data container of event

EXCEPTIONS
OBJTYPE_NOT_FOUND = 1
.



IMPORTING Parameters details for SWE_EVENT_CREATE

OBJTYPE - Type of triggering object

Data type: SWETYPECOU-OBJTYPE
Optional: No
Call by Reference: No ( called with pass by value option)

NO_LOGGING - Flag for no logging

Data type: SWEFLAGS-LOGFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

IDENT - ID of event (only if previously in queue)

Data type: SWEDUMEVID-EVTID
Optional: Yes
Call by Reference: No ( called with pass by value option)

OBJKEY - ID (key) of triggering object

Data type: SWEINSTCOU-OBJKEY
Optional: No
Call by Reference: No ( called with pass by value option)

EVENT - Name of Event

Data type: SWETYPECOU-EVENT
Optional: No
Call by Reference: No ( called with pass by value option)

CREATOR - Event creator

Data type: SWHACTOR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TAKE_WORKITEM_REQUESTER - Flag for using last WI as requester

Data type: SWEFLAGS-WIREQFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

START_WITH_DELAY - Flag for delayed start of aRFC

Data type: SWEFLAGS-DELAYFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

START_RECFB_SYNCHRON - Flag for synchronous call to receiver FM

Data type: SWEFLAGS-SYNCFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

NO_COMMIT_FOR_QUEUE - Entry in event queue without explicit COMMIT

Data type: SWEFLAGS-COMMITFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

DEBUG_FLAG - Flag for debugging in receiver FM

Data type: SWEFLAGS-DEBUGFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for SWE_EVENT_CREATE

EVENT_ID - ID of triggered event

Data type: SWEDUMEVID-EVTID
Optional: No
Call by Reference: No ( called with pass by value option)

RECEIVER_COUNT - ID of an event instance

Data type: SWEDUMEVID-EVTID
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for SWE_EVENT_CREATE

EVENT_CONTAINER - Data container of event

Data type: SWCONT
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

OBJTYPE_NOT_FOUND - Triggering object type not found

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for SWE_EVENT_CREATE Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_objtype  TYPE SWETYPECOU-OBJTYPE, "   
lv_event_id  TYPE SWEDUMEVID-EVTID, "   
lt_event_container  TYPE STANDARD TABLE OF SWCONT, "   
lv_objtype_not_found  TYPE SWCONT, "   
lv_no_logging  TYPE SWEFLAGS-LOGFLAG, "   SPACE
lv_ident  TYPE SWEDUMEVID-EVTID, "   
lv_objkey  TYPE SWEINSTCOU-OBJKEY, "   
lv_receiver_count  TYPE SWEDUMEVID-EVTID, "   
lv_event  TYPE SWETYPECOU-EVENT, "   
lv_creator  TYPE SWHACTOR, "   SPACE
lv_take_workitem_requester  TYPE SWEFLAGS-WIREQFLAG, "   SPACE
lv_start_with_delay  TYPE SWEFLAGS-DELAYFLAG, "   SPACE
lv_start_recfb_synchron  TYPE SWEFLAGS-SYNCFLAG, "   SPACE
lv_no_commit_for_queue  TYPE SWEFLAGS-COMMITFLAG, "   SPACE
lv_debug_flag  TYPE SWEFLAGS-DEBUGFLAG. "   SPACE

  CALL FUNCTION 'SWE_EVENT_CREATE'  "Generate an event (public)
    EXPORTING
         OBJTYPE = lv_objtype
         NO_LOGGING = lv_no_logging
         IDENT = lv_ident
         OBJKEY = lv_objkey
         EVENT = lv_event
         CREATOR = lv_creator
         TAKE_WORKITEM_REQUESTER = lv_take_workitem_requester
         START_WITH_DELAY = lv_start_with_delay
         START_RECFB_SYNCHRON = lv_start_recfb_synchron
         NO_COMMIT_FOR_QUEUE = lv_no_commit_for_queue
         DEBUG_FLAG = lv_debug_flag
    IMPORTING
         EVENT_ID = lv_event_id
         RECEIVER_COUNT = lv_receiver_count
    TABLES
         EVENT_CONTAINER = lt_event_container
    EXCEPTIONS
        OBJTYPE_NOT_FOUND = 1
. " SWE_EVENT_CREATE




ABAP code using 7.40 inline data declarations to call FM SWE_EVENT_CREATE

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single OBJTYPE FROM SWETYPECOU INTO @DATA(ld_objtype).
 
"SELECT single EVTID FROM SWEDUMEVID INTO @DATA(ld_event_id).
 
 
 
"SELECT single LOGFLAG FROM SWEFLAGS INTO @DATA(ld_no_logging).
DATA(ld_no_logging) = ' '.
 
"SELECT single EVTID FROM SWEDUMEVID INTO @DATA(ld_ident).
 
"SELECT single OBJKEY FROM SWEINSTCOU INTO @DATA(ld_objkey).
 
"SELECT single EVTID FROM SWEDUMEVID INTO @DATA(ld_receiver_count).
 
"SELECT single EVENT FROM SWETYPECOU INTO @DATA(ld_event).
 
DATA(ld_creator) = ' '.
 
"SELECT single WIREQFLAG FROM SWEFLAGS INTO @DATA(ld_take_workitem_requester).
DATA(ld_take_workitem_requester) = ' '.
 
"SELECT single DELAYFLAG FROM SWEFLAGS INTO @DATA(ld_start_with_delay).
DATA(ld_start_with_delay) = ' '.
 
"SELECT single SYNCFLAG FROM SWEFLAGS INTO @DATA(ld_start_recfb_synchron).
DATA(ld_start_recfb_synchron) = ' '.
 
"SELECT single COMMITFLAG FROM SWEFLAGS INTO @DATA(ld_no_commit_for_queue).
DATA(ld_no_commit_for_queue) = ' '.
 
"SELECT single DEBUGFLAG FROM SWEFLAGS INTO @DATA(ld_debug_flag).
DATA(ld_debug_flag) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!