cancel
Showing results for 
Search instead for 
Did you mean: 

KM Document Upload in webdynpro

Former Member
0 Kudos

Hi,

Requirement : There is User form and upload button in a page . As soon as user click's on Upload File two things happen.

1) user data shoud be stored in r/3

2) uploaded file shoud go to km path.

1) is not a problem however

2) I have checked webdynpro forum's for km functionlity,as per my initial findings if we get km api it will give all default view in the same view there will be one upload button which i want to change as per my requirent.Will i be able to change km's upload button ?

Best Regards,

Hemant

Accepted Solutions (1)

Accepted Solutions (1)

Abhinav_Sharma
Contributor
0 Kudos

Hi Hement,

As far I know you can not modify KM standard upload view. I faced the same problem and what i did was, i created a view and in which there was standard Upload UI Element. As the user clicks on upload button, it does some validations and then stores the file into repository.

First get a ResourceContext for Enterprise Portal 5 usr...

ResourceContext ctx = new ResourceContext(usrEP5);

RID rid = RID.getRID(...); // path to parent folder

ICollection parentDir =

(ICollection) ResourceFactory.getInstance().getResource( rid,ctx);

ByteArrayInputStream dataStream =

new ByteArrayInputStream(ctxElement.getCtx_va_resumeData());

// getting content

IContent getContent = new Content(dataStream, "text/plain", dataStream.available());

IResource resource = parentDir.createResource(fileName,null,getContent);

In this way u can upload any file to repossitory.

Hope this will help you.

Abhinav

Answers (3)

Answers (3)

Abhinav_Sharma
Contributor
0 Kudos

Hi Hemant,

You can find more on KM at

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/6615ea90-0201-0010-be81-e7a300fdf212">using Knowledge Management Functions in Web Dynpro</a>

Regards

Abhinav

Abhinav_Sharma
Contributor
0 Kudos

Hi Hemant,

yes, u r correct, the file directly go to KM path.

you need to add files from package com.sap.km.rfwizard

and also file com.sap.portal.usermappingapi in java build path.

I've tested this and it is running fine on NW04 SP13.

Abhinav

Former Member
0 Kudos

Hi Abhinav,

Thanks for your reply.

If i am correct by your code this file will directly go to km path .

Do we need to do anything extra like km libraries in webdynpro or any extra code?

Have u tested the functionality at your end ?

Regards,

Hemant