Integrating External Tables

To provide an external table that already contains user-specific data for user or role maintenance, implement a class that in turn implements interface IF_PERS_EXTERNAL_TABLE.

Use class CL_SUPER_PERS_ACCESS to implement the interface. From this class, all the necessary methods can be inherited. For compatibility reasons, always derive your implementation from this class. This approach improves stability if the interface is enhanced.

The methods are described briefly as follows.

Copying Users: Method USER_COPY
Parameter Type Description
P_USER_SOURCE UNAME Name of the source user
P_USER_TARGET UNAME Name of the target user
P_PERS_KEY SPERS_KEY Key for the personalization object
P_NO_BUFFER CHAR1 Flag for avoiding buffering
Deleting Users: Method USER_DELETE
Parameter Type Description
P_USER UNAME Name of the user whose personalization data should be deleted
P_PERS_KEY SPERS_KEY Key for the personalization object
Renaming Users: Method USER_RENAME
Parameter Type Description
P_USER_SOURCE UNAME Old user name
P_USER_TARGET UNAME New user name
P_PERS_KEY SPERS_KEY Key for the personalization object
Calling a User Dialog: Method USER_DIALOG
Parameter Type Description
P_UNAME UNAME Name of the source user
P_PERS_KEY SPERS_KEY Key for the personalization object
P_COMMIT CHAR1

Flag for buffering:

If the flag is 'X', the data is not buffered.

Transporting Roles: Method ROLE_TRANSPORT
Parameter Type Description
P_ROLE_NAME AGR_NAME Name of the role to be transported
P_PERS_KEY SPERS_KEY Key for the personalization object
P_ORDER TRKORR Transport request with which the data is transported.

Dialog, Deleting, Copying, and Renaming Roles

The methods for the dialog and for deleting, copying, and renaming roles must be implemented in the same way.

Dialog for System Data

The dialog method for system data can be implemented analogously to the methods for users and roles.

Transporting Data to the System

The method for transporting data to the system can be implemented analogously to the method for roles.

Storing the Buffer

With this method, all the data is written from the buffer to the database.

Deriving your own Interface Implementation

You can implement your own access methods with inheritance.

Class CL_SUPER_PERS_ACCESS can be used here. Only implement the constructor in your own derived class. Assign the names of the table and the field containing the user and role names in the constructor. Dynamically create a header line and an internal table for the access.

This constructor is implemented in example class SPERSD_REUSE_EXTERNAL for table SPERS_FAV.

method CONSTRUCTOR.
* ...
  data: l_fieldname type fieldname.

* set types for buffer table
  types: t_buffer_table_user type standard table of spersd_fav
                             with default key.
  types: t_buffer_line_user type spersd_fav.

  types: t_buffer_table_role type standard table of spersd_fav
                             with default key.
  types: t_buffer_line_role type spersd_fav.

* set user table name
  table_user = 'SPERSD_FAV'.
  field_user = 'UNAME'.

* set user table name
  table_role = 'SPERSD_FAV'.
  field_role = 'ROLE'.

* create buffer table and work area
  create data buffer_table_user type t_buffer_table_user.
  create data buffer_line_user type t_buffer_line_user.

* create buffer table and work area
  create data buffer_table_role type t_buffer_table_role.
  create data buffer_line_role type t_buffer_line_role.

* set hidden fields for generic dialog
  l_fieldname = 'MANDT'.
  append l_fieldname to dialog_fields_hide.
  l_fieldname = 'UNAME'.
  append l_fieldname to dialog_fields_hide.
  l_fieldname = 'ROLE'.
  append l_fieldname to dialog_fields_hide.
  l_fieldname = 'NUM'.
  append l_fieldname to dialog_fields_hide.

endmethod.

In the example, the table types for the user-specific and role-specific data is defined and the corresponding buffer tables are created. The names of the table fields that should not be displayed when the generic dialog is used are also specified.