Skip to Content
0
Former Member
Jul 20, 2009 at 12:34 PM

Trigger the Event

28 Views

Hello Everybody,

I am trying to trigger the WF with the FM SWE_EVENT_CREATE but its not getting triggering the event.

When I use SWUE its working.

Can someone tell me whats wrong with this code -

DATA: GR_EVENT_ID LIKE SWEDUMEVID-EVTID,
      CREATOR     LIKE SWHACTOR.

      CREATOR-OTYPE = 'US'.
      CREATOR-OBJID = 'DEVELOPER'.

CALL FUNCTION 'SWE_EVENT_CREATE'
  EXPORTING
    OBJTYPE    = 'BUS21O5'
    OBJKEY     = '0010001439'
    EVENT      = 'CHANGED'
    CREATOR    = CREATOR
    DEBUG_FLAG = 'X'
  IMPORTING
    EVENT_ID   = GR_EVENT_ID.
IF SY-SUBRC = 0.
  WRITE: / 'Event created with ID :',GR_EVENT_ID.
  WRITE: / 'Workflow is Started'.
  T_CHAR-CHAR = 'Workflow is Started'.
ELSE.
  WRITE: / 'Event Id is not generated and Work Flow is not started'.
  T_CHAR-CHAR = 'Event Id is not generated and Work Flow is not started'.
ENDIF.

Thanks,

Sneha Singh.