AW: kick off workflow without an event
Nieder Martin
Martin.Nieder at munich-airport.de
Fri Feb 1 01:47:38 EST 2002
Hello Brian,
it is no problem to start a workflow by a Z-FM or Z-Report without =
calling
the event:
CODING:
wg_workflow =3D 'WS99200011'.
swc_create_object og_trkorr 'ZTPTRANSP' a_trkorr.
wg_handle =3D og_trkorr-handle.
CALL FUNCTION 'SWO_OBJECT_ID_GET'
EXPORTING
object =3D wg_handle
IMPORTING
* RETURN =3D
objid =3D sg_object_key.
* FILL CONTAINER *
ig_container-element =3D 'TRANSPORTAUFTRAG'.
ig_container-value =3D sg_object_key.
APPEND ig_container.
ig_container-element =3D 'SACHGEBIET'.
ig_container-value =3D a_sachgb.
APPEND ig_container.
ig_container-element =3D 'PRUEFMODUS'.
IF a_frfa =3D 'X'.
ig_container-value =3D '2'.
ELSE.
ig_container-value =3D '1'.
ENDIF.
APPEND ig_container.
ig_container-element =3D 'FREIGABEMODUS_ID'.
ig_container-value =3D a_freiid.
APPEND ig_container.
* START Workflow=20
CALL FUNCTION 'SWU_START_WORKFLOW'
EXPORTING
task =3D wg_workflow
* LANGUAGE =3D SY-LANGU
user =3D sy-uname
* SENDER_ID =3D
IMPORTING
* RETURN_CODE =3D
workitem_id =3D wg_workitem_id
TABLES
container =3D ig_container
message_lines =3D ig_message
attachment_list =3D ig_list.
LOOP AT ig_message.
....
ENDLOOP
IF NOT wg_workitem IS INTIAL
* WORKFLOW WAS NOT STARTED
...
ENDIF
Hope this helps.
Martin
-----Urspr=FCngliche Nachricht-----
Von: Brian Bennings [mailto:bennings.bj at pg.com]
Gesendet: Donnerstag, 31. Januar 2002 23:22
An: SAP-WUG at MITVMA.MIT.EDU
Betreff: kick off workflow without an event
Hello everyone,
We would like to change how our workflow is kicked off. Currently, a =
custom
transaction's code calls the SWE_EVENT_CREATE function module. We =
would
like to
instead use the SWW_WI_CREATE or SWW_WI_CREATE_SIMPLE.
Is there a way to instantiate our business object via these FM's any =
any
others
like we do with SWE_EVENT_CREATE, but without calling the event? Or =
would
we
need to do that as a subsequent step in the workflow itself?
Per the BC610 class performance tips, we would like take advantage of =
the
performance improvements by avoiding to call an event from within =
custom
code.
Thanks,
Brian
More information about the SAP-WUG
mailing list