Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Raising custom events

Former Member
0 Kudos

Hi, let's suppose there is a transparent table, i.e 'table1', which does not presently have any change docs assigned to it. I would like to raise an event every time changes are made to table 'table1', regardless of which application was used to change it. Later on in life I might want to trigger follow on events like workflow from this custom event. Does anyone know of the steps needed to realize this?

Thanks in advance,

Kevin

1 ACCEPTED SOLUTION

ramki_maley
Active Contributor
0 Kudos

Hi Kevin,

Create your own Business Object based on your table and define the events (txn SWO1). Have a common routine/function module to update the table. You can trigger your event from within this function module using standard SAP functions like SWE_EVENT_CREATE or SAP_WAPI_CREATE_EVENT depending on your release. You should not allow any direct updates to your table other than by calling the common routine. Even if you create your own change document object for the table, remember that you need to write the documents yourself every time the table is updated. It is lot easier to have a simple update routine.

1 REPLY 1

ramki_maley
Active Contributor
0 Kudos

Hi Kevin,

Create your own Business Object based on your table and define the events (txn SWO1). Have a common routine/function module to update the table. You can trigger your event from within this function module using standard SAP functions like SWE_EVENT_CREATE or SAP_WAPI_CREATE_EVENT depending on your release. You should not allow any direct updates to your table other than by calling the common routine. Even if you create your own change document object for the table, remember that you need to write the documents yourself every time the table is updated. It is lot easier to have a simple update routine.