Custom Password Reset Tool in SAP Enterprise Portal Using Web Dynpro for Java

Similar documents
How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

Displaying SAP Transaction as Internet Application in Portal

Integration of Web Dynpro for ABAP Application in Microsoft Share Point Portal

POWL: Infoset Generation with Web Dynpro ABAP

Graphical Mapping Technique in SAP NetWeaver Process Integration

Table Row Popup in Web Dynpro Component

Dynamically Enable / Disable Fields in Table Maintenance Generator

BAPI Execution in offline Adobe Form

Freely Programmed Help- Web Dynpro

Linking Documents with Web Templates

How to Create Top of List and End of List of the ALV Output in Web Dynpro for ABAP

Using Radio Buttons in Web Template

Fetching User Details from the Portal and Displaying it in Web Dynpro with Authentication in the Portal

Easy Lookup in Process Integration 7.1

MDM Syndicator: Custom Items Tab

Add /Remove Links on ESS Home Page in Business Package 1.5

Dialog Windows in WebDynpro ABAP Applications

Different Types of iviews in Enterprise Portal 7.0

How to use Boolean Operations in the Formula as Subsidiary for IF Condition

How to Default Variant Created for Report Developed In Report Painter/Writer

How to Integrate SAP xmii Services with Web Dynpro Java

Creating Rules in Process Composer and using them in Process

Database Statistics During ODS Activation

How to Create and Schedule Publications from Crystal Reports

Creating Custom SU01 Transaction Code with Display and Password Reset Buttons

MDM Import Manager - Taxonomy Data (Attribute Text Values) Part 3

Config Tool Activities

Programmatical Approach to User Management in Enterprise Portal

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

SDN Community Contribution

How to Integrate Web Dynpro ABAP in Portal and Capture Portal Logon User Name

Upload Image file from system in Web dynpro view

Creation of Sets in SAP-ABAP, How to Read them INI SAP-ABAP Reports

Internationalization in WebDynpro ABAP Applications

Calculate the Number of Portal Hits Part 2

Step by Step Method for File Archival in BW

Federated Portal for Composite Environment 7.1

Web Dynpro ABAP: Changing ALV Contents and Saving in Database

Web Dynpro: Coloring Table Conditionally

Open Text DocuLink Configuration - To Access Documents which are Archived using SAP

Material Listing and Exclusion

SUP: Personalization Keys and Synchronize Parameter

SMT (Service Mapping Tool)

Recreating BIA Indexes to Address the Growth of Fact Index Table

Information Broadcasting Part 3 Scheduling the First Report

Step by Step Guide How to Use BI Queries in Visual Composer

Standalone BW System Refresh

Step By Step: the Process of Selective Deletion from a DSO

SDN Community Contribution

Adding Files as Attachments to SAP Interactive Forms in the Java Environment

SAP Biller Direct Step by Step Configuration Guide

Limitation in BAPI Scheduling Agreement (SA) Create or Change

Creating, Configuring and Testing a Web Service Based on a Function Module

This article explains the steps to create a Move-in letter using Print Workbench and SAPScripts.

SDN Community Contribution

DB Connect with Delta Mechanism

Implying Security on Business Object XI 3.1 Universe having SAP BW as Source

Solution to the Challenges in Pivoting

Web Dynpro ABAP: Dynamic Table

Extracting Missing Fields of Data Source Which Are Present In Their Extract Structure

How to Download Multiple Files in ZIP using WebDynpro Java

Material Master Archiving in Simple Method

Customizing Characteristic Relationships in BW-BPS with Function Modules

Maintaining Roles and Authorizations in BI7.0 - RSECADMIN

Step by Step Procedure for DSO Creation

Table Properties and Table Popin

Using Nested Exception Aggregation in BEx Reports- Scenario

How to Create Business Graphics in Web Dynpro for ABAP

Data Flow During Different Update Mode in LO Cockpit

Process Chain Log Deletion

Creation of Alert Data Service VC model for the BI query exception using Information Broadcasting

E-Sourcing System Copy [System refresh from Production to existing Development]

How to Display Traffic Lights for Exceptions in BI Web Reports

How to Create View on Different Tables and Load Data through Generic Datasource based on that View

About ITAB Duplicate_Key (SAP lrsaods) Runtime Error

ios Ad Hoc Provisioning Quick Guide

Universal Worklist - Delta Pull Configuration

How to Display Result Row in One Line While Reporting On Multiproviderer

Federated Portal Network Remote Role Assignment Step-by- Step Configuration

How to Work with F4 Input Help Effectively in BEX

Using Query Extract to Export Data from Business warehouse, With Pros and Cons Analyzed

External Driver Configuration in Process Integration 7.1 Using JSPM

Open Hub Destination - Make use of Navigational Attributes

A Step-by-Step Guide on IDoc-ALE between Two SAP Servers

