Improving the Fit of the Standard FI With User Exits, Enhancements, Events

  • Upload
    mnryan

  • View
    245

  • Download
    1

Embed Size (px)

Citation preview

  • 8/3/2019 Improving the Fit of the Standard FI With User Exits, Enhancements, Events

    1/10

    Improving the Fit of the Standard FI/CO System to Your Site'sSpecific 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. Thisprovides 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 featurewithout 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 wheresomeone on the customization team can insert site-specific processing logic or business rules that then become apermanent part of that transaction. And just to get the vocabulary straight, although project team members oftenrefer 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 learnby doing.

    Tip!You can also download from the FI/CO Expert Web site (Click here) my more detailed whitepaper 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 cansearch for specific areas in FI/CO that have an Enhancement available. Typical ways to search includeusing keywords or ranges on exit names, short texts, and development classes.

    http://www.financialsexpertonline.com/tag.cfm?session=3a1f2555-bea2-4f02-967c-7d6672ec79ae&tag=abaphttp://www.financialsexpertonline.com/tag.cfm?session=3a1f2555-bea2-4f02-967c-7d6672ec79ae&tag=abaphttp://www.financialsexpertonline.com/tag.cfm?session=3a1f2555-bea2-4f02-967c-7d6672ec79ae&tag=system%20tipshttp://www.financialsexpertonline.com/tag.cfm?session=3a1f2555-bea2-4f02-967c-7d6672ec79ae&tag=system%20tipshttp://www.sapfinancialsexpert.com/downloads.cfm%3Ccfoutput%3E#ws_url_parameters%23%3C/cfoutput%3Ehttp://www.financialsexpertonline.com/article_printable.cfm?session=3a1f2555-bea2-4f02-967c-7d6672ec79ae&id=2172http://www.financialsexpertonline.com/tag.cfm?session=3a1f2555-bea2-4f02-967c-7d6672ec79ae&tag=system%20tipshttp://www.sapfinancialsexpert.com/downloads.cfm%3Ccfoutput%3E#ws_url_parameters%23%3C/cfoutput%3Ehttp://www.financialsexpertonline.com/tag.cfm?session=3a1f2555-bea2-4f02-967c-7d6672ec79ae&tag=abap
  • 8/3/2019 Improving the Fit of the Standard FI With User Exits, Enhancements, Events

    2/10

    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. Thetransaction codes are GCX2 and GCX1.

    Business Transaction Events are also in the IMG. You will find them in the Financial Accounting GlobalSettings 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 thedevelopment 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 inan upgrade as long as you adhere to the correct naming conventions. However, due to the fact that the newerrelease 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 workingthe 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 forreporting in the special-purpose ledger that doesnt exist anywhere else in the system, or substituting a profit centerinto an FI document based on complex logic written in a user exit. The programs are defined in SAP tables T80D forclient-dependent programs and T80I for client-independent programs. These User Exits are called fromconfiguration 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 notlimited to just FI/CO. They work with function modules that are called from the standard SAP code. Have you everwondered how you can validate entries in vendor, customer, or GL account master records by checking othermaster data fields? SAP enhancements can do this very easily and with limited ABAP coding. Enhancements havean 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, sothis functionality is rapidly increasing. They are similar to SAP Enhancements in that they work with functionmodules, but these events are configured in the IMG. With events you can enhance features such as bankdetermination 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/3release 4.6C. As mentioned before, you can download a complete technical guide, including examples forBusiness Transaction Events and User Exits, fromwww.FICOExpertOnline.com/downloads.

    The examples business requirement is to validate all U.S. master data records for your customers, making surethat 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 toaccomplish 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. Ifyou are not literate in ABAP, you will need to enlist the help of someone who is.

    http://www.ficoexpertonline.com/downloadshttp://www.ficoexpertonline.com/downloadshttp://www.ficoexpertonline.com/downloads
  • 8/3/2019 Improving the Fit of the Standard FI With User Exits, Enhancements, Events

    3/10

    Step 1: To find an Enhancement for the Create a Customer Mastertransaction, access transaction codeCMOD. From there, follow the menu path: Utilities > SAP Enhancements. Enter*master* in the short text fieldand 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 theEnhancement. See Figure 2.

  • 8/3/2019 Improving the Fit of the Standard FI With User Exits, Enhancements, Events

    4/10

    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 programmingsection of that function module. The name of a "Z" program will be waiting for you in every SAP Enhancementsfunction module; see Figure 3 for an example. This is only a name, and you will, in fact, have to create it in yoursystem as the next step.

  • 8/3/2019 Improving the Fit of the Standard FI With User Exits, Enhancements, Events

    5/10

    Figure 3An Example of How a Reference to a "Z" Program (ZXF04U01) Will Be Waiting forYou 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 thenasks you if you want to create the Include, click on theYes button. You will then see a pop-up window similar towhats shown in Figure 4. In that window, you must either type in a value for the Development Class field or clickon the Local Object button, but not both. You will only need to type in a Development Class code if you want totransport your work at some time to another R/3 system in your landscape. For the purposes of this exercise, youcan use the more simple option of saving as a Local Object.

  • 8/3/2019 Improving the Fit of the Standard FI With User Exits, Enhancements, Events

    6/10

    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 Masterfield 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 errormessage2 and is prevented from saving.

    if i_kna1-land1 = US and

    i_kna1-konzs = .Message e145(F2).

    endif.

  • 8/3/2019 Improving the Fit of the Standard FI With User Exits, Enhancements, Events

    7/10

    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. Thisstep contains several smaller steps listed below:

    Once again, call up the transaction CMOD. On that first screen, type in a name for your Project thatbegins 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 DataEnhancements."

    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 LocalObject.

    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

  • 8/3/2019 Improving the Fit of the Standard FI With User Exits, Enhancements, Events

    8/10

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

    Figure 6 The Screen You Use to Link a Project to Your Enhancement

  • 8/3/2019 Improving the Fit of the Standard FI With User Exits, Enhancements, Events

    9/10

    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 masterand try to save a new U.S.-based customer, even though you purposely left the Group Key field blank. The data-entry screen in question is shown in Figure 8. If all goes well, the end-user transactions program will see that youhave activated a Project that is linked to the SAPMF02D Enhancement. When that happens, the logic that you putinto that Enhancement will be enforced, and you will be stopped from saving your customer master data entry untilyou populate a value into the Group Key field.

  • 8/3/2019 Improving the Fit of the Standard FI With User Exits, Enhancements, Events

    10/10

    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-usertransactions that the standard- delivered functionalities do not offer. Again, for a much more detailed how-todocument, 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 [email protected].

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

    1 Of course, it is sometimes tempting to defeat a limitation in FI/CO functionality by making direct changes to theprograms. This is known as a system modification. SAP wont stop you from doing this, but will remind you thatprograms 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 frommessage class F2 more specifically, message number 145, Customers found with same address. In a realEnhancement, 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.

    http://www.ficoexpertonline.com/downloadshttp://www.ficoexpertonline.com/downloadsmailto:[email protected]:[email protected]://www.ficoexpertonline.com/downloadsmailto:[email protected]