0% found this document useful (0 votes)
26 views

Creating Use in Webdynpro

This document provides steps to create a portal user through a Web Dynpro application. It describes creating a Web Dynpro project and application, adding necessary Java libraries, defining context attributes and actions, designing the user interface, and implementing the code to call the user management APIs to create a new portal user. The application is then deployed and tested.

Uploaded by

vijaysri
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Creating Use in Webdynpro

This document provides steps to create a portal user through a Web Dynpro application. It describes creating a Web Dynpro project and application, adding necessary Java libraries, defining context attributes and actions, designing the user interface, and implementing the code to call the user management APIs to create a new portal user. The application is then deployed and tested.

Uploaded by

vijaysri
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

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 | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com


© 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 | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com


© 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 “com.sap.security.api.jar” to the java build path of the application.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com


© 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 | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com


© 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 | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com


© 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 = wdContext.currentContextElement().getUser();
String lastName = wdContext.currentContextElement().getLastName();
String firstName = wdContext.currentContextElement().getFirstName();
String email = wdContext.currentContextElement().getEmail();

IUserFactory userFact = UMFactory.getUserFactory();


try {

IUserMaint userMaint = userFact.newUser(user);


userMaint.setLastName(lastName);
userMaint.setFirstName(firstName);
userMaint.setEmail(email);
userMaint.commit();
wdComponentAPI.getMessageManager().reportSuccess("User Created "+user);

} catch (UMException e) {

wdComponentAPI.getMessageManager().reportException(e.getMessage(),false);
e.printStackTrace();
}

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com


© 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 | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com


© 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 | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com


© 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 | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com


© 2008 SAP AG 9

You might also like