Load Info Cube in SCM 5.0 (BI 7.0)

SAP BI BO Unit/Currency Logic for Unknown Units Case Study

Step by Step Guide for PI Server Start and Stop Procedure

Creating Multiple Methods/Operations and Exposing BAPI as a Webservice

Step By Step Procedure to Implement Soap to JDBC Scenario

Customized Transaction to Trigger Process Chain from Failed Step

ABAP HR: Standard Info Type Enhancement

Printer Landscape Made Easy!!

SDN Community Contribution

Step-By-Step guide to Virtual InfoCube Implementation

Purpose of Goods Receipt Message indicator in Purchase Orders

ecatt Part 6 System Data Container

SAP PI/XI: Generating Sequence Number Between Multiple Instances of Mapping Execution

Xcelsius Tricks Part 5 Create a Loading Bar in SAP Crystal Dashboard and Presentation Design (Xcelsius 2008)

Step by Step Guide on How to Use Cell Definition in BEx Query

Web Dynpro Interactive Forms Data Transfer and Scripting

Transcription:

Custom Password Reset Tool in SAP Enterprise Portal Using Web Dynpro for Java Applies to: SAP Enterprise Portal, Web Dynpro for Java. For more information, visit the Portal and Collaboration homepage. Summary This article is all about developing a new password reset tool for SAP Enterprise portal using Web Dynpro for Java. This simple application can be made available to the portal end users to reset their passwords themselves without requesting administrator. This tool can be reused in any project when SAP Enterprise Portal as a frontend and UME Data source is writable. Author: Ramganesan Karuppaiah Company: Infosys Technologies Limited, Bangalore, India Created on: 26 November 2010 Author Bio Ramganesan Karuppaiah is a NetWeaver Portal Consultant currently working with Infosys Technologies Limited, Bangalore. He has 4.5+ years of extensive experience in SAP Enterprise Portal and ABAP. He is an SAP Certified ABAP with NetWeaver 7.0 development Associate. Also he is a Sun Certified Java Programmer 1.5. His nature of work involves Portal Administration, Portal Customization, Personalization and Content Development & Customization using Web Dynpro for Java, JSP Dynpage and ABAP. 2010 SAP AG 1

Table of Contents Introduction... 3 Preview of Output... 3 Procedure... 3 Creation of Web Dynpro Project... 3 Creation of Context Elements... 6 Creation of methods... 8 UI changes... 10 Implementation of Methods... 10 Deploy and Run... 14 Advantages and Drawbacks... 14 Advantages... 14 Drawback... 14 Related Content... 15 Disclaimer and Liability Notice... 16 2010 SAP AG 2

Introduction The document is about developing a new password reset tool for SAP Enterprise portal using Web Dynpro for Java. This application can be made available to the portal end users to reset their passwords themselves without requesting administrator. Preview of Output The completed Web Dynpro application shall display the end result as per the screen shot below. Procedure Below are the steps required to create and run the password reset applications in Web Dynpro for Java. Creation of Web Dynpro Project Creation of Context Elements Creation of methods UI Changes Implementation of Methods Deploy and Run The below details are used in this article to describe the steps. Web Dynpro Project Name: Component Name: View Name: Application Name: PasswordReset_WD PasswordReset _WDComp PasswordResetView PasswordResetApp Creation of Web Dynpro Project Open Web Dynpro Perspective in NWDS File New Web Dynpro Project 2010 SAP AG 3

Enter Web Dynpro Project Name Press Finish Right click on Application to create an Application Create Application Enter Application and package details 2010 SAP AG 4

Select Create a New component next Provide all required details. 2010 SAP AG 5

Creation of Context Elements Open View Context Create context elements as per the below screen shot. Right click on the View Apply Template 2010 SAP AG 6

Select Form Next Select the context element next Finish A form shall be created in the view PasswordResetView as per the above screenshot. 2010 SAP AG 7

Creation of methods Go to Methods Tab to create methods -> Press New to create a new method. Create 2 methods as per the below screenshot details. The method clearform shall be used to reset the form data entered by end users. The method resetpassword shall perform validations and change the password upon valid inputs. 2010 SAP AG 8

Create Action button Press Next Select the event Handler properties for Password reset button Finish 2010 SAP AG 9

UI changes Change the look and feel of the layout as per the below details 1. Set the input field User Name as read only. 2. Set all the fields are mandatory 3. Set Old Password, New Password and Confirm New Password fields are as password fields. Implementation of Methods Below validations can be used in this password change applications. Check for All Mandatory fields. Check for confirm and new passwords equality. Check for old and new passwords inequality. The New password should not be the used id. The first letter of the password should be an alphabet. New password length should be between 6 and 12 chars. Check for invalid old password. Change the password if the given input is valid. UME API methods have been used is used to compare the old password entered by enduser with LDAP. Also, it changes the password on valid inputs. 2010 SAP AG 10

