cancel
Showing results for 
Search instead for 
Did you mean: 

check Portal userID existence

Former Member
0 Kudos

I need to develop a WEBDYNPRO program that

checks the existence and eventually reads the following data from any userID allowed to enter the portal: Name, LastName and Profile.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

thanks, I cannot recover the user with GETSAPUSER why in that moment the amministatore is connected. The administrator must insert USERID of a customer and control of the existence. For Example the administrator inserts USERID "TOMMY" and presses push-button "CHECK" of the WebDynpro. Therefore the message will be visualized: Present customer or not present Customer and other information of the customer!

Former Member
0 Kudos

Hi Mario,

1. User enters the Portal User Id and clicks CHECK

2. Read the value (user id) entered by the user and check whether the user id exists in Portal or not, using this code.

IUserFactory userFac = UMFactory.getUserFactory();
boolean userExisFlag = false;
myuserId = <value entered by the user>;
try
{
    userFac.getUserByLogonID(myuserId);
    userExisFlag = true;				
}
catch(NoSuchUserException ex)
{
  userExisFlag = false;
}
catch(UMException umEx)
{
  // Exception Handling logic
}
finally
{
   if(userExisFlag)
   {
	// User exists is Portal
   }
   else
   {
        // User does not exists in Portal
   }
}

<b>Note: Add com.sap.security.api.jar JAR file to your project (Project->Properties->Add External Jars)</b>

Thanks

Senthil

P.S: Rewards Points for useful answers.

Message was edited by: SenthilKumar Radhakrishnan

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Check this thread which has sample code reg ur ques..

Hope this helps u.

Regards,

Vijayakhanna Raman