cancel
Showing results for 
Search instead for 
Did you mean: 

Get CMC Scheduled Report Status

Former Member
0 Kudos

Hi Experts,

In CMC Instance Manager, one can get a list of schedule reports and their statuses.  I am looking for an Java API to get the same information as that in Instance Manager.  Would you mind pointing me to which API I can use or having sample to provide me to do that?

Thank you for your help.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

The best place to start from would be the developers guide available at http://help.sap.com

Navigate to Analytics --> SAP BusinessObjects Business Intelligence --> SAP BusinessObjects Business Intelligence Platform --> select the BusinessObjects Version you are using -->

Development Information, and refer to the guides ' Business Intelligence platform Java SDK Developer Guide' and 'Business Intelligence platform Java SDK API guide.'


Also you may refer to the below documents for reference.


Thanks,

Prithvi



Former Member
0 Kudos

Hi Raghunath,

Please use the following SAP note# "1725289" which will give to get the all the instances available in environment.

Hope it helps.

Regards,

Feroz

DellSC
Active Contributor
0 Kudos

The easiest will be to use the regular BI Platform Java SDK.  If you go here:  Java BusinessObjects Enterprise SDK Samples - Business Intelligence (BusinessObjects) - SCN Wiki

, you'll find a number of sample apps.  Most of them are for earlier versions of the SDK, but the code will still work.  In particular, look at the "General" section for information about how to log in to BO and query the CMS database.

To get the data, you'll use a query something like this:

Select SI_ID, SI_CUID, SI_NAME,...<other fields> from CI_INFOOBJECTS where SI_INSTANCE = 1 and SI_SCHEDULE_STATUS = <X>

where 'X' is:

0 - Running

1 - Success

3 - Failed

8 - Paused

9 - Recurring or Pending

-Dell

Former Member
0 Kudos

Thank you, Dell.  How do I limit my date range and a specific folder with its subfolders?

DellSC
Active Contributor
0 Kudos

For date range, use the SI_UPDATE_TS field.  The challenge is that you have to correctly format the dates - the format is 'yyyy.MM.dd.hh.mm.ss'.

As for the folders, that can be more of a challenge... I usually get a list of the top level folders (in 3.1, this means the SI_PARENTID = 0, in 4.x it means SI_PARENTID = 23).  I walk through that list and call a recursive method called "loadFolder" that does the following:

1.  Save information about the current folder (I use a list of a custom class I've created to hold folder info.)

2.  Get the list of subfolders using this query:  Select SI_ID, SI_NAME from CI_INFOOBJECTS where SI_KIND = 'Folder' and SI_PARENTID = <SI_ID of parent folder>.  Call the loadFolder method for each.

3.  Get the list of non-folder objects in the folder using this query:  Select SI_ID, SI_NAME from CI_INFOOBJECTS where SI_KIND != 'Folder' and SI_PARENTID = <SI_ID of parent folder>

4.  For each report, get the list of its instances using the query I posted above and, if required, adding the date range to the where clause.

5.  Save the information for each instance.

-Dell

Former Member
0 Kudos

I am using this code:

IInfoObjects instances = infoStore.query("select top 6400 * from CI_INFOOBJECTS where SI_INSTANCE=1 and SI_SCHEDULE_STATUS in (0, 1, 3, 8, 9);

for (int I = 0; I < instances.getResultSize(); I++) {

    IInfoObject instance = ((IInfoObject)instances.get(I));

    ISchedulingInfo schedulingInfo = instance.getSchedulingInfo();

}

how can I get the start/end/completion dates from the ISchedulingInfo or anywhere else?  Basically I need this information to see whether the instance requires to restart or not since same report can be triggered multiple times a day; therefore, there are more than one instance and that can have a  different status.  I need to determine whether the latest status is a failed or not so I can restart.

Thank you.

DellSC
Active Contributor
0 Kudos

There is a challenge with the dates - they're all in UTC time, so you may actually have to convert them to your local timezone if you want to work with them.

Here are a couple of ways to get dates:

1.  For pending/recurring schedules, use schedulingInfo.getBeginDate() and schedulingInfo.getEndDate() to get the first run and final run dates.

2.  For non-schedule instances, use instance.properties().getDate("SI_CREATION_TIME") for the start time and instance.getUpdateTimeStamp() to get the end time.

-Dell

Former Member
0 Kudos

Hi Dell,

I am following your suggestion and I am stuck.  This is what I am doing:

1) recursively load the folders based on the known folder.  Select * from CI_INFOOBJECTS where SI_KIND='Folder' and SI_PARENTID=<parentId>

2) for every folder, get all documents (non-folder) without folders.

