Z_LOCKED_USERS.abap

This code is an ABAP report that displays a list of locked or unlocked users based on the user's selection and allows navigation to transaction SU01 for user maintenance.

Dependencies

cl_salv_table external
cl_salv_events_table external
cl_salv_columns_table external
if_salv_c_cell_type external
cx_salv_msg external
cx_salv_not_found external

Visualization

Code Elements

Report

z_locked_users global
Line 8
Main program for reporting locked/unlocked users.
Standard ABAP report header used for defining the report name.

Table

usr02 global
Line 10
ABAP table used to store user data, specifically for user information in the system.
Tables statement used to declare the SAP standard table USR02 for fetching user data.

Type

ty_user global
Line 12
Structure used to define the layout of user data.
Data type definition for storing individual user information with fields bname (username), erdat (creation date), and uflag (user flag status indicating locked or unlocked).

Variable

gt_user global
Line 19
Internal table for storing user data fetched from database based on selection screen input.
Data declaration for an internal table holding multiple user entries.
gs_user global
Line 20
Work area for individual user records during table operations.
Data declaration for a work area used to process single user entries within gt_user.
lr_table local
Line 54
Reference variable for ALV table object
Holds reference to the main ALV grid table object for display configuration
lr_events local
Line 55
Reference variable for ALV events
Manages event handling for the ALV grid
lr_columns_table local
Line 57
Reference variable for ALV columns configuration
Handles column settings and properties for the ALV display
lv_heading local
Line 68
Stores the header text for the ALV grid.
Dynamic header for ALV grid based on the count and selection of locked or unlocked users.
lv_count local
Line 69
Stores the number of lines in the internal table gt_user.
Describes and holds the number of users matching the selected criteria.

Class

lcl_alv_handler local
Line 23
Local class that functions as an event handler for ALV grid row click events.
Defines methods to handle click events, specifically navigating to transaction SU01 for the clicked user.

Method

on_line_click local
Line 27
Handles click events on the ALV grid to navigate to user maintenance (SU01).
Reads selected row data to set the user parameter and initiates a call to transaction SU01 with that parameter.

Selection-Screen Element

SELECTION-SCREEN BLOCK global
Line 34
Defines the user interface for selecting reporting criteria.
Group of screen elements allowing user to select locked or unlocked users through radio buttons.

Selection-Screen Parameter

p_lock global
Line 35
Radio button for selecting locked users.
Parameter for user input to signify the report should list locked users.
p_nlock global
Line 36
Radio button for selecting unlocked users.
Parameter for user input to signify the report should list unlocked users.

Text-Symbol

text-001 global
Line 34
Text symbol used for selection screen block title
Text symbol defining the title of the selection screen block

Form

get_data local
Line 42
Retrieves user data based on selected criteria from the selection screen.
ABAP form routine that selects users from USR02 table based on their lock status (uflag).
display_data local
Line 54
Displays the fetched user data in an ALV grid.
Sets up ALV grid with event handlers and displays the user data, allowing interaction.