---
title: "如何通过Tcode查找Badi或者用户出口 "
author: "e6621887"
date: "2012-03-15T16:04:14Z"
tags: []
categories: ["编程语言"]
slug: "tcode-badi"
draft: false
lastmod: "2012-03-15T16:04:14Z"
id: 1454352
url: "https://e6621887.iteye.com/blog/1454352"
---

在SAP系统中，SAP提供了Badi和用户出口来方便用户对标准程序来进行增强，那么我们可以通过如下方法来找到它们：

获取用户出口：

方法一：用SAP提供的一个程序来执行获取，这个程序不是已经内嵌到系统中，需要下载代码，放到自定义的程序中来执行，

代码下载地址：[http://www.sap-img.com/ab038.htm](http://www.sap-img.com/ab038.htm) 或者:http://saptechnical.com/Tutorials/ExitsBADIs/FindUserExitswithTCode.htm

方法二：Tcode：SMOD,进去后，写星号，按F4，调用搜索帮助，调出所有清单，从清单中搜索得到‘user exit’的项目；

获取BADI（以下从SDN转帖）：

方法一：Goto Transaction SE24-&gt;class name as CL\_EXITHANDLER-&gt;  
Display-&gt;double click on get\_instance mathod-&gt;Now u will go inside the method-&gt;Now put break point on the cl\_exithandler.  
Now enter transaction code .  
U will be stopped on the break point at cl\_exithandler .In the exit name u can find list of badi's attached to the tcode..  
Find the sutable BADI according to your requirement  
方法二： Go to any transaction (say CV02N) and from the menu, select System -&gt;Status to get the program name.  
In the program, search for CL\_EXITHANDLER=&gt;GET\_INSTANCE with the radio button “In Main Program” selected.  
Select one program from the list of programs containing calls to BAdIs.  
The changing parameter INSTANCE will have the interface assigned to it.  
Find out the corresponding BAdI Interface and definition  
For eg: if the inteface name is IF\_EX\_DOCUMENT\_MAIN02 is the interface , the BAdI definition name will be DOCUMENT\_MAIN02.