Entering content frameBackground documentation User Exits in Validations/Substitutions/Rules Locate the document in its SAP Library structure

User exits are user-defined FORM routines that are used to calculate and/or replace values within a validation, substitution, or rule.

User exits have the following format:

For example, U123 is a user exit.

You can configure the form pool name of the user exits and must store it in the table for client-dependent user exits (T80D) in Customizing. Table T80D contains the form pool names for the user exits used in validations, substitutions, and rules. Each validation/substitution form pool is client-dependent. (For more information, refer to the Maintain Client-Dependent User Exits activity in the Implementation Guide (IMG) for Special Purpose Ledger.)

Example form pools RGGBS000 and RGGBR000 for client 000 are shipped with the SAP R/3 System. You must copy these form pools and configure them in T80D. The new form pool name should conform to the customer’s naming convention (beginning with the letter Z ) so that is not overwritten when the next SAP upgrade is installed (for example, ZGGBR000).

Example

Example FORM routine for substitution exit 001 (U001).

TABLES: COBL.

FORM U001.
COBL-KOSTL = COBL-BUKRS.

ENDFORM.

Tables and structures should not be declared in the FORM routines so that the contents can be used together with the calling transaction.

SAP exits are FORM routines that have been programmed by SAP. The name of the form pool for SAP exits is SAPFGBEB.

Caution

If you still store your rules in table T890 (interpreted rules), you cannot use user exits in your rule definition. It is recommended that you use report program RGUGBR10 to convert interpreted rules into generated rules so that you can use the Customizing function for maintaining rules. For more information, see Using the Rule Manager Reports.

The following table shows the types of user exits that can be used in validations, substitutions, and rules.

User exit type

Description

Application

Example

1

No parameters are defined for the user exit.

Rules, validations, and substitutions (prerequisite)

See form pool RGGBR000, parameter type C_EXIT_PARAM_NONE

2

Same as user exit type 1, except one parameter (the field to be substituted) is defined in the user exit. For example, you can create a substitution routine that analyzes the cost center irrespective of the field used.

Substitution

See form pool RGGBS000, parameter type C_EXIT_PARAM_FIELD

3

All data is passed as one parameter; this exit type can only be used in matrix validations and substitutions.

Rules, validations, and substitutions (prerequisite)

See form pool RGGBR000, parameter type C_EXIT_PARAM_CLASS

 

Validations and rules use exit numbers 1 and 3 from the above table.

Substitutions use all of the exit numbers from the above table.

For substitutions, you can also create user exits that accept a field as one parameter and then return the changed value in this parameter. This allows you to create a user exit that can be used independently of the field and table name. This type of user exit cannot be used as an entry in the Exit only field in the list of values to be substituted; you can only use this exit type in conjunction with a field name. An example of this user exit type is in form pool RGGBS000.

Note

If you want to define a parameter for your user exit that is different from the result of a validation (B_RESULT), you must make an entry for your user exit in the FORM routine GET_EXIT_TITLES in the form pool you defined. It is recommended that you copy the SAP example form pool RGGBR000 for validation exits or RGGBS000 for substitution exits. These example form pools already contain entries in the FORM routine GET_EXIT_TITLES for the examples delivered by SAP.

 

 

 

Leaving content frame