Published on

This document relates to SAP User Exit in Financials & Controlling which includes Overview, Configuration SAP Enhancements,Configuring Business Transaction Events along with example version 4.6C, Configuring User Exits (Older)

Published in: Technology
1 Comment
  • yes this good, but some areas not able to find path
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. SAP USER EXIT FICO Document on User Exit for Financials & Controlling Prepared By: Ms.Pramila Nagaraj First Class MBA Finance Graduate (2009-10) Global Academy of Technology, Bangalore (VTU- Belgaum)Trained up in SAP FICO @ SAPPHIRE Consulting Services and @ SAPTAC Bangalore (FRESHER) Copy Rights © 2012-2013 SAPTAC BANGALORE
  2. 2. SAP USER EXIT FI /COOverviewR/3 provides three “customization spots” that allow you to enhance FI/CO features without modifying the standardcode. Although often collectively referred to as “user exits,” two of the three have different names. SAPEnhancements are used to expand the standard functionality within SAP. Enhancements use function modules andare called from the standard SAP code. Each module in the system has a set of delivered enhancements that helpcompanies expand the standard functionality where they need it. Enhancements were new in release 3.0. The OpenFI Interfaces or Business Transaction Events are also used to expand the standard functionality within SAP. Theseevents are defined in the IMG. Business Transaction Events were new in release 4.0. They are not available for allmodules and are not called on all integrated transactions into FI as of release 4.5B. This will change with eachrelease and should be retested. The older User Exits in FI/CO are “Z” programs that are defined in table T80D forclient-dependent user exits, and in table T80I for client-independent user exits. These are also used to expand thestandard functionality within the FI/CO modules. These User Exits have been available since the early releases ofSAP. All of these FI/CO User Exits are listed in this document in the Configuring User Exits (Older). The list isincluded because these User Exits are not a part of the Enhancements or Business Transaction Events and do nothave an Info System for searching.Benefits- Standard SAP functionality can be enhanced without modification to the standard code.- Upgrades do not erase the functionality and it does not have to be re-transported or re-entered into the system.The enhancements should be thoroughly tested when upgrading to ensure the system will still work as implemented.Configuring SAP EnhancementsBasic Steps in Configuring an Enhancement- Find the appropriate Enhancement.- Enter the ABAP code in the “Z” program within the function module.- Create a project.- Add the Enhancement to the project.- Activate the project.Example Business Scenario for EnhancementsCompany A has a requirement to validate all customer master records created with a U.S. address. The U.S. entityreports on the industry field on the customer master. This is only a U.S. requirement and should not be required forthe other countries, so the field status would not work. To accomplish this requirement, Company A will need to setup an Enhancement for the customer master transaction. The necessary steps are detailed below with screenprints.This example was configured in a 4.6C system.Detailed Steps1. Tools ABAP Workbench Utilities Enhancements Definition Utilities List Enhancements2. Do not execute this without any parameters! There are too many Enhancements and it will probably time out.You’re searching for a customer master exit. Enter *mast* in the short text. You’ll start there. Searching for an exitcan be tricky, so make sure you try several things before giving up.3. Execute the search.4. Look through the list until you find the Enhancement for User exits: Customer Master Data. Copy Rights © 2012-2013 SAPTAC Bangalore
  3. 3. 5. Double-click on the enhancement SAPMF02D. This will take you to the details of the Enhancement and list thefunction modules included in the Enhancement.6. To continue, double-click on the function module EXIT_SAPMF02D_0017. This will take you to the source code for the function module. Click on the Import tab to review the tables/fieldsthat are available for the Enhancement8. To view the tables/fields that can be changed in the function module, click on the Export and Changing tabs.For this function module, these tabs are empty because you can only validate data. You cannot change any fields inthis enhancement.9. Return to the Source Code tab.10. Scroll down until you see the Include statement in the program. The “Z” program listed after the Include iswhere your code will be written11. Double-click on the Include. You will be prompted to create the include. Click on Yes to create.12. At this point you will be prompted to enter a development class and to create a transport request. If you do notknow which development class to use, please contact your technical team.13. Enter the following ABAP code into the program** User exit to ensure that all US customers have a group key* entered on the customer master.*if i_kna1-land1 = ‘US’ andi_kna1-brsch = ‘ ‘.message e001(F2).endif.14. Note that the table name matches the table name in the import tab tables.15. In this example you are using the standard message class F2 with message number 001. Normally, you willcreate your own message within your own message class. All customer message classes must begin with a “Z” andare created in transaction SE91.16. Save the program.17. The next step is to create the project. Go to transaction code CMOD or follow menu path: Tools ABAPWorkbench Utilities Enhancements Project Management.18. Enter the project name; begin the name with a “Z.”19. Click on the Create button.20. Enter in a description for the project.21. Click on the Enhancement Assignments button.22. You will be prompted to save the enhancement. Click on Yes.23. At this point you will be asked for a development class and to create a transport for the project. You may use thesame one created when adding the ABAP code to the function module.24. Enter the name of the enhancement SAPMF02D25. Save the project.26. Back out of the enhancement assignment.27. Activate the project by hitting the Activate button.The SAP Enhancement is ready to be tested! Try creating a customer with U.S. as the country and a blank groupkey. Be sure to test one with a group key to make sure the message is not displayed in error as well. Copy Rights © 2012-2013 SAPTAC Bangalore
  4. 4. Configuring Business Transaction EventsBasic Steps in Configuring an Event- Make sure the application is active for Business Transaction Events.- Copy the sample interface function module into a “Z” function module.- Enter the ABAP code into the source code section of the new “Z” function module. You may choose to create a“Z” program to enter the code into and then insert the “Z” program into your function module source code.- Activate the function module.- Assign the function module to the event, country and application.Example Business Scenario for Business Transaction EventsCompany A would like to copy the group key field from the vendor master into the allocation field on all the line itemswithin a vendor invoice and payments, including the vendor lines. This requirement assumes only one vendor isposted to in a document. To accomplish this requirement, Company A will use the Business Transaction Event 1130,Post Document: SAP Internal Field Substitution. 1. IMG Menu Path: Financial Accounting Financial AccountingGlobal Settings Use Business Transaction Events Environment Infosystem (Processes).2. Find the correct Business Event. You are updating a field, so you select the Processes Info System instead ofthe Publish and Subscribe Info System.3. Execute the search with the defaults.4. Find the correct interface for updating a document: Post Document: SAP- Internal Field Substitution5. Put your cursor on the event and click on the Sample Function Module button.6. You are now in transaction SE37 – Function Builder. This is the function module (sample_process_00001130)you will need to copy into a “Z” name function module for your coding. This Is the Function Module You Need to CopyYour “Z” Name Function Module7. Click on the Copy button.8. Enter the “Z” function module name in the To Function Module field9. Enter a Function Group. If you need to create a “Z” function group, go to transaction code SE37 and followmenu path: Go to Function Groups Create Group. A function group is a logical grouping of function modules, andthe ABAP code is generated for function groups. You will be prompted for a development class and transport whencreating the function group.10. In Function Builder (transaction SE37), enter the new “Z” function module. Click on the Change button.11. The system will default into the source code screen where you may enter your ABAP code.12. Notice the tables available for the code. Additional tables may be declared if necessary.13. Enter the following source codetables: z_groupkey like lfa1-konzs.z_groupkey = ‘ ‘.loop at t_bseg.* check for vendor lines. If one is found, read the vendor master and* retrieve the group key field.if t_bseg-koart eq ‘K’.select single konzs from lfa1 into z_groupkey where lifnr = t_bseg-lifnr.endif.* Move the group key field into all line items allocation field. Copy Rights © 2012-2013 SAPTAC Bangalore
  5. 5. loop at t_bsegsub.t_bsegsub-zuonr = z_groupkey.modify t_bsegsub index sy-tabix.endloop. “t_bsegsubendloop. “t_bseg14. Save the function module.15. Back out to the main Function Builder screen by clicking on the green arrow button.16. Activate the function module by clicking on the Activate button17. Assign the function module to the event in the IMG: Financial Accounting Financial Accounting GlobalSettings Business Transaction Events Settings Process Function Modules of an SAP Appl.18. Hit enter past the warning messages that this is SAP data.19. Click on the New Entries button.20. Enter the process for your interface. In your example it is 00001130.21. Enter the country the interface is valid for. If it is valid for all countries, leave this field blank.22. Enter the application the interface should be called for. If it should be called for all applications, leave this fieldblank. Please note that not all integrated transactions are programmed to go through these interfaces! You will needto test to find out!23. Enter the new “Z” function module24. Save the settings. At this point you will be prompted for a CTS number for the configuration change.25. The Business Transaction Event is complete! You are ready for testing.Configuring User Exits (Older)Basic Steps in Configuring an User Exit- Create a “Z” program for the User Exits and enter the necessary ABAP code.- Enter the new program name into table T80D.- Configure the application to call the User Exit.List of User Exits- Variable Field Movements- Substitutions in FI,CO, PCA- Validations in FI,CO, PCA- Rollups in SPL- Fixed Field Movements in SPL- CostCenter Summarization on Detail Screen- Sets Formula VariablesExample Business Scenario for User ExitsCompany A would like to add a “Z” field in the Special Purpose Ledger to capture a Business Unit field for reporting.They have used all the standard SAP fields such as Business Area and ProfitCenter. The field will only be used forreporting and is only needed in the Special Purpose Ledger. You created a special ledger table (ZZSPL1) withfield Z_BUNIT and need to populate this field based on a combination of G/L account, fund and functional area. Toaccomplish this requirement, Company A will use the Variable Field Movement User Exit. To make maintenanceeasier, table ZZBUSUNIT was created with the G/L account, fund and functional area fields as key fields, and thebusiness unit field as a non-key field. You generated the table maintenance so the table could be updated usingtransaction SM30. SAP users update the business unit determination rules in table ZZBUSUNIT by entering the G/L Copy Rights © 2012-2013 SAPTAC Bangalore
  6. 6. account, fund and functional area, and then the business unit that combination should be posting to. The User Exitwill read table ZZBUSUNIT using the G/L account, fund and functional area from the posting transaction anddetermine the business unit. The steps for using the user exit are detailed below. This example was created on a4.6C system. 1. Copy the delivered template User Exit program RGIVU000_TEMPLATE into a “Z” program.Follow menu path Tools ABAP Workbench Development ABAP Editor (transaction code SE38). In early releases,the delivered program was RGIVU000.2. You will be prompted for a development class and a transport. Please check with the technical team for thecorrect development class.3. At the initial ABAP Editor screen, enter your new “Z” program name, select the Source Code button and clickon Change4. Enter the following code in the User Exit :FORM E01_MVC USING FROM_FIELD TO_FIELD.to_field = CORP. "Set a defaultbusiness unit.* read table zzbusunit to determine the business unit single z_bunit from zzbusunit into to_fieldwhere hkont = accit_glx-hkont and geber = accit_glx-geber andfkber = accit_glx-fkber.ENDFORM.5. Activate the program by clicking on the Activate button.6. Change the configuration in the User Exit table to point to your new “Z” program.7. Follow the IMG menu path: Financial Accounting Special Purpose Ledger Basic Settings User ExitsMaintain Client Specific User Exits.8. The entry to maintain is application area GIMV: Variable Field Movement. Enter your “Z” program9. Save the changes.10. The final configuration step is to assign the User Exit in the variable field movement for your special ledger table.In the IMG: Financial Accounting à Special Purpose Ledger à Basic Settings à Master Data à Maintain FieldMovements. Field movements control how the fields in a special ledger table are populated. They can be populatedstraight from other fields in a posting or through User Exits. After You Assign the Business Unit Field and the G/LAccount, the Exit Field Should Contain U01.11. Assign the business unit field as a receiver and the G/L account as the sender. The Exit field should contain U0112. The User Exit number U01 calls User Exit E01_MVC form in the “Z” program.13. Save the field movement.14. You are ready to test your User Exit! Copy Rights © 2012-2013 SAPTAC Bangalore