You are on page 1of 10

Improving the Fit of the Standard FI/CO System to Your Site's Specific Business Requirements with User Exits,

Enhancements, and Events


by Tami Becker, SAP Platinum Consultant, SAP America

The author describes three ways to make enhancements to features without modifying the standard code. This provides a great deal of added flexibility to the FI/CO modules.

Categories: ABAP, System Tips In almost every R/3 implementation, a company asks repeatedly: "How can we enhance this feature or that feature without making a modification to the standard code?"1 This is especially true in the FI/CO modules. The answer is generally referred to as a "User Exit," a spot in the processing of an end-user transaction where someone on the customization team can insert site-specific processing logic or business rules that then become a permanent part of that transaction. And just to get the vocabulary straight, although project team members often refer to these "customization spots" as "User Exits," that SAP term is actually just one of three that serve a similar purpose. The other two are "SAP Enhancements" and "Business Transaction Events."

Since all three typically offer a great deal of needed flexibility to the FI/CO modules, I wanted to share with you some answers to frequently asked questions about them and at the end of this article is a do-it-yourself exercise for those of you who would like to learn by doing.

Tip! You can also download from the FI/CO Expert Web site (Click here) my more detailed white paper entitled User Exits in FI/CO, that gives tips on how to both find and use each kind.

Frequently Asked Questions ... and Answers!


Where can I find SAP Enhancements, Business Transaction Events, and User Exits? (From here on, I will collectively refer to these more simply as "enhancements.") These three enhancements are found in different areas:

SAP Enhancements are found via transaction code CMOD. If you then follow the menu path Utilities > SAP Enhancements, you will get to the information system for the Enhancements. From there, you can search for specific areas in FI/CO that have an Enhancement available. Typical ways to search include using keywords or ranges on exit names, short texts, and development classes.

User Exits are found in various places in the IMG. The most common are in the Special Ledger (SPL) section of the IMG, including the tree branches for configuring field movements, validations, substitutions, rollups, and variables. The programs are defined in the IMG under SPL configuration, basic settings. The transaction codes are GCX2 and GCX1. Business Transaction Events are also in the IMG. You will find them in the Financial Accounting Global Settings section. To navigate there more quickly, simply use transaction code FIBF. Under the Environment menu option are the information systems for searching for existing Events.

What resources are needed for creating/ developing these options? Normally, a functional team member and an ABAP programmer will work together to create an SAP Enhancement, Exit, or Event. If a functional person is also knowledgeable in ABAP, then this person could potentially do all the development work alone. Will any of these options be overwritten in an upgrade from one release of R/3 to another? No. This is the great thing about enhancements. A newer version of SAP R/3 will not overwrite an enhancement in an upgrade as long as you adhere to the correct naming conventions. However, due to the fact that the newer release might well have changes to the program or to the database tables that the enhancement reads from or writes into, you will need to do extensive testing during the upgrade project to ensure that everything is still working the way you want it to.

Say Hello to the User Exit, the Enhancement, and the Event User Exits are the oldest type of the three and are very limited in functionality. Imagine adding a new field for reporting in the special-purpose ledger that doesnt exist anywhere else in the system, or substituting a profit center into an FI document based on complex logic written in a user exit. The programs are defined in SAP tables T80D for client-dependent programs and T80I for client-independent programs. These User Exits are called from configuration in various places in the system and can be very powerful. SAP Enhancements arrived in release 3.0. These enhancements exist throughout the entire system and are not limited to just FI/CO. They work with function modules that are called from the standard SAP code. Have you ever wondered how you can validate entries in vendor, customer, or GL account master records by checking other master data fields? SAP enhancements can do this very easily and with limited ABAP coding. Enhancements have an information system that helps determine if an enhancement exists for the feature you would like to add. Business Transaction Events were introduced in release 4.0. Each release adds new events in various modules, so this functionality is rapidly increasing. They are similar to SAP Enhancements in that they work with function modules, but these events are configured in the IMG. With events you can enhance features such as bank determination in the payment program or substitution of values in an FI document.

Get Started in Less Than Two Hours with SAP Enhancements


This section walks you through an example of using the SAP Enhancement. The example was created in R/3 release 4.6C. As mentioned before, you can download a complete technical guide, including examples for Business Transaction Events and User Exits, from www.FICOExpertOnline.com/downloads. The examples business requirement is to validate all U.S. master data records for your customers, making sure that the Group Key field is populated before allowing your end users to create and save new Customer Masters. You looked and you looked and you looked, but you could not find any standard-delivered functionality in R/3 to accomplish this kind of validation. So, you will instead see if you can meet this need with an SAP Enhancement. If you know how to write even basic ABAP code, youll be able to follow these examples without any difficulties. If you are not literate in ABAP, you will need to enlist the help of someone who is.

