cancel
Showing results for 
Search instead for 
Did you mean: 

How to read the excel file from KM Repository

Former Member
0 Kudos

Hi Friends,

As I already posted a question to the forum regarding this issue, but I was unable to get any reply. Once again I am placing my issue here

"I need to read the excel file data which resides in the KM Content into my webdynpro application ."

I have passed the KM Repository path of that excel file as an argument to the URL class and trying to get the Input stream but it is throwing an exception "401 authentication failure". To resolve this issue I just passesd portal user details also along with repository path to the URL class. Then it is working fine and I am able to get the content.

Instead of passing the user details along with KM Repository path , Is there any other alternative to get the content from Excel file which resides in the KM Content to the WebDynPro Application.

Note: Here I am using the POIFileSystem of jakarta to read the excel file.

could you guys look into the issue and suggested me a beeter way to resove this issue.

Thanks and Regards,

Sandeep Kumar Bonam

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Sandeep,

In case you have SSO configured between your EP (where KM documents are located) and WAS (where WD application is running) and user and roles are appropriate configured you can use following code:


IUser user = WDClientUser.getCurrentUser().getSAPUser();
String sso = (String)user.getTransientAttribute(IPrincipal.DEFAULT_NAMESPACE, "MYSAPSSO2_STRING");
URL urlToKMDoc = new URL("URL to KM document");
URLConnection connection = urlToKMDoc.openConnection();
connection.setRequestProperty("Cookie", "MYSAPSSO2=" + sso);
InputStream is = connection.getInputStream();

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Maksim,

I may need this logic. Can u let me know what exactly is that MYSAPSSO2_STRING and "MYSAPSSO2="

Thanks!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Maskim,

Thank you for the helpful answer. I worked on this issue from past 3 weaks and now i got the solution. I hope you can help me in future whenever i got any issue in webdynpros.

Thank you,

Sandeep Kumar Bonam

Former Member
0 Kudos

Hi Pros,

I need to display a PDF file which is a located on the internet in SAP. I have valid URL which will display the PDF file on Internet Browser.

Could any one please give me a solution to my problem..

how I can display a file which is located in URL.

(how I can connect to internet from SAP).

thanks,

Hari K.