cancel
Showing results for 
Search instead for 
Did you mean: 

package com.sap.security.api does not exist

Former Member
0 Kudos

Hi,

I hope anybody can help me.

I´m trying to get the current User of a Web Dynpro in a Portal(NW 7.3).

For this I used the following code:

     IUser user = null;

   try {

   user = WDClientUser.getCurrentUser().getSAPUser();

   } catch (WDUMException e) {

    wdComponentAPI.getMessageManager().reportException( "Failed to get current user: " + e.getLocalizedMessage(), true); 

   }

At building I get the error:    package com.sap.security.api does not exist

According to other topics I added a variable in the Build Path with the com.sap.security.jar but I`m getting still this error!?

Thank you.

regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you are building a WD DC on NW 7.3 then you shouldn't need to add anything to the build path - Web Dynpro DC's in 7.3 NWDS should have all of the correct WD libraries they need to access the Portal UME directly.

Older versions of the Portal (up to 7.0 I think) needed the com.sap.security api added (and to do that, you added them as a dependancy to the DC, not directly by editing the buildpath of your project.)

To get the User details from WD 7.3 try something like:

public String getCurrentSAPUser(){

     try {
          IWDClientUser user = WDClientUser.getCurrentUser();
          String fullUser = user.getClientUserID();
          String[] temp = null;
          temp = fullUser.split(":");
          String language = user.getLocale().getLanguage();
          String sapUser = temp[1];
          return sapUser;
     } catch (Exception ex) {
          logger.errorT("Failed getting SAP user");
          return null;
     }

This should be a decent starting point for what you are trying to do.

Gareth.

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

thank you all for your reply. The code fromNot Active Contributor

Former Member
0 Kudos
junwu
Active Contributor
0 Kudos
add this dc tc/je/usermanagement/api to your dependency.
Former Member
0 Kudos

Hi,

Check this thread

http://scn.sap.com/thread/1873427

Regards,

Venkata S Pagolu.

junwu
Active Contributor
0 Kudos
i believe it is a DC, you have to add jar as used dc.