Show TOC

 Implementing Checks

Use

The following methods are delivered in the standard system with superclass CL_HRPA_INFOTYPE_NNNN . In order to create your infotype, you must implement checks in one or more of these methods, although you are not necessarily required to re-define all of them. The methods that are subject to possible re-definition are as follows.

Standard Methods for Implementing Checks

Method

Purpose

SPECIFIC_INITIAL_COMPUTATIONS

This method fills in default values if a record is created anew.

SPECIFIC_READ_COMPUTATIONS

This method adds values into records after they are read from the database and before they are presented to the user.

SPECIFIC_MODIFY_COMPUTATIONS

This method ascertains whether it is permitted to modify a certain record.

SPECIFIC_INSERT_COMPUTATIONS

This method ascertains whether it is permitted to insert a particular record.

SPECIFIC_DELETE_COMPUTATIONS

This method ascertains whether it is permitted to delete a particular record.

As the naming convention implies, methods are referred to as “computations,” rather than “checks,” because any method can be applied to perform additional functions – for example, filling in derived values. Methods can even be used to write additional records into the buffer, or to prepare additional updates for tables that lie outside the PAnnnnname range . Therefore, if you wish to use methods to write data, you must take precautions to ensure that such methods are smoothly integrated.

Procedure

These methods should always be written as if an actual update will be requested and as if the database will not be updated. This requirement exists as the result of a mechanism in this release that allows the buffer to roll back at any time. We therefore recommend that you never update any table directly from within a check class; additional updates for tables that lie outside the PAnnnn name range must instead be processed via the so-called additional update mechanism, which serves to forestall errors that may arise from the absent buffer rollbacks.