Skip to Content

Introduction

This Blog describes how you can use the KM API within a WebDynpro Java DC. 

Implementation Steps

Step 1: Creating a new External Library Development Component

Using the KM API in a WebDynpro Development Component is different from a normal WebDynpro Application. Instead of adding the required libraries to the build path manually you have to create them in a seperate external library development component. For creating a new External Library Development Component proceed as follows:

  • Choose “File -> new -> Project -> Development Component -> Development Component Project
  • Select your corresponding track -> Next -> Select a vendor and name -> Type External Library
  • Press Finish

image

Step 2: Add all relevant jar-files to DC

Now it’s time to add all jar-files which are relevant to use the KM API. Below is a list of all relevant jar-files:

  • com.sap.security.api.ep5.jar
  • bc.rf.framework_api.jar
  • bc.rf.global.service.urlgenerator_api.jar
  • bc.sf.framework_api.jar
  • bc.util.public_api.jar

 Add these jar-files to your libraries-folder in your External Library DC.

image

Step 3: Add jar-files to a new Public Part

After adding the jar-files to your external library DC, you also have to include them in a Public Part. To add them to a Public Part, select all jar-files and right click -> Development Component -> Add to Public Part.

image

image

Step 4: Creating a new WebDynpro Development Component

For creating a new WebDynpro Development Component proceed as follows:

  • Choose “File -> new -> Project -> Development Component -> Development Component Project
  • Select your corresponding track -> Next -> Select a vendor and name -> Type WebDynpro
  • Press Finish

image

Step 5: Integrate Public Part as used DC to your WebDynpro DC

To make the KM Library available at Design Time for your Web Dynpro Project, you have to add your previous created external KM Library DC as Used DC.

Therefore navigate to DC MetaData -> DC Definition -> Used DC -> Context Menu (Add Used DC)

image

image

I have to mention, that here is a little mistake in the screenshot. Sorry for that. You can see a Public Part named “extLibKM”. According to Step 3 we have defined the name “kmclib”.

Step 6: Add SharingReference to your WebDynpro DC

The first steps we have done are only relevant for design and build time. To use the KM API at Run-Time also, we have to add a SharingReference to our project. Therefore we have to proceed as follows:

  • Open Context Menu of project and select ‘Properties’
  • Select WebDynpro References
  • Select SharingReference
  • Add the following: PORTAL:sap/com.sap.km.application 

Step 7: Deploy and run your application

Deploy and run your application. Activate your open activities and create a WebDynpro iView in your Portal.Now you should be able to use the KM Library at Design and Runtime.

To report this post you need to login first.

2 Comments

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

  1. Matthew Harding
    Hi Denis,

    I wrote something similar for XI DC development, and am still perplexed how there are so many Portal and XI developers that don’t know how to use NWDI.  You’re blog is clear and concise and can be easily applied to non-Web Dynpro Portal KM DC development too.

    Good work,
    Matt

    (0) 
  2. Karsten Geiseler
    Hi Denis.

    Your blog is not exactly true. There is a KMC SC that you can reference. It is called KMC-CM and the public parts you need are:
    tc/km/frwk
    tc/km/nonwdui

    For many KMC developments it is sufficient to just add just these two to the used dcs. For alle other APIs you want to use and are not contained in any of the standard SCs, the approach you described in the blog is correct. This is also described in SAP note 906973.

    A good starting point in general is:
    http://help.sap.com/saphelp_nw70/helpdata/EN/45/1282b176a341e1e10000000a1553f6/frameset.htm

    Cheers, Karsten

    (0) 

Leave a Reply