public void resetpassword( ) { //@@begin resetpassword() String userid = wdcontext.currentcontextelement().getuserid(); String oldpass = wdcontext.currentcontextelement().getoldpassword(); String newpass = wdcontext.currentcontextelement().getnewpassword(); String confpass = wdcontext.currentcontextelement().getconfirmnewpassword(); boolean isvalidpwd = false; if(userid!= null &&!userid.equals("") && oldpass!= null &&!oldpass.equals("") //Check for Mandatory Fields && newpass!= null &&!newpass.equals("") && confpass!= null &&!confpass.equals("")){ if(confpass.equals(newpass)){ // Confirm password and New Password should be same if(!oldpass.equalsignorecase(newpass)){ // The New password should not be the old password if(!newpass.equalsignorecase(userid)){ // The New password should not be the user id char start = newpass.charat(0); // The first letter of the password should be an alphabet if( (start >= 'a' && start <= 'z') (start >= 'A' && start <= 'Z')){ if( newpass.length() >= 6 && newpass.length() <= 12 ){ // New password length should be between 6 and 12 chars try{ IUserAccount useracct = UMFactory.getUserAccountFactory().getUserAccountByLogonId(userId); IUserAccount mutuseracct = UMFactory.getUserAccountFactory().getMutableUserAccount(userAcct.getUniqueID()); // Check for valid password isvalidpwd = useracct.checkpassword(oldpass); if(isvalidpwd){ useracct.setpassword(newpass); // Change the Password useracct.commit(); // Save the change wdcomponentapi.getmessagemanager().reportsuccess("your Password has been changed now!"); wdcontext.currentcontextelement().setnewpassword(""); wdcontext.currentcontextelement().setconfirmnewpassword(""); 2010 SAP AG 11

else{ wdcontext.currentcontextelement().setoldpassword(""); wdcomponentapi.getmessagemanager().reportexception("invalid Old Password!",true); wdcontext.currentcontextelement().setoldpassword(""); catch(umexception e){ wdcomponentapi.getmessagemanager().reportexception("the Password can not be changed!",true); else{ " + wdcomponentapi.getmessagemanager().reportexception("the password length should "be between 6 and 12 chars!",true); wdcontext.currentcontextelement().setnewpassword(""); wdcontext.currentcontextelement().setconfirmnewpassword(""); else{ wdcomponentapi.getmessagemanager().reportexception("new Password should start with an alphabet, true); else{ wdcontext.currentcontextelement().setnewpassword(""); wdcontext.currentcontextelement().setconfirmnewpassword(""); wdcomponentapi.getmessagemanager().reportexception("user Id can not be a password!",true); else{ wdcontext.currentcontextelement().setnewpassword(""); wdcontext.currentcontextelement().setconfirmnewpassword(""); wdcomponentapi.getmessagemanager().reportexception("old Password and New" + " Password should not be same!",true); wdcontext.currentcontextelement().setnewpassword(""); wdcontext.currentcontextelement().setconfirmnewpassword(""); wdcontext.currentcontextelement().setoldpassword(""); 2010 SAP AG 12

else{ " + wdcomponentapi.getmessagemanager().reportexception("confirm Password and New "Pass Password fields should be same!",true); wdcontext.currentcontextelement().setnewpassword(""); wdcontext.currentcontextelement().setconfirmnewpassword(""); //End of If Loop else{ wdcomponentapi.getmessagemanager().reportexception("enter All required Fields!",true); //@@end The method clearform() clears the inputs fields entered by the end user i.e. It resets the form. public void clearform( ) { //@@begin clearform() wdcontext.currentcontextelement().setnewpassword(""); wdcontext.currentcontextelement().setconfirmnewpassword(""); wdcontext.currentcontextelement().setoldpassword(""); //@@end 2010 SAP AG 13

Deploy and Run Create Web Dynpro Application Deploy New Archive and Run. The Application is launched in a new browser Window. To enable the deployed application to portal end-users, A new iview can be created against the deployed Web Dynpro application and displayed in portal as a part of Detailed Level Navigation/Top Level Navigation/a link on masthead to access the application. Advantages and Drawbacks Advantages 1. Simple, Handy and User friendly. 2. Enables end users to reset the portal password. 3. Only authorized persons (i.e. Logged in user) can change the password. 4. This tool uses standard UME API to validate the current password and change it as per the user inputs. 5. This tool is applicable to all portal versions. 6. This can be reused in any project when SAP Enterprise portal as a front end and UME Data source is writable. Drawback 1. The password can not be changed if the UME Data source is read only. This scenario might occur when the corporate LDAP is the data source for portal. 2010 SAP AG 14

Related Content Creating a Simple Web Dynpro Java Application Creating your first Web Dynpro Java Application Other Web Dynpro references For more information, visit the Portal and Collaboration homepage. 2010 SAP AG 15

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. 2010 SAP AG 16