How to create a user exit for Validation / Substitution ?

Define your user exit in the FORM routine GET_EXIT_TITLES with the correct exit type (EXITS-PARAM). You can use the existing sample entries as a template for this.

 

The exit types required in the FORM routine GET_EXIT_TITLES are organized as follows:

 

C_EXIT_PARAM_NONE:  No parameter apart from the return value (B_TRUE or B_FALSE), you do not need any parameters for the validation. If you do not want to substitute a field, use this parameter in the substitution (select "Only exit"). However, you must then use a TABLE statement in the FORM pool (not in the actual form) to identify the relevant structure.

 

C_EXIT_PARAM_FIELD:  A Field is transferred as a parameter you only use this type in the substitution. Exactly one field is substituted. Enter user exits of this type in the substitution maintenance instead of assigning a constant value.

 

C_EXIT_PARAM_CLASS: A complete type is transferred as a parameter Matrix validations/substitutions ("Only exit"). This exit type can only be used for call up points with complete documents, for example in FI and LC. You cannot use this exit type for any other call up points.

 

The transferred type contains all information about a class.

 

An example is the use of the document header and all corresponding line items in the FI area.

In the FORM routine GET_EXIT_TITLES, change the fields NAME and TEXT of the internal table EXITS to the values you want. Use one of the sample routines as a template and copy these to the names you selected. You can now implement the functions you want in this FORM routine.

After you have finished creating the user exit, you can use it in your validations or substitutions.

No comments:

Post a Comment