Creating a Portal User through
Web Dynpro
Summary
This article is a guide to create a portal user through Web Dynpro. After going through the procedure the
users can modify and enhance the application according to their requirements.
Author: Naresh Garg
Company: L&T Infotech
Created on: 25 Aug 2008
Author Bio
Naresh Garg is working as a Web Dynpro consultant in L&T Infotech Pvt. Ltd. for last 9
months.
SAP DEVELOPER NETWORK | [Link] BUSINESS PROCESS EXPERT COMMUNITY | [Link]
© 2008 SAP AG 1
Creating a Portal User through Web Dynpro
Table of Contents
Procedure ...........................................................................................................................................................3
Create Project .................................................................................................................................................3
Add Jar files ....................................................................................................................................................3
Create Application...........................................................................................................................................4
Create Context Attributes and Actions............................................................................................................5
Create the Layout............................................................................................................................................5
Implementation................................................................................................................................................6
Deployment and Execution .............................................................................................................................7
Related Content ..............................................................................................................................................8
Disclaimer and Liability Notice............................................................................................................................9
SAP DEVELOPER NETWORK | [Link] BUSINESS PROCESS EXPERT COMMUNITY | [Link]
© 2008 SAP AG 2
Creating a Portal User through Web Dynpro
Procedure
Create Project
Create a new Web Dynpro project named CreatePortalUser.
Add Jar files
Add “[Link]” to the java build path of the application.
SAP DEVELOPER NETWORK | [Link] BUSINESS PROCESS EXPERT COMMUNITY | [Link]
© 2008 SAP AG 3
Creating a Portal User through Web Dynpro
Create Application
Create the application CreatePortalUserApp.
In the package give a package name as you like.
Click on Next.
In the window that appears keep the default values and click on Finish.
SAP DEVELOPER NETWORK | [Link] BUSINESS PROCESS EXPERT COMMUNITY | [Link]
© 2008 SAP AG 4
Creating a Portal User through Web Dynpro
Create Context Attributes and Actions
Create four context attributes, as displayed.
Create the action createuser
Create the Layout
Create four input fields as displayed and assign the values to the respective input fields.
Create a button and for onAction property select value “createuser”.
SAP DEVELOPER NETWORK | [Link] BUSINESS PROCESS EXPERT COMMUNITY | [Link]
© 2008 SAP AG 5
Creating a Portal User through Web Dynpro
Implementation
In the Implementation tab, paste the following code inside the onActionCreateUser.
String user = [Link]().getUser();
String lastName = [Link]().getLastName();
String firstName = [Link]().getFirstName();
String email = [Link]().getEmail();
IUserFactory userFact = [Link]();
try {
IUserMaint userMaint = [Link](user);
[Link](lastName);
[Link](firstName);
[Link](email);
[Link]();
[Link]().reportSuccess("User Created "+user);
} catch (UMException e) {
[Link]().reportException([Link](),false);
[Link]();
}
SAP DEVELOPER NETWORK | [Link] BUSINESS PROCESS EXPERT COMMUNITY | [Link]
© 2008 SAP AG 6
Creating a Portal User through Web Dynpro
Deployment and Execution
Deploy and run the application and after filling the appropriate values click on Create button.
With this step the user is successfully created.
To check whether the user is created you need to have the UserAdmin rights of the portal.
You can search the portal for the user you have created.
SAP DEVELOPER NETWORK | [Link] BUSINESS PROCESS EXPERT COMMUNITY | [Link]
© 2008 SAP AG 7
Creating a Portal User through Web Dynpro
Related Content
UME Actions in Portal
Protecting Access to the Web Dynpro Car Rental Application Using UME Permissions
Protecting Access to a J2EE-Based Car Rental Application Using UME Permissions
For more information, visit the Portal and Collaboration homepage.
SAP DEVELOPER NETWORK | [Link] BUSINESS PROCESS EXPERT COMMUNITY | [Link]
© 2008 SAP AG 8
Creating a Portal User through Web Dynpro
Disclaimer and Liability Notice
This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not
supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,
and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or
code sample, including any liability resulting from incompatibility between the content within this document and the materials and
services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this
document.
SAP DEVELOPER NETWORK | [Link] BUSINESS PROCESS EXPERT COMMUNITY | [Link]
© 2008 SAP AG 9