hi everyone,
I am using the following code to trigger the 'CREATED' event which is in custom object type 'ZBUSORD'. I have specified the code in a method using enhancement concept which will get triggered while saving the document. I had put breakpoint on the below function module and executed the service order creation. While saving the service order it comes to debugging mode, and the variable 'KEY' having the service order number. So, everything has been passed correctly. But the event is not getting triggered in SWEL. But while executing the triggering code alone in se38 the event is getting triggered. I am still analyzing it for long time.
DATA: KEY type SWEINSTCOU-OBJKEY.
DATA: EVT_CONT TYPE TABLE OF SWCONT.
KEY = ms_header_detail-vbeln.
IF SY-SUBRC = 0.
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = 'ZBUSORD'
objkey = KEY
event = 'CREATED'
CREATOR = ' '
TAKE_WORKITEM_REQUESTER = ' '
START_WITH_DELAY = ' '
START_RECFB_SYNCHRON = ' '
NO_COMMIT_FOR_QUEUE = ' '
DEBUG_FLAG = ' '
NO_LOGGING = ' '
IDENT =
IMPORTING
EVENT_ID =
TABLES
EVENT_CONTAINER = EVT_CONT
EXCEPTIONS
OBJTYPE_NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ELSE.
*WRITE 'Event Triggered'.
ENDIF.
COMMIT WORK.
ENDIF.
Thanks in advance!!