Business Objects 4 "OpenDocument" URL not working with parameters

Mike Gledhill picture Mike Gledhill · Apr 6, 2016 · Viewed 7.9k times · Source

I have a .Net app which was previously using BO 3.x's OpenDocument URL to open a particular instance of Webi Report, with a particular set of parameter values. It worked brilliantly.

But with BO 4.1 and 4.2, whenever I use &sInstance=Param to get OpenDocument to open a particular instance of a report, it fails miserably, silently throws a Java error, and leaves me with an (almost) blank webpage.

Does OpenDocument work anymore with &sInstance=Param ?

I received the following email on August 6, 2016:

"Issue reproducible on BI 4.2 SP2 Patch 2. This issue has been resolved on BI 4.2 SP2 Patch 3. Regards..."

September 2016: Just to confirm, with the latest patch, OpenDocument does (finally) work properly again, managing to open a particular instance of a Webi report.

Description of problem (for other BO victims)...

It's been a couple of months since I posted this article, no one the SAP forum has offered any help, and I'm still stuck on this problem.

Here's a step-by-step guide of how to reproduce the issue.

To keep things simple, I now have a "dumb" BO Report, which merely takes two parameters, and shows their values in a report. Nothing more.

I have a few instances of this report, and what I'm trying to do is open a specific instance of that report, using an OpenDocument URL. Here's the history of my dumb report, and you can see I have 3 instances of it.

enter image description here

If I open the instance whose parameters are AVE;CHF then I see this:

enter image description here

Wonderful.

Now, I want to open this particular instance of the report programmatically. using OpenDocument. In the "real" version of my app, these reports are refreshed each night, and each instance might take 20 minutes to refresh, so I do not want to let OpenDocument refresh the report... merely to open an existing instance of a report.

My report takes two parameters called FX Type and Currency, and I try to open the report using this OpenDocument URL (split into separate lines, for readability) :

http://MyServer:6405/BOE/OpenDocument/opendoc/openDocument.jsp?
  iDocID=AdF8qLrXtBdEgJxiPvS8s6Q
  &sIDType=CUID
  &sOutputFormat=H
  &sType=wid
  &sRefresh=N
  &sInstance=Param
  &lsMFX+Type=AVE
  &lsMCurrency=GBP
  &token=blahblahblah

When I open this URL, I just get this, in both Chrome and IE11.

enter image description here

Notice how the right-hand panel shows that it has got that report's details... so I am logged on correctly and it managed to find the correct report, but the report area is blank.

Being the geek I am, I used Google Chrome to Inspect the blank area, and found this..

enter image description here

Basically, Webi has thrown a Java error, and Webi has decided not to tell the user.

<body>
    <script type="text/javascript">
         onInvisibleError({actionId: '4587', message: 'while trying to invoke the method java.lang.String.length() of a null object loaded from local variable \'sToDecode\''});
    </script>
</body>

Removing &sInstance=Param from the URL

Back in my URL, if I remove the section &sInstance=Param then the report does open successfully, and shows the parameter values correctly. But, crucially, it refreshes the report, which is what I don't want.

We already have an instance of this report, I don't want to wait 20 minutes for my report to refresh, when this instance already exists.

Replacing &sInstance=Param with &sInstance=Last

Out of interest/desperation, I tried to get OpenDocument to simply open the most recent instance of my report.

&sInstance=Last

When I did this, it worked as expected. My report opened perfectly, it didn't refresh the report, but, of course, it opened whichever instance was last created.

Parameter Names containing a space

When I originally posted this article, some readers recommended using %20 instead of + in any parameter names containing a space.

I should say, if I take my OpenDocument URL, remove the &sInstance=Param section, and modify the FX Type parameter from &lsMFX+Type=AVE to &lsMFX+Type=CHF, then report refreshes using this new FX Type value.

So the URL definitely is parsing the URL correctly, and setting the two parameter values to the correct parameter names. But then it falls over when trying to find an existing instance.

Final thoughts

So. In a (longwinded) nutshell, if I use &sInstance=Param, BO v4.2 (and v4.1) quietly throws an error and returns a blank screen.

It won't let me load an existing instance of a Webi report.

And SAP's support seems to have gone AWOL.

Has anyone seen this problem, or found a workaround ?

One day later...

This morning, I created a second Webi Report, with a hyperlink to the "Mikes Test" report.

enter image description here

When I clicked on this link, it successfully opened my Webi report with the specified parameters. No problem there.

But when I changed the "Target Window" setting from "Current Window" to "New Window"...

enter image description here

...look what happens when I click on the hyperlink...

enter image description here

It's our Java error again !

So, I think this proves that this is a bug in BO 4.2 itself.

Even the Hyperlink URLs it creates itself aren't able to open a specific instance of a Webi report.

SAP... over to you...

Answer

ƘɌỈSƬƠƑ picture ƘɌỈSƬƠƑ · Apr 6, 2016

I think that the cause of the error message is that you haven't specified a index value matching the prompt value you passed (BU Cat). Have a look at the section on lsI[NAME] in the OpenDocument manual.

Here's a rather easy option to compare and check your OpenDocument links: have the Document link feature in Webi create them for you. Here's what you do:

  1. Create a new Webi document (you can use an existing one if you prefer). If you create a new document, select No data source.

Important: make sure that you're using the HTML Webi client, not the Java applet (RIA) one.

  1. Create a single blank cell, right click it and select Linking > Add Document Link. Browse and select the document in the dialog.

Add document link

  1. Webi will analyze the document in the background, and will list the OpenDocument options along with any prompts it found in the target document. Specify the prompt values and select Link to document instance, setting it to Most recent - matching prompt values.

Remark: take into account that some prompts might require index values along with text values (this is especially true for BW variables/prompts).

OpenDocument parameter configuration

  1. After configuring the different options and prompt values, click OK and inspect the cell's content. You'll see that it now contains the OpenDocument URL. Compare this URL to the one that you created and see if there are any differences.