понедельник, 30 декабря 2013 г.

SAP BO events and schedule based on events



SAP BO provide us several capabilities for convenient schedule tasks. Let's consider events for this purpose. Special for this BO has own server - EVENT server.

First of all, go to CMC and click on "Events":










Custom Event - manual event, has two properties name and description.

File Event - Event, which are based on file. You can place file in any folder and you have to notice full path. BO wait, when this file will be refreshed. For instance, when ETL is finished, ETL tool can update file.


Scheduling Event - event, which generates, when one report is scheduled. Can be applied for success, and failure.

The most useful events are File and Schedule.

Let's consider File event:

Go to Events->System Events->Create Event->Choose File




















!!!in file name you should specify full path of file!!!

Than, we can schedule report as usual and in event tab choose Available events and our event ETL_READY









Now, when ETL will be finished, etl tool will trigger our file and report will start refreshing.

On the other hand, we can use schedule event for triggering our reports.
Go to Events->System Events->Create Event->Choose Schedule



















Again, specify name and choose which result do we need i.e. Success, Failure or both.

Now we can schedule one report and choose  Available Schedule Event - BL_finished:











When, we want to schedule any report, we just choose our event in "Available event" i.e. first report creates event during schedule job and second wait it.

PS We can also get ETL flag not only from file event in case if etl tool write metadata. We can create universe based on derive table, for instance:


select to_number(decode( count(*), 0, 'X',1)) from rocket_dwh_cmn.stl$v where sys='BOB'
and sysdate - ed < 5/24/60
and status=0

Than schedule report with 5 minuts interval, and BO will wait, when metadata table will give fresh data. This statement will give us error, if SELECT returns 0 rows and sysdate - ed < 5/24/60 special for compare time difference with 5 minute interval.
It's easy example that display, one of SAP BO tricks when we don't want to send empty report.