cancel
Showing results for 
Search instead for 
Did you mean: 

BW server details from webdynpro

Former Member
0 Kudos

Hi All,

I want to fetch BW server details(that i ve configured in the j2ee engine)from j2ee engine, from webdynpro.Can any one tell me how i can go about it.

Thanks and Regards,

Debashree.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hio Debashree,

Where have you configured the details in the j2ee engine?And for what purpose you are doing so?

Regards

Rohit

Former Member
0 Kudos

Hi Rohit,

I ve configured the details in visual administrator>services>destination-->HTTP.There upon clicking the new button a new server detail can be entered.

For the second part of the question let me explain to you the requirement.I ve a report where the data has to be populated from BW.So, to display the data first the BW Server details will be needed at runtime in webdynpro(from where the data will be fetched).That is why i need the server details.

Best Regards,

Debashree.

Former Member
0 Kudos

Dear Debashree,

If you are using a portal you can easilly create a BW system do the usermapping and show it in BW report iview

Also one more thing what are you specifying in the destination URL.Are you specifying the url to the report there?

Regards

Rohit

Former Member
0 Kudos

Hi Deebashree,

Try out the following

Create a webdynpro project

Go to J2EE perspective

Go to Package Explorer view

Right click on the webdynpro project and choose "Set Additional Libraries"

Select security.class and tc/sec/destinations/interface.

Click OK

Give these imports

import com.sap.security.core.server.destinations.api.DestinationService;

import com.sap.security.core.server.destinations.api.Destination;

import com.sap.security.core.server.destinations.api.DestinationException;

import com.sap.security.core.server.destinations.api.HTTPDestination;

Wherever you want to get the destination do the following

try

{

InitialContext ctx = new InitialContext();

DestinationService dstSer = (DestinationService)

ctx.lookup(DestinationService.JNDI_KEY);

if (dstSer == null)

throw new NamingException("Destination Service not available");

Destination destination = dstSer.getDestination("HTTP","test");

//for HTTP destination: cast the destination to httpdestination

HTTPDestination httpDestination = (HTTPDestination) destination;

//obtain a HTTPUrlConnection from the destinationHttpURLConnection

HttpURLConnection httpConnection = httpDestination.getURLConnection();

}

catch(NamingException ne)

{

wdComponentAPI.getMessageManager().reportSuccess("Naming exc..."+ne);

}

catch(RemoteException re)

{

wdComponentAPI.getMessageManager().reportSuccess("remote exc..."+re);

}

catch(DestinationException de)

{

wdComponentAPI.getMessageManager().reportSuccess("destination exc..."+de);

}

catch(ConfigurationException ce)

{

wdComponentAPI.getMessageManager().reportSuccess("Config exc..."+ce);

}

Hope this helps you

Regards

Rohit

Message was edited by: Rohit Radhakrishnan

Former Member
0 Kudos

Hi Rohit,

Thanks a lot for your help.The code worked.:)

Answers (0)