cancel
Showing results for 
Search instead for 
Did you mean: 

Can some advise me about Event Triggers?

Former Member
0 Kudos

Can someone please advise me about Event Triggers?

What are their purpose?

How is an 'event' defined in SAP terms - (is it an SAP TCODE) ?

Do they create an event log that can be used for mining?

Can they be used by business users or are they designed for people managing the application?


Thanks & Regards,


George

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi George,

can you please be more specific what you mean?

DB2 on IBM i is supporting so-called multi-event triggers since IBM i 7.1 (see IBM i Technology Updates: Multiple events supported in a single SQL trigger). SAP code is generating these triggers for certain operations, such as upgrades or SLT replication, but you don't need to worry about that. Basically these triggers are programs that are executed whenever a row in a table is inserted, updated or deleted. They can execute whatever SAP or you have coded.

In another context, SAP is talking about events when it comes to submitting background jobs in transaction SM36. When specifying the start condition of a background process, you can specify to start after an event. SAP is shipping a set of pre-defined events (such as SAP_SYSTEM_START), and you can maintain and trigger them through transaction SM64.

Kind regards,

Christian Bartels.

Former Member
0 Kudos

Dear Christian,

thanks for your reply.

I am developing an application for SAP running on the IBM i (Power Series). This implementation has a proprietary journaling system that can capture every change to a file. My application is an extract/transfer/load. For example, it extracts data from the journal of EBAN over a month. Each journal record has a fixed part (system data; program name, user id, timestamp etc) and a Entry Specific Data part (SAP data).

The transformation part creates an event log with selected & reformatted parts of this data for use in process mining tools. Process mining is a capability that allows the reverse engineering of business processes. You can get workflow diagrams with performance and wait times. You can also get conformance and organisational data. You get to see what the process actually looks like. This is for use by process owners, managers and business analysts. It answers the question - how is the process behaving?

The load part is taking the created event log (usually excel CSV) and inputting it into a Process Mining tool. The same file can also be used in statistical & BPM tools.

Discussing this with a client he believed that what I was doing could be done with event triggers. I am trying to establish if these are two different things so I can convince him of my systems worth.

My sense is that event triggers serve a different purpose and cannot help you reverse engineer processes?

Regards & thanks,

George

0 Kudos

Hi George,

if your application wants data from one or a few tables only, it may be more efficient to use triggers rather than retrieving and evaluating journal entries. However, there are a few things to consider:

  1. Dependent on your definition, the trigger program will get executed for each row during an INSERT, UPDATE or DELETE operation. For mass operations, this may slow down performance.
  2. Your trigger program gets the information at exactly the moment when the change happens. If you want to evaluate all changes during a longer period of time, you need to store that information somewhere (e.g. in your own data library).
  3. If you add a trigger from outside the SAP application, the SAP dictionary does not know about it, and the trigger information will get lost during a database export/import. You can add the trigger manually after the import, but you must be aware of that.

An introduction to database triggers can be found at http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/dbp/rbaforzahftra.htm.

Kind regards,

Christian Bartels.

Former Member
0 Kudos

Dear Christian,

thanks for this.

I think the first advantage of using journals is that they contain system information that is critical for process mining. Each change contains the user or resource id, the program or TCODE being executed and a precise timestamp (YY/MM/DD hh:mm:ss.tttttt). SAP does not store this information in the database.

The second advantage is that he organisation may be using journaling for back up and recovery so there is no extra overhead. Typically you would take the journal of EBAN for the month (or multiple months) and apply process mining. The ETL is done in batch mode.

Do event triggers capture system information like (user, resource, program) or just information?

Thanks once again,

George

0 Kudos

Hi George,

the trigger program is executed in the same process as the database request, so you can use APIs to retrieve the current user profile of the process and the call stack if you need that information. The program has a "trigger buffer" as input parameter, which contains information about the operation type, the relative record number (row number) and the row data before and after the change.

In both cases (journal and trigger), the user and program information is the operating system view of the application: You will always get the instance user profile (typically <sid>adm) and the database interface program (typically XDNINLSVR), but not the SAP user, SAP transaction or SAP ABAP program name. The SAP information can be retrieved through SQL "special registers" CLIENT APPLNAME, CLIENT PRGRAMID and CLIENT USERID, but only in a trigger program, not through the journal (see http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/db2/rbafzspecreg.htm).

Unfortunately the SAP dictionary is very strict on trigger programs: SAP Notes 1749824 and 1655725 document that tables changes through the data dictionary are not possible when triggers exist on the tables. You would have to remove the triggers before installing transports that change the tables in question and add the triggers afterwards manually.

Kind regards,

Christian Bartels.

Former Member
0 Kudos

Hi Christian,

Thanks again for your detailed answers but I am a little confused.

I have used the IBM journals before for process mining with another IBM i ERP application.

From the record format of the journal (QADSPJR5) I have successfully extracted the following fixed fields;

JOSEQN                Sequence number (IBM no)

JONBR                   Job or Session number (IBM no)

JOTSTP                   IBM SAA timestamp (24 char timestamp)

JOPGM                    Name of Program from user application that was executed

JOUSPF                    User Profile of person (sometimes QSYSOPR etc )

Are you saying this is different for SAP?

Regards, George

0 Kudos

Hi George,

the SAP software is different than other applications. With SAP, all work processes are running under the same user profile <sid>ADM, where <sid> is the 3-character SAP system ID chosen by the customer during installation. The individual end users are not represented by user profiles in the operating system, but by entries in SAP table USR02. So all activities in the journal will show <sid>ADM as the user profile, and you cannot distinguish what end user has executed the transaction.

Similar with the program: All SAP application programs (written in programming language ABAP) are stored in tables REPOSRC and REPOLOAD. The code is executed by the SAP kernel (written in C/C++), and only the SAP kernel program, not the actual SAP transaction/program, would be shown in the journal.

Kind regards,

Christian.

Former Member
0 Kudos

Dear Christian,

thanks for this. I doesn't 'blow up my' project but it gives me pause for thought.

It's always best to learn about these things at design time and thanks for the information. Not having the user name means the organisational part of process mining will be missing but the rest of analysis can still be done.

Regards & thanks,

George

Answers (0)