Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
How to validate/ get Document Read / Unread status + BUSINESS OBJECTS Java SDK

As a user, we schedule reports and keep it there in our inbox for a while and even sometime there is no business need after schedule, we don’t even open those reports. Another way, there may be recurring schedule jobs running which sends report to user inbox but user do not open if there is no need.

As a Business Object Administrator, we need to keep the Business Objects repository clean and delete any unwanted reports from system to have free space so that server can run in optimal way. So as an admin, our goal was to clean all those report which are unread from user’s inbox.

Problem statement

  • To find unread report from User’s inbox

  • Clean up unread report to free up space


Solution:

  • A java process to connect Business Object repository and get the report create time and update time stamp using query



  • Clean up process deletes those report from User inbox


 

How to Implement:

  1. Enterprise session : Get business object Enterprise session to by providing admin credentials , once we have the session, we need to have IInfoStore object to run the query// sample  


IInfoStore infoStore = (IInfoStore) enterpriseSession.getService("", "InfoStore"); 

2. Retrieve User Inbox information

Query = "SELECT TOP 5000 SI_NAME, SI_FILES, SI_ID, SI_KIND FROM                CI_INFOOBJECTS WHERE SI_KIND = ‘Inbox’;

 

IInfoObjects rsInboxes = (IInfoObjects) iInfoStore.query(query);

3.  All User specific Inbox report details:Retrieve user specific report detail from Inbox:If those two  matches, then the report is unread, else read. With help of following query we retrieve user specific inbox report and then get the update time stamp and create time stamp to compare whether the report is read/unread.

With help of rsInboxes IInfoObjects , we can get All user specific report from its inbox.

IProperties inbox = thisInbox.properties();

String strSQL = "SELECT TOP 1000 SI_NAME, SI_FILES, SI_ID, SI_KIND, SI_CREATION_TIME, SI_UPDATE_TS, SI_KIND, SI_DESCRIPTION

FROM CI_INFOOBJECTS WHERE SI_INSTANCE = 0 AND SI_KIND IN ('CRYSTALREPORT', 'SHORTCUT','WEBI','EXCEL','FULLCLIENT','PDF','TXT','RTF','WORD')

AND DESCENDANTS(\"SI_NAME='FOLDER HIERARCHY'\",\"SI_ID = " + inbox.getProperty("SI_ID").getValue() + "\") ORDER BY SI_CREATION_TIME DESC";

IInfoObjects objRS2 = iInfoStore.query(strSQL);

for (int x = 0; x < objRS2.size(); x++) {

++files;

IInfoObject inboxObject = (IInfoObject) objRS2.get(x);

String siCreationTime = "";

if (inboxObject.properties().getProperty("SI_CREATION_TIME") != null)

siCreationTime = inboxObject.properties().getProperty("SI_CREATION_TIME").getValue().toString();

String siUpdateTime = "";

if (inboxObject.properties().getProperty("SI_UPDATE_TS") != null)

siUpdateTime = inboxObject.properties().getProperty("SI_UPDATE_TS").getValue().toString();

}

Comparing siUpdateTime & siCreationTime, we can get the desired result. We can then write the result into excel sheet using simple java program.

We can get by query builder directly also but that will not give you list in excel file.
1 Comment
Labels in this area