Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
ted_ueda
Employee
Employee

Synopsis: In this series of Blogs, I'll explore how the Web Intelligence RESTful Raylight Web Services allow users to automate and simplify the management, modification, creation and updates to a batch of Web Intelligence documents.  This series will be of interest to Web Intelligence administrators, designers, consultants and power users, to save time and effort and get the most out of your investment in Web Intelligence.

Previous Entryhttp://scn.sap.com/community/restful-sdk/blog/2013/09/05/scripting-web-intelligence-the-restful-rayl...

What's in it For Me?

So I'm pretty excited about the Web Intelligence RESTful Raylight Web Services, for the reasons I stated in my previous Blog.  It's a simple, easy to use and learn programming interface for Web Intelligence document management and manipulation for administrators and power users.

But what kind of stuff can you do with it?  Well, plenty!

I've been working with Raylight in my spare time over a few weeks, and even in the small amount of time I've spent on it, I've gotten pretty nifty tools out of it.  Great bang for the back.

In this Blog post, I'll a describe few examples of what I was able to accomplish.  In future Blogs, I'll go into details of these, and other, interesting scripts.

What I've done can be loosely categorized under WebI exporting, report manipulation, scheduling and data source changes.

Exporting

If you want to refresh and export a WebI document, you'd log onto BI launchpad, find the document, open it, refresh it, and then export it to the format you want.  That's pretty tedious, especially if you have to do it frequently, or you have many documents to do.  Yes, you can certainly schedule them and have to docs sent to you, but maintaining many scheduled can become a bit of an administrative headache.

Instead you can just create a simple script, and automate the exporting of documents.  Even better, you can implement workflows that's not available or difficult to do with the scheduler.

Here's a few examples:

Set prompts and export

Complex reports can have many, many prompts.  Having to set them each time you refresh them is pretty tedious and error prone.  But if you're using the same prompt values over and over, why not write a script that sets them for you?   Easier said than done?  No way - just a page of code, dead easy:

Running report with different prompt value for Year.

I just modify the code entering new prompt values, to export the reports with any combinations of prompt values I want.

Multi-Language

Say you need to export a WebI document in many different localizations and languages.  In BI Platform, the localization that control date and number formatting of data is  the User's Preferred Viewing Locale (PVL).  Having to change your Locale jin BI launchpad just to export a document in a desired language is, again, pretty tedious. 

Raylight allows you to set the Preferred Viewing Locale for  a document when you open it.  So by a simple script, you can iterate over all the content locales you want, and get the report export for each:

Exporting report with different locale: German, US, France, Japan and Korea

You can certainly use publications, but it took me less time to write the script than it would for me to create one single Publication job.

Report Separation

You might have a large WebI doc with multiple reports (tabs), where each tab holds information relevant to a single department within your organization. You need to run the document for the section head, but need to separate out each report, and send each to the relevant department head.

You can always go into BI launchpad, open the document, go to each report tab and export.   

Or you can automate that task using a Raylight script:

Breaking up the Charting Sample document into separate reports.

The script would save you considerable time.

Document Modification

There are times you need to modify a WebI document, because of changes to your organization, movement to standardize, requests made by the client, etc. 

Not too difficult if it involes one or two documents, but what if it involves hundreds? 

Without a scripting solution, that would be a great challenge.  Some examples:

Add a Report

Hypothetical case:  say legal comes and says you need to add a legal disclaimer in every WebI document you send out, and currently you're sending out tens or even hundreds.  How would you do that? 

Thinking about it, how I'd do it would be to create a 'template' WebI doc that contains the legal disclaimer in its first report tab. Then I'd use Raylight to open each WebI doc needing the mofification, add a report tab, copy over the 'template' report, then save.    I had bits of Raylight code around that did report specification manipulation and report add, so was able to quickly combine the two and create a script that did what I want.  It really took me less than half an hour.

Change Image

Say changes to your organization necessitates logo changes in WebI docs:

Raylight script to change an image embedded in a WebI doc.

You may not need such a script every day, but it'd sure come in handy when you do.

Change Chart Palettes

Change the palette of charts for standardization or accessibility requirements?  Sure:

Easy as pie.

Scheduling

Since Raylight exposes the full functionality of BI Platform scheduling for Web Intelligence document, you can pretty much automate anything you can do for scheduling in BI launchpad.  If you need to schedule with a complex set of prompts, then writing a script would make things less error prone and tedious.

Another thing I'd POC'ed - when you have a long-running Web Intelligence document, then the recommendation is to schedule the document rather than run it on-demand.  If you refresh on-demand, there's restrictions on how long the document can take to complete, before running into timeout erors.    So you would schedule, then wait till the schedule finishes before going to get the document.   I automated that using a script. I had the script schedule the document, then periodically poll the scheduler till the instance was complete, then I streamed it back to my desktop.

Change Universe

This is something oft requested by our customers. By intention or accident, some customers encounter a situation where they needed to change the Universe that a large set of Web Intelligence document was reporting off of.  This is always a daunting task, requiring either many worker-hours of effort or unsupported tricks to accomplish. 

With the Raylight API, I found the workflow for this to be straightforward - you'd feed in the target Universe SI_ID value, Ralight will then send back the suggested mapping of fields from the old to new data source, you'd send the mapping back with any modifications as required, and Raylight will do the rest. 

I'll describe this script in detail in a later blog , I know a few customers very interested in this workflow.

Summary

The abovfe is just the tip-of-the-iceburg, as they say, when it comes to the functionality available with Raylight.

I hope you'll see value in the above, and see how it may make your life as the WebI administrator or power user easier.

I hope you'd take a serious look at Raylight.

In later blogs, I'll present the scripts briefly descrbed above, and others, and go into detail as to how they operate.

In the next blog, however, I think I'll cover how I learned Raylight.  Because of its RESTful nature, how I learned it was a bit different from how I learned other SDKs - much more hands-on and much less reading docs. 

It might be instructive if I describe what I went through, hoping it'll help you get quickly up to speed when it comes to Scripting Web Intelligence. 

Next Entry: http://scn.sap.com/community/restful-sdk/blog/2013/09/07/scripting-web-intelligence-the-restful-rayl...

6 Comments