0

How to Retrieve a List of Locked User Accounts directly from SAP NetWeaver Portal

Background

A problem ticket was created for a production issue wherein the SAP NetWeaver Portal application’s Unlock Users functionality is taking too long to even just list the all locked accounts from a specific country. During the investigation, I found out that the application first retrieves the list of user IDs from an Oracle database, and uses each user ID to determine whether or not an associated account in SAP NetWeaver Portal is  locked or not.

There is a better way to do this. The available API allows for user account search using other user properties like country name, User Account Locked, Logon ID, and etc.

Software Environment

  • Windows 7 Professional SP1
  • Java 2 SDK 1.4.2 for Windows 32-bit
  • SAP NetWeaver Developer Studio Version 7.0.09 for Java
  • SAP NetWeaver Application Server
    • ​sap.com/SAP-JEECOR  – 7.00 SP26 (1000.7.00.26.1.20120307143343)
    • sap.com/SAP-JEE – 7.00 SP26 (1000.7.00.26.0.20120109175405)

Create a Web Dynpro

First, create a new Development Component Project via File -> New -> Development Component Project. For this post, LocalDevelopment~unlockusertest~sap.com has been created.
01-list-of-locked-accounts_wm

Modify the View

Place a TextView and DropDownByIndex UI components.

02-list-of-locked-accounts_wm

Then, modify the view’s context.

03-list-of-locked-accounts_wm

The Codes

Place the following codes in the wdDoModifyView() method and within //@begin wdModifyView and //@end lines

A Locked User Account For Testing

06-list-of-locked-accounts_wm

Sample Output

The TextView UI component displays the number of retrieved locked accounts while the DropDownByKey UI component displays the user IDs of the locked accounts.
04-list-of-locked-accounts_wm
05-list-of-locked-accounts_wm
Karl San Gabriel

Karl San Gabriel

Java and Enterprise Technologies Expert