Creating an event from a program (user-exit)

Dart, Jocelyn jocelyn.dart at sap.com
Sun Feb 18 23:00:40 EST 2001


Hi Leonardo/Alon,
As well as FM SWE_EVENT_CREATE and the macro
there are also 2 other variants:
FM SWE_EVENT_CREATE_IN_UPD_TASK
FM SWE_EVENT_CREATE_FOR_UPD_TASK
 
Use SWE_EVENT_CREATE if you want to create it straight away.  E.g. From
your own report.
 
Use SWE_EVENT_CREATE_IN_UPD_TASK if you want to include the event creation
in the update task bundle - i.e. you only want the event created if the
logical unit of work is successful as a whole.  E.g. You want to raise a
"CHANGED" event but only if the change is successful.  This is the one which
 
you may want to use in your user exit, so that the event creation becomes
part
of the overall LUW bundle.
 
Use SWE_EVENT_CREATE_FOR_UPD_TASK where the object will not exist until
the update task is executed.  E.g. You want to raise a "CREATED" event
but only after the object has been created in the update task and only if
the creation is successful.
 
They all end up calling SWE_EVENT_CREATE but it's a question of
getting the timing right so that you don't have events happening when
the cause of the event has been rolled back, or when the referenced
object does not exist.
 
I agree with Alon that the SWC_RAISE_EVENT is cleaner in some respects,
but it only gives access to FM SWE_EVENT_CREATE, and sometimes you really
need the others.
 
If you do a search in the R/3 library documentation, in the workflow
reference section,
you should find a little further info on the function modules.
 
Regards,
        Jocelyn Dart
Consultant (BBP, Ecommerce, Internet Transaction Server, Workflow)
SAP Australia
Email jocelyn.dart at sap.com <mailto:jocelyn.dart at sap.com>
Tel: +61 412 390 267
Fax: +61 2 9935 4880
 
 
-----Original Message-----
From: Raskin Alon x8008 [mailto:ARaskin at Citipower.com.au]
Sent: Monday, 19 February 2001 10:14 AM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Re: Creating an event from a program (user-exit)
 
 
There is also a macro (which actually ends up calling the FM
SWE_EVENT_CREATE) defined in INCLUDE cntn01. So the answer is YES, you can
use this FM. I prefer the macro because the code is a little neater.
 
Regards,
Alon
 
                -----Original Message-----
                From:   <Leonardo> <Araujo>
[mailto:leonardo.araujo.b at bayer.com]
                Sent:   Saturday, 17 February 2001 06:13 AM
                To:     SAP-WUG at MITVMA.MIT.EDU
                Subject:        Creating an event from a program (user-exit)
 
                I need to raise and event from an user-exit  or from a
report that runs
                periodically.
                I am using the function SWE_EVENT_CREATE to do so.
 
                I already have the evente craeted(defined), the object is
working fine, etc,
                etc... Actually, even the program is working fine, but I am
in doubt if this
                function is the most apropriate to do this.
 
                Example: I want to raise the event ALECreated from BUS2032.
Is it right using
                this function? Do you guys know a better way to do that?
 
 
                Thanks in advance,
 
 
                Leonardo.
 
 
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
 
This email message has been swept for the presence of computer viruses.
 
CitiPower Pty ACN 064 651 056
**********************************************************************
 


More information about the SAP-WUG mailing list