Antwort: Triggering WF from ABAP
michael.klika@de.pwcglobal.com
michael.klika at de.pwcglobal.com
Wed Jan 10 10:53:36 EST 2001
hi karsten!
im sure there is a solution for your problem, but you should think at first
about the technique you dont wanted to use...
pro's of event-triggered workflow:
- process is analog to usually started wf's
- you can analyse the logfile for the event and get messages about possible
errors
- you see exactly what information is handed to the workflow itself and whether
its started correctly
- it follows the idea of modularity
hope this helps a bit :-)
regards, michael
ps: here's an example for event-raising: (sorry, comments are german),
dank und gruss an willigerd ;-)
* Objekttyp vereinbaren
D_OBJTYP = 'BUS1001'.
* Container-Datenstruktur anlegen
swc_container d_container.
* Container-Datenstruktur initialisieren
swc_create_container d_container.
* definitions for event-call
D_EREIGNIS = 'Mat1stCreWithPlant'.
* Werte in Container schreiben
SWC_SET_ELEMENT D_CONTAINER 'Werk' WMARC-WERKS.
SWC_SET_ELEMENT D_CONTAINER 'Sparte' WMARA-ZZMSPART.
SWC_SET_ELEMENT D_CONTAINER 'Ekgrp' WMARA-ZZMEKGRP.
* Schluessel definieren
D_OBJKEY = WMARA-MATNR.
* raise event
CALL FUNCTION 'EVENT_CREATE_IN_UPDATE_TASK'
EXPORTING
OBJTYPE = D_OBJTYP
OBJKEY = D_OBJKEY
EVENT = D_EREIGNIS
* CREATOR = ' '
* TAKE_WORKITEM_REQUESTER = ' '
* start_with_delay = 'X'
* start_recfb_synchron = ' '
* debug_flag = 'X'
* importing
* EVENT_ID =
TABLES
EVENT_CONTAINER = D_CONTAINER
* 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.
ENDIF
----------------------------------------------------------------
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you
received this in error, please contact the sender and delete the material
from any computer.
More information about the SAP-WUG
mailing list