Skip to Content

Procedure for KM Content Access  from NetWeaver 7.3

1.   Specifying the Dependencies of a KM Development Component

2. Create and add external library to DC contaning “ jar”

3. Add following code in web dynpro Code.

String pathofkmfile=”/documents/Public Documents/TREX.txt”; //Path of KM file can be changed as Required


try {

   IUser sapUser=   WDClientUser.getCurrentUser().getSAPUser();

   ResourceContext  contex= ResourceContext.getInstance(sapUser);

   IResourceFactory factory = ResourceFactory.getInstance();

   RID rid =RID.getRID(pathofkmfile);


   final IResource kmResource = factory.getResource(rid,contex);



      throw new ResourceNotFoundException(“KM Resource Not Found”+kmResource.getDisplayName());



   InputStream in =  kmResource.getContent().getInputStream();

   InputStreamReader is = new InputStreamReader(in);

   StringBuilder sb=new StringBuilder();

   BufferedReader br = new BufferedReader(is);

   String read = br.readLine();

   while(read != null) {


       read =br.readLine();




catch (Exception e) {



To report this post you need to login first.


You must be Logged on to comment or reply to a post.

    1. Dillip kumar Post author

      Though jar is Standard one but this is not available with  tc/km/frwk dc of KMC- CM SC. So the code gives compiler error in central build without jar as external lib.


Leave a Reply