Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

Login

Login to view more content!!!





Lost Password?
No account yet? Register

Registered Access

Poll

What is your relationship with SAP?
 
Home
Starting and Event to kick off a job PDF Print E-mail
User Rating: / 2
PoorBest 
Written by Kevin Wilson   
Monday, 23 July 2007
Ever needed to kick off a job from another external system? This tip shows you how to kick off an event. A background job is then created in SM36 that waits for this event to occur. Scheduling this job as a periodic job will cause this job to be kicked off each time this event happens. It has the ability to send in a parameter which allows you to configure the ABAP of the job to react differently based on the event parameter. Use SM62 to create the user defined event. Events let you start background jobs when particular changes in the SAP system take place. When an event occurs, the background processing system starts all jobs that were scheduled to wait for that event.
http://help.sap.com/saphelp_nw04s/helpdata/en/fa/096e2a543b11d1898e0000e8322d00/frameset.htm

Events have meaning only in the background processing system. You can use events only to start background jobs.

Triggering an event notifies the background processing system that a named condition has been reached. The background processing system reacts by starting any jobs that were waiting for the event.
http://help.sap.com/saphelp_nw04s/helpdata/en/fa/096e37543b11d1898e0000e8322d00/frameset.htm


Use function module BP_EVENT_RAISE to trigger an event from an ABAP program or BAPI_XBP_EVENT_RAISE from an external system.

Example


* Report processing before triggering event...
*
* Trigger event to start background jobs waiting for the event.
*
DATA: EVENTID LIKE TBTCJOB-EVENTID.
DATA: EVENTPARM LIKE TBTCJOB-EVENTPARM.

EVENTID = 'SP_TEST_EVENT'. " Event name must be defined
" with transaction SM62.

EVENTPARM = 'EVENT1'. " Optional: a job can be
" scheduled to wait for an
" EVENTID or combination of
" EVENTID and EVENTPARM.

CALL FUNCTION 'BP_EVENT_RAISE' " Event is triggered. Jobs
EXPORTING " waiting for event will be
EVENTID = EVENTID " started.
EVENTPARM = EVENTPARM
TARGET_INSTANCE = ‘ ‘ " Instance at which an event
" should be processed. Can
" generally be omitted.
EXCEPTIONS OTHERS = 1. " Exceptions include event not
" defined, no EVENTID
" exported, etc.

Related Items:

 
< Prev   Next >

Google Search

Statistics

Contribution Activity
Utilities: 41
Tips and Tricks: 362
Sample Code: 174
Total Contributions: 592

Member Activity
Members: 6795 since 2/1/2007!
New: 2 since yesterday!
Visitors: 2164026
We have 2 guests online

Newest Members

Welcome our newest members:

Google Ads