Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Get InfoProvider name in a javascript.

Former Member
0 Kudos

Hi,

Question about javascript in WAD 7. When I push a button, a javascript is started to open a pdf file in the portal. This works fine.

function openInfoProviderDoc( )
  {
var x=window.open( 'http://sapsvr62.mcb.local:50000/irj/go/km/docs/documents/mis/documents/sales/zsd_m01.pdf' );
  }

Now I need the InfoProvider (technical name) in the javascript. Is there a function to get name or can I pass the InfoProvider as a parameter?

function openInfoProviderDoc( varInfoPro  )
  {
var x=window.open( 'http://sapsvr62.mcb.local:50000/irj/go/km/docs/documents/mis/documents/sales/' + varInfoPro +'.pdf' );
  }

or

function openInfoProviderDoc( )
  {
var varInfoPro=bla.get( INFOPROVIDER )
var x=window.open( 'http://sapsvr62.mcb.local:50000/irj/go/km/docs/documents/mis/documents/sales/' + varInfoPro +'.pdf' );
  }

Regards,

Coen.

8 REPLIES 8

Former Member
0 Kudos

Hi all,

I still need a answer on this one.

Regards,

Coen.

0 Kudos

Hello Coen, why are you using window.open if a simple link (with property target set to "_blank") will open the PDF on a new browser? Is the infoprovider inserted in a textbox by your users or are you showing it on the webpage?

<a href="....../ZSD_M01.pdf" target="_blank">PDF doc</a>

Cheers

Michael

0 Kudos

Hi Michael,

Thanks for you interest. We added 2 buttons to our default web templates. The first button opens a general document explaining the use of the buttons, filters, settings, context menu etc. The second button opens a document which describes the InfoProvider. I need the second button to be user unattended, opening the document of the current InfoProvider.

The key is, how can I capture the technical name of the InfoProvider into a variable? After that it's just creating a string and concatenate the variable.

Of course any alternative that match will be appreciated .

Regards,

Coen.

0 Kudos

A question, what's the "infoprovider"? If it's master data of the user, you can calculate it and use it as part of thelink when "building" the HTML to be shown

0 Kudos

Hi Michael,

The InfoProvider in this situation is a multicube. In our case, all queries are build on multicubes. Queries are linked to standard web template like the ZANALYSIS_PATTERN or ZDISPLAY_PATTERN. Standard template are maintained in the WAD, which has javascript functionality.

So, each template is connected to a query which is connected to a InfoProvider (multicube). Depending on the selection in the portal the ZDISPLAY_PATTERN can open a query that is build on InfoProvider ZSD_M01 (sales and delivery) or ZQM_M01 (quality).

Recently I found out that when I use the "Text" web item, I can bind a "General text element" and select the InfoProvider name. Question again is, how do I get this in a variable in the javascript.

Regards Coen.

0 Kudos

OK Coen, sorry but I can't help you then.

Good luck

Michael

0 Kudos

Thanks Michael.

0 Kudos

Hi All,

Question is still open. We need a solution or alternative. Please help.

Regards Coen.