Help with triggering event

Leonardo Araujo leonardo.araujo.b at bayer.com
Wed May 16 09:07:44 EDT 2001


two points to be considered:
 
1 - Check the log. (Transaction SWEL). Is the event being raised?
2 - If not, check my logic below. Try to use this function instead. Don't forget
COMMIT WORK.
*---------------------------------------------------------------------*
form call_function.
  loop at xvbak.
    move xvbak-vbeln to doc_nr.
    call function 'SWE_EVENT_CREATE'
         exporting
              objtype              = 'ZBUS2032'
              objkey               = doc_nr
              event                = 'IDOCORDERCREATED'
*         CREATOR              = ' '
*         START_WITH_DELAY     = ' '
*         START_RECFB_SYNCHRON = ' '
*    IMPORTING
*         EVENT_ID             =
         tables
              event_container      = xswcont
         exceptions
              objtype_not_found    = 1
              others               = 2.
    commit work.
 
    perform print_list.
 
  endloop.
endform.
 
 
Leonardo Araujo
Bayer Inc.
Canada
 
 
 
 
 
 
 
 
"Odedra, Menand" <MOdedra at krafteurope.com>@MITVMA.MIT.EDU> on 05/16/2001
03:58:48 AM
 
Please respond to "SAP Workflow Users' Group" <SAP-WUG at MITVMA.MIT.EDU>
 
Sent by:  SAP Workflow <Owner-SAP-WUG at MITVMA.MIT.EDU>
 
 
To:   SAP-WUG at MITVMA.MIT.EDU
cc:
 
Subject:  Help with triggering event
 
 
Hello All
 
I`m attempting to trigger a workflow using a triggering event.
 
I`ve defined the event 'ZCREATE' as an event of my object type 'Z_PA22_OBJ'.
I`ve got a screen that simply raises the event using SWE_EVENT_CREATE.  When
I go into the code in debug mode I always get an sy-subrc = 0.
However the workflow is not kicked off.
 
I`ve attached the code I`m using to the bottom of this message.
Any help with this would be much appreciated.
 
 
SELECT MAX( PA22_NO ) FROM ZPA22HDR INTO PA22_NO.
IF SY-SUBRC = 0.
  ZPA22HDR-PA22_NO = PA22_NO + 1.
ELSE.
  ZPA22HDR-PA22_NO = 1.
ENDIF.
 
CASE OKCODE.
  WHEN 'DONE'.
    CALL FUNCTION 'SWE_EVENT_CREATE'
         EXPORTING
              OBJTYPE                 = 'Z_PA22_OBJ'
              OBJKEY                  = 'PA22_NO'
              EVENT                   = 'ZCREATE'.
*             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         =
*        EXCEPTIONS
*             OBJTYPE_NOT_FOUND       = 1
*             OTHERS                  = 2
 
IF SY-SUBRC = 0.
  SET SCREEN 0.
  LEAVE SCREEN.
ENDIF.
 
 
Regards
 
Menand Odedra
Kraft Foods UK
Analyst Programmer (Supply Chain)
email: modedra at krafteurope.com
Tel: 01242 28 4748
 


More information about the SAP-WUG mailing list