通过Tcode查找Badi或者客户出口
https://wiki.scn.sap.com/wiki/display/ABAP/Code+To+Find+BAdi
Created by Naresh Reddy K, last modified by Smruti Ranjan Mohanty
The following program asks for a transaction code or a program name. If a transaction code is entered, its called program is used as the program name. With the program name, its package is retrieved, and all the Enhancements (Customer Exits) and classic BAdIs of this package are displayed.
It means this program is an help to find some Enhancements (customer exits) and BAdIs in the same package, but maybe they are not related to this transaction or program, and moreover, this transaction or program may call many Enhancements (customer exits) and BAdIs which will not be listed by this program. Instead, prefer Finding a BADI using Buffer trace - Transaction ST05 (Screenshots) or Find a BADI through SPRO.
REPORT z_find_badi NO STANDARD PAGE HEADING. *&---------------------------------------------------------------------*
*& Enter the transaction code or pragram name that you want to search through
*& in order to find which Standard SAP# User Exits exists or BAdis.
*&---------------------------------------------------------------------* *&---------------------------------------------------------------------*
*& Tables
*&---------------------------------------------------------------------* TABLES : tstc, "SAP# Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP# Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
sxs_attrt,"Exit: Definition side: Attributes, Text table
tstct. "Transaction Code Texts *&---------------------------------------------------------------------*
*& Variables
*&---------------------------------------------------------------------* DATA : jtab LIKE tadir OCCURS WITH HEADER LINE.
DATA : field1().
DATA : v_devclass LIKE tadir-devclass.
DATA wa_tadir TYPE tadir. *&---------------------------------------------------------------------*
*& Selection Screen Parameters
*&---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK s01 WITH FRAME TITLE text-.
SELECTION-SCREEN SKIP.
PARAMETERS : p_tcode LIKE tstc-tcode,
p_pgmna LIKE tstc-pgmna.
SELECTION-SCREEN END OF BLOCK s01. *&---------------------------------------------------------------------*
*& Start of main program
*&---------------------------------------------------------------------* START-OF-SELECTION. * Validate Transaction Code
IF NOT p_tcode IS INITIAL.
SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
ELSEIF NOT p_pgmna IS INITIAL.
tstc-pgmna = p_pgmna.
ENDIF. * Find Repository Objects for transaction code
IF sy-subrc EQ .
SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'PROG'
AND obj_name = tstc-pgmna. MOVE : tadir-devclass TO v_devclass. IF sy-subrc NE .
SELECT SINGLE * FROM trdir
WHERE name = tstc-pgmna. IF trdir-subc EQ 'F'.
SELECT SINGLE * FROM tfdir
WHERE pname = tstc-pgmna. SELECT SINGLE * FROM enlfdir
WHERE funcname = tfdir-funcname. SELECT SINGLE * FROM tadir
WHERE pgmid = 'R3TR'
AND object = 'FUGR'
AND obj_name EQ enlfdir-area. MOVE : tadir-devclass TO v_devclass.
ENDIF.
ENDIF. * Find SAP# Modifications
SELECT * FROM tadir INTO TABLE jtab
WHERE pgmid = 'R3TR'
AND object IN ('SMOD', 'SXSD')
AND devclass = v_devclass. SELECT SINGLE * FROM tstct
WHERE sprsl EQ sy-langu
AND tcode EQ p_tcode. FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE:/() 'Transaction Code - ',
() p_tcode,
() tstct-ttext.
SKIP.
IF NOT jtab[] IS INITIAL.
WRITE:/() sy-uline.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
* Sorting the internal Table
SORT jtab BY object.
DATA : wf_txt() TYPE c,
wf_smod TYPE i ,
wf_badi TYPE i ,
wf_object2() TYPE c.
CLEAR : wf_smod, wf_badi , wf_object2.
* Get the total SMOD.
LOOP AT jtab INTO wa_tadir.
AT FIRST.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE:/ sy-vline,
'Enhancement/ Business Add-in',
sy-vline ,
'Description',
sy-vline.
WRITE:/() sy-uline.
ENDAT. CLEAR wf_txt. AT NEW object.
IF wa_tadir-object = 'SMOD'.
wf_object2 = 'Enhancement' .
ELSEIF wa_tadir-object = 'SXSD'.
wf_object2 = ' Business Add-in'.
ENDIF.
FORMAT COLOR COL_GROUP INTENSIFIED ON.
WRITE:/ sy-vline,
wf_object2,
sy-vline.
ENDAT. CASE wa_tadir-object.
WHEN 'SMOD'.
wf_smod = wf_smod + .
SELECT SINGLE modtext INTO wf_txt
FROM modsapt
WHERE sprsl = sy-langu
AND name = wa_tadir-obj_name. FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
WHEN 'SXSD'.
* For BADis
wf_badi = wf_badi + .
SELECT SINGLE text INTO wf_txt
FROM sxs_attrt
WHERE sprsl = sy-langu
AND exit_name = wa_tadir-obj_name. FORMAT COLOR COL_NORMAL INTENSIFIED ON.
ENDCASE.
WRITE:/ sy-vline,
wa_tadir-obj_name HOTSPOT ON,
sy-vline ,
wf_txt,
sy-vline. AT END OF object.
WRITE : /() sy-uline.
ENDAT.
ENDLOOP.
WRITE:/() sy-uline.
SKIP.
FORMAT COLOR COL_TOTAL INTENSIFIED ON.
WRITE:/ 'No.of Exits:' , wf_smod.
WRITE:/ 'No.of BADis:' , wf_badi.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/() 'No userexits or BADis exist'.
ENDIF.
ELSE.
FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
WRITE:/() 'Transaction does not exist'.
ENDIF. * Take the user to SMOD or SXSD for the Exit or BAdi that was selected.
AT LINE-SELECTION.
DATA : wf_object TYPE tadir-object.
CLEAR wf_object.
GET CURSOR FIELD field1.
CHECK field1() EQ 'WA_TADIR'.
READ TABLE jtab WITH KEY obj_name = sy-lisel+().
MOVE jtab-object TO wf_object.
CASE wf_object.
WHEN 'SMOD'.
SET PARAMETER ID 'MON' FIELD sy-lisel+().
CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.
WHEN 'SXSD'.
SET PARAMETER ID 'EXN' FIELD sy-lisel+().
CALL TRANSACTION 'SE18' AND SKIP FIRST SCREEN.
ENDCASE. *Text elements
*----------------------------------------------------------
* 001 Enter the Transaction Code or Program name that you want to search *Selection texts
*----------------------------------------------------------
* P_PGMNA Program name to Search
* P_TCODE Transaction Code to Search
通过Tcode查找Badi或者客户出口的更多相关文章
- 如何从SAP中查找BADI
如何从SAP中查找BADI 如何从SAP中查找BADI http://blog.csdn.net/CompassButton/article/details/1231652 BADI作为SAP的第 ...
- 查找SAP标准程序用户出口及BADI的方法
查找SAP标准事务代码中使用的BADI: 在SE24中,查看类对象CL_EXITHANDLER,在其方法(Methods)GET_INSTANCE 的第14行打断点,之后运行事务代码: 当有BADI将 ...
- 通过TCODE查找SPRO路径
1.SE11:CUS_ACTOBJ,根据OBJECTNAME(对象名称),即视图名称,获取Customizing activity(ACT_ID) 2.根据ACT_ID在表CUS_IMGACT获取说明 ...
- SAP 增强篇 Method1 BADI增强的查找方法
查找BADI的方法:(1)通过SE24,输入CL_EXITHANDLER,然后在方法GET_INSTANCE中设置断点,然后运行事务代码判断 exit_name的值,操作过程如下:输入se24,然后输 ...
- SAP 增强-出口选找方法-全部
■ SAP 中如何寻找增强 方法一:利用TCODE寻找增强(第二代的增强) 执行一个程序(源代码后附),在选择屏幕处输入你所需要增强的程序TCODE,执行後,就会出现一个列表,那里就有关于如何增强这个 ...
- SAP ABAP第一,两,三代出口型BADI实现 解释的概念
BADI这是第三代用户出口型.让我们来看看如何实现的细节. 一个,用户出口的类型 1,第一代 sap提供了一个空的子程序代码.在这个过程分,用户可以添加自己的代码.为了控制自己的需求.这样的改进是需要 ...
- 20160410javaweb 开发小案例 --客户管理系统
客户管理系统---体验基于数据库javaweb的增删改查 添加客户 查询客户列表 修改客户信息 删除客户 条件查询客户信息 分页查询客户 javaee的经典三层架构--工厂类实现解耦 jsp+serv ...
- SAP 图标查找及方法
1. 图标查找 方法一:通过TCODE查找图标对应的图标名称 执行TCODE:ICON 查找图标对应的图标名称 方法二:通过方法一查出图标名称查找对应的图标ID SE11类型池根据方法一查找的ICON ...
- SAP 供应商/客户的冻结及其删除操作
SAP 供应商/客户的冻结及其删除操作 在SAP中,有所谓的财务供应商(Tcode:FK01)和后勤供应商(Tcode:XK01),供应商和客户主数据包括一般数据/公司代码数据/采购组织|销售范围三方 ...
随机推荐
- 1101 Quick Sort(25 分
There is a classical process named partition in the famous quick sort algorithm. In this process we ...
- HDU 5792 L - World is Exploding 。容斥原理 + 树状数组 + 离散化
题目,要求找出有多少对这样的东西,四个数,并且满足num[a]<num[b] &&num[c]>num[d] 要做这题,首先要懂得用树状数组,我设,下面的小于和大于都是严格 ...
- 【Java密码学】用Java数字签名提供XML安全
简介 众所周知,XML在产品和项目开发中起着非常重要的作用.通过XML文档可以获取很多信息,还可以使用XML文件进行CRUD(增加.查询.更新和删除)操作.然而值得注意的是,我们如何确保XML中的数据 ...
- Zookeeper崩溃恢复过程(Leader选举)
1. 崩溃恢复 a). leader选择过程可以保证新leader是ZXID最大的节点 b). ZAB协议确保丢弃那些只在leader上被提出的事务,场景 leader发出PROPOSAL收到ACK, ...
- 6 - 编码解码器-一种channelHandler
6.1 解码器 6.1.1 抽象类-ByteToMessageDecoder decode(ChannelHandlerContext ctx, ByteBuf in, List<Object& ...
- java-类的定义和用法
1.类的定义 public class Human{ }//每个源文件必须也只能有一个public类 class boy{ }//可以定义多个class类 class girl{ } 上面的类定义好后 ...
- Apache Spark 2.2.0 中文文档 - GraphX Programming Guide | ApacheCN
GraphX Programming Guide 概述 入门 属性 Graph 示例属性 Graph Graph 运算符 运算符的汇总表 Property 运算符 Structural 运算符 Joi ...
- Java 日期时间格式化
在此记录Java日期时间格式化转换符,方便以后有需要时查找. 1.日期格式化 2.时间格式化 3.格式化常见的日期时间组合
- python 学习之FAQ:find 与 find_all 使用
FAQ记录 1. 错误源码 错误源码如下 def fillUnivList(_html,_ulist): soup =BeautifulSoup(_html,'html.parser') fo ...
- shrio中去掉 login;JSESSIONID
shrio中去掉 login;JSESSIONID 在session管理器配置页面中新增一条记录