SAP Substitutions


Substitutions are an enhancement technique that allow users to substitute specific fields. These enhancement technique is available for the FI-CO module.

Substitutions are divided in two parts:

  • Prerequisite: the condition to execute the substitution
  • Substitution: the field and characteristics of the process

If the prerequisite is met, then the substitution will be executed.

Configuring a Substitution

In order to create a Substitution, you will have to follow these steps:

  • Get into the application area where the substitution will be called
  • Choose the correct call-up point
  • Create the definition of the Substitution
  • Assign the substitution to an Organization Unit
  • Activate the Substitution

 Callup Points:

  1. The Callup Point 1 indicates when the substitution is performed. It checks the fields in a document header

  2. The callup point 2 checks the fields in a document line or position

This settings are made through transaction OBBH, or you may navigate the different Application Areas and Events through transaction GGB1. All the created substitutions are visible here, and new substitutions can be created too. By entering a substitution definition you may select what type of substitution you will use: constant value, field assignement or execute a User Exit.

In order to add user code to the substitution, you will need to implement a user exit for it. The name of the User Exit will be Uxxx, being xxx three digits and the U meaning User. In this code you will be able to modify the value like in any ABAP program.

The first step in creating the User Exit is to copy program RGGBS000 into a Z or Y program; for example, YGGBS000. After you've copied the program, you will have to add a form called Uxxx. Then you will need to create an entry in form GRT_EXIT_TITLES for the User Exit to be identified:

Edit YGGBS000 program to identify exit

In our example, we named the form UTST. Then we add the code in the form:

Add form to YGGBS000

Finally, you have to add the include name in table T80D. Use transaction SM30, and add the corresponding include name to the correct application area. Note that if there already exists an entry for your application area, you can not add a new one; instead, you should add you form to the existing include.

Once you've done this, you will be able to use this User Exit in the substitution.

In this document from SDN you will find more information and an implementation example.