User Exits demo in FI/CO

 
Basic 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 Enhancements

Company A has a requirement to validate all customer master records created with a U.S. address. The U.S. entity reports on the industry field on the customer master. This is only a U.S. requirement and should not be required for the other countries, so the field status would not work. To accomplish this requirement, Company A will need to set up 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 Steps

 

1.    Tools  ABAP Workbench  Utilities  Enhancements  Definition  Utilities  List Enhancements

2.    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 (see Figure 1). You’ll start there. Searching for an exit can be tricky, so make sure you try several things before giving up.

3.    Execute the search.

 

Figure 1. Start Your Search for a Master Exit Here

 

4.    Look through the list until you find the Enhancement for User exits: Customer Master Data.

5.    Double-click on the enhancement SAPMF02D. This will take you to the details of the Enhancement and list the function modules included in the Enhancement.

6.    To continue, double-click on the function module EXIT_SAPMF02D_001

7.    This will take you to the source code for the function module. Click on theImport tab to review the tables/fields that are available for the Enhancement (seeFigure 2).

 

 

Figure 2. The Tables That Are Available for the Enhancement

 

8.      To view the tables/fields that can be changed in the function module, click on theExport and Changing tabs. For this function module, these tabs are empty because you can only validate data. You cannot change any fields in this 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 theInclude is where your code will be written (see Figure 3).

 

 

Figure 3. Your Program Will Begin After the Include Statement

 

11.   Double-click on the Include. You will be prompted to create the include. Click onYes to create.

12.   At this point you will be prompted to enter a development class and to create a transport request. If you do not know which development class to use, please contact your technical team.

13.  Enter the following ABAP code into the program (Figure 4):

*

* User exit to ensure that all US customers have a group key

* entered on the customer master.

*

if i_kna1-land1 = 'US' and

 i_kna1-brsch = ' '.

 message e001(F2).

endif.

 

 

 

Figure 4. The ABAP Code You Need to Enter

 

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 will create your own message within your own message class. All customer message classes must begin with a "Z" and are 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  ABAP Workbench  Utilities  Enhancements  Project Management.

18.  Enter the project name; begin the name with a "Z."

19.  Click on the Create button.

 

 

Figure 5. Click on Create After You Type in the Project Name

 

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 the same one created when adding the ABAP code to the function module.

24.  Enter the name of the enhancement SAPMF02D (see Figure 6).

 

 

Figure 6. Enter the Name of the Enhancement Here

 

25.  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 group key. Be sure to test one with a group key to make sure the message is not displayed in error as well.

 

 

转自:http://sapbrainsonline.com/ARTICLES/TECHNICAL/USEREXITS/USEREXITS_in_FICO.html

by Tami Becker, SAP Platinum Consultant, SAP America, Inc.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值