cancel
Showing results for 
Search instead for 
Did you mean: 

using PDK classes in a WebDynpro DC

Former Member
0 Kudos

I want to access some PDK classes from a Web Dynpro DC. It seems that the only way to access them is through Used DC. Anyone knows where the PDK DC is and the steps to do this?

I have SP9 and I would like to access the following portal packages:

com.sap.portal.pcm.system

com.sap.portal.directory

com.sap.portal.pcm.admin

com.sapportals.portal.prt.jndisupport

Thanks!

Helen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

You will have to create a DC. Add the required Jar files to your DC and expose it as a public part.

Then use this DC in your WebDynpro DC as a used DC.

That should help you.

regards

ravi

Former Member
0 Kudos

Thanks for your reply.

I created a Public Part in another DC and added the jar files that I need to reuse. The public part's name is "pdklibraries" and under the gen->public->pdklibraries directory, there is a jar file named pdklibraries.jar and it contains all the pdk jar files.

In my DC, I added this public part as used DC and did a DC build, it failed. I got the same errors (can not find the packages).

Maybe the jar files can not be nested?

Helen

Former Member
0 Kudos

Hi Helen,

Don't add all the jars as single jar (pdklibraries.jar). Better you do the following steps

1. In NDS, click the menu Windows--> Preferences and then expand Java --> classpath variables

2. Create new variable "pdk1" and give the path of the first jar file.

3. Similarly add one variable for each jars.

4. After adding all the jars, select the project properties, and add the variables to the project classpath.

5. Rebuild the project and you will be able to get the classes in the pdk libaray to your project.

This should solve your problem.

Regards,

Santhosh.C

Former Member
0 Kudos

Hi Xianggun

If you want to add all the jars into 1 DC and use these DC in other DC's Do the following.

1. Unzip all the jars to some directory.

2. Creata a DC as pdkjars.

3. Copy the unzipped jars directory in to direcotory src/packages of you DC pdkjars.

4. go to public part of your DC and create public part. choose java package tree and select the jars. select all the classes in the package tree.

Hope this should solve your problem

Kishore

Former Member
0 Kudos

Kishore, your steps worked. Thanks a lot!

I wonder why we have to unjar these classes to make it work though.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Xianggun

1. In Eclipse create a variable as follows

Preferences-->Java -->classpath variables

Choose New on right hand side and create a variable.

Give the path of the one of the jars in your list

2. In the DC where you want to use these jars, right

click on the DC, choose properties/java build

path/libraries tab.

Click on Add Variable and click on the variable you have

created in step1 and extended the same to other PDK jars.

Let me know if you require furthur help.

Kishore

Former Member
0 Kudos

This did work for me. It seems that the only way is through reuse another DC. I tried that also but was not successful.

Former Member
0 Kudos

Thanks a lot for your reply.