3) For each document, use the query provided by you in first reply such as select * from CI_INFOOBJECTS where SI_INSTANCE and SI_SCHEDULE_STATUS=<X>.  I am stuck here where I do not know how this can tie to point 2 since it does not have anything related to the non-folder item in the current folder.  I modify this query to include SI_NAME.  Not sure if this the correct way.

You input is appreciated.  Thanks!

DellSC
Active Contributor
0 Kudos

Sorry about that - I forgot one entry in the where clause - add

and SI_PARENTID=<SI_ID of the current folder>

-Dell

Former Member
0 Kudos

Just to be sure if I am getting it right, I am using SI_PARENTID from the non-folder item which I look in the current folder, is it right?  In other words, if

1) the current folder is MyFolder (Id=1234), it has items (says 2 items: one=11, two=22).

2) I would use the query you provided earlier with SI_PARENTID=11 and 22 and not 1234, correct?

Other questions:

1) if a user schedules to run the report now, it does have a schedule instance, will it bring up on those queries you provided?

2) how can I get the event name for the scheduled instance?

Thank you for your help, Dell.

DellSC
Active Contributor
0 Kudos

You get the list of reports in the folder using the folder's SI_ID as the parent.  You get the list of instances for the report using the report's SI_ID as the parent.

1.  Run Now reports do have a schedule - it will have a status of either "Pending" or "Running" while it's processing.

2.  From the ISchedulingInfo object, you'll need to do two things:
     a.  The .getDependencies() method will return a list of the SI_ID values for all events that a report waits for.

     b.  The .getDependents() method will return a list of the SI_ID values for all of the events that a report triggers when its schedule is complete.

From these lists you can use the SI_ID values to get the name of each of the events using this query: Select SI_NAME from CI_SYSTEMOBJECTS where SI_ID = <the id of the event>.

-Dell

Former Member
0 Kudos

Hi Dell,

I implemented as you suggested and I noticed .getDependencies() returned a list of events; however, .getDependants() did not return anything.  I am guessing .getDependencies() is good enough.  By the way, it looks like our reports only use one event, so .getDependencies() returned only 1 event per instance.

I am using the IInfoObjects objects = infoStore.query("Select SI_NAME from CI_SYSTEMOBJECTS where SI_ID=<the id of the event>");

How do I get the SI_NAME from that query in the IInfoObjects?

Thank you again for your help.

DellSC
Active Contributor
0 Kudos

IInfoObject.getTitle() will return the value from the SI_NAME field.

-Dell

Former Member
0 Kudos

Hi Dell,

I have tried using the following queries and logic to get the scheduled instance and its status:

1) SELECT * FROM CI_INFOOBJECTS WHERE SI_ANCESTOR=<myFolderID> AND SI_INSTNCE=0 AND SI_KIND IN ('Webi', 'Excel', Pdf', 'Txt', 'Publication'); This gives me all the documents in myFolder and its subfolders.

2) For each document retrieved in step 1, I use this query to get the instances and its status - SELECT * FROM CI_INFOOBJECTS WHERE SI_INSTANCE=1 AND SI_PARENTID=<This ID is from IInfoOject.getID() call> ORDER BY SI_ENDTIME DESC;

3) Pick the first one from the query in step 2 since the order is by SI_ENDTIME descending order.  Get the ISchedulingInfo from the first item which I get the ISchedulingInfo.ScheduleStatus, and ISchedulinginfo.getEndDate() from.

I have noticed the ISchedulingInfo.getEndDate() and getBeginDate() do not match anything with the same instance found in CMC.

It seems the dates are when the instance is schedule to begin running until it is scheduled to stop.

Do you think there is another date where I can get to make sure it is correct?

Thank you for your help again.  If I can get the correct date, I am set.

DellSC
Active Contributor
0 Kudos

I've been struggling with this for a utility that I'm writing for a client, so your question is quite timely for me.  Looking at reports in QueryBuilder, I'm seeing that there are two SI_STARTTIME and two SI_ENDTIME values - one set in the SchedulingInfo and the other on the InfoObject itself.  The set in SchedulingInfo are the start and end dates for the whole schedule and these are what is returned in your code.  The set in InfoObject appears to be the correct date/times for this instance of the report, so those are the fields that you need to use.  Unfortunately, there is no "getter"for these properties in the IInfoObject interface.  So, the easiest way to get them is going to be to get them from the properties bag.  You would do this through something like:

IInfoObject.Properties.get("SI_STARTTIME")

I'm working with this code this morning, so I'll let you know if I find that this doesn't work like I think it will.

-Dell