首页 > SAP > ABAP > How to find User Exits in SAP ABAP
2019
08-29

How to find User Exits in SAP ABAP

After knowing about user exits in sap abap, its time to find one and implement it. As you know user exits mostly exits in Sales and distribution module.Lets take a sample scenario and try to implement user exist.

Scenario
While creating a sale-ale settingss order in VA01-创建销售订单, you need to through a error message if the quantity of order is      > 100.00. To find the user exits available while creating VA01-创建销售订单.

Approach-1

1. Enter VA01-创建销售订单 in command bar to go to transaction and then click on System → Status.

How to find User Exits in SAP ABAP - 第1张  | 优通SAP

2. Pick the program name in the below popup.

How to find User Exits in SAP ABAP - 第2张  | 优通SAP

3. Display the same program in SE38-ABAP编辑器.In our case the program is SAPMV45A and click on search button.

How to find User Exits in SAP ABAP - 第3张  | 优通SAP

4. Enter the search string “USEREXIT_ ” in the below popup and click in OK.

How to find User Exits in SAP ABAP - 第4张  | 优通SAP

5. you will get the screen like below with search results. From them choose the correct one to write the code.You can choose the correct use exits by reading the documentation available in every subroutine.In our case i have chosen user exit USEREXIT_SALVE_DOCUMENT_PREPARE in the include MV45AFZZ.

[adsenseyu1]

Approach-2

1. Go to SE80-Object Navigator, select Package and put VMOD and press enter. All the includes under this package contains many user exits and choose the correct one to fit your requirement.

How to find User Exits in SAP ABAP - 第5张  | 优通SAP
User Exit in SAP

You can choose any the above approaches to find the user exit. You can find the full documentation of each and every user exit here.

Implementation

Go to the include MV45AFZZ in SE38-ABAP编辑器 and then the subroutine USEREXIT_SAVE_DOCUMENT_PREPARE to write the below code.

最后编辑:
作者:yangsen
有需要可在文章留言或者邮件yan252@163.com给我。