Step 1: To find an Enhancement for the Create a Customer Master transaction, access transaction code CMOD. From there, follow the menu path: Utilities > SAP Enhancements. Enter *master* in the short text field and execute. You are looking for enhancement SAPMF02D User Exits: Customer Master Data. See Figure 1.

Figure 1

Picking the SAPMF02D Enhancement from a Search List Result

Step 2: Select the Enhancement by putting the cursor on SAPMF02D and clicking on the Display icon (eyeglasses). This will display the Function Module (into which you will put your ABAP code) assigned to the Enhancement. See Figure 2.

Figure 2

The Screen Youll See After Choosing the SAPMF02D Enhancement

Step 3: Double-click on the function module text EXIT_SAPMF02D_001. This will take you to the programming section of that function module. The name of a "Z" program will be waiting for you in every SAP Enhancements function module; see Figure 3 for an example. This is only a name, and you will, in fact, have to create it in your system as the next step.

Figure 3

An Example of How a Reference to a "Z" Program (ZXF04U01) Will Be Waiting for You After You Double-Click the Function Module Text in Step 2

Step 4: Create the "Z" program by first double-clicking on the "Z" programs name (ZXF04U01). When R/3 then asks you if you want to create the Include, click on the Yes button. You will then see a pop-up window similar to whats shown in Figure 4. In that window, you must either type in a value for the Development Class field or click on the Local Object button, but not both. You will only need to type in a Development Class code if you want to transport your work at some time to another R/3 system in your landscape. For the purposes of this exercise, you can use the more simple option of saving as a Local Object.

Figure 4

The Pop-Up Window You Will See During Step 4

Step 5: Now you are ready to type in and save your ABAP code. Enter the following ABAP code in the program, similar to what is shown in Figure 5. This code checks to see if the value in the Customer Master field called Country (land1) equals US (the customers location is in the United States), and that the value currently in the field called Group Key (konzs) is blank. If both of those if conditions are true, then the end user gets an error message2 and is prevented from saving.

if i_kna1-land1 = US and i_kna1-konzs = . Message e145(F2). endif.

Figure 5

Type in and Save Your ABAP Code on This Screen

Step 6: Create something called a "Project" and assign your newly created Enhancement to that Project. This step contains several smaller steps listed below:

Once again, call up the transaction CMOD. On that first screen, type in a name for your Project that begins with a "Z," such as ZAPMF02D. Then click once on the Create button. On the next screen, type in a short text description. For this exercise, you can type in "Master Data Enhancements." Click once on the Save icon. At this point you will be prompted for a Development Class again. As you did before, save as a Local Object. You will still be on the same screen with the Short Text description. Click once on the Enhancement Assignments button. Type the value SAPMF02D into the first Enhancement field, similar to what Figure 6 shows. Click once on the Save icon. Use the green back arrow to return to the main CMOD screen. From there, click on the Activate icon in the upper-left portion of the screen underneath the green checkmark; it looks like a firecracker (see

Figure 7). Now, your Enhancement will be called every time the end-user transaction in question is performed.

Figure 6

The Screen You Use to Link a Project to Your Enhancement

Figure 7

The Activate Icon for Transaction Code CMOD

Step 7: Test your new Enhancement. To do this, access the end-user transaction for creating a customer master and try to save a new U.S.-based customer, even though you purposely left the Group Key field blank. The dataentry screen in question is shown in Figure 8. If all goes well, the end-user transactions program will see that you have activated a Project that is linked to the SAPMF02D Enhancement. When that happens, the logic that you put into that Enhancement will be enforced, and you will be stopped from saving your customer master data entry until you populate a value into the Group Key field.

Figure 8

The Customer Master Data Entry Screen with the Group Key Field

Using Enhancements
I wrote this article to help you understand your options for putting business rules in your FI/CO end-user transactions that the standard- delivered functionalities do not offer. Again, for a much more detailed how-to document, please download my white paper "User Exits in FI/CO" from www.FICOExpertOnline.com/downloads. If you have questions or comments, you may contact me by e-mail at tami.becker@sap.com.

Tami Becker has been working with SAP R/3 for about eight years and really enjoys the software and its constant challenges. Her focus has been with reporting, FI, SPL, SAP Enhancements, Euro, DART, Conversions, and now Contract Accounting. Theres never a dull moment with each new release. She hopes you find it as interesting as she does!

Of course, it is sometimes tempting to defeat a limitation in FI/CO functionality by making direct changes to the programs. This is known as a system modification. SAP wont stop you from doing this, but will remind you that programs that you modify will not be supported by the otherwise-friendly SAP team.
2

For this exercise, I have simply pointed the program to an existing SAP error message. I picked one from message class F2 more specifically, message number 145, Customers found with same address. In a real Enhancement, you would want to create a new error message for your end users that more accurately communicates the specific business rule for which they are being stopped.

You might also like