通过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),供应商和客户主数据包括一般数据/公司代码数据/采购组织|销售范围三方 ...
随机推荐
- 匿名内部类(new类时覆盖类中方法)
public class Person { private String name ; protected String getName() { return name; } public void ...
- Linux如何用查看域名解析
方法/步骤 查看本地dns配置.确保能上网,dns配置正确.可以查看网卡配置文件和dns配置文件,网卡里配置优先. ping命令.第一行会返回域名及解析的ip. host命令.会返回域 ...
- JavaScript事件模型及事件代理
事件模型 JavaScript事件使得网页具备互动和交互性,我们应该对其深入了解以便开发工作,在各式各样的浏览器中,JavaScript事件模型主要分为3种:原始事件模型.DOM2事件模型.IE事件模 ...
- php面试题分享
1.nginx使用哪种网络协议? nginx是应用层 我觉得从下往上的话 传输层用的是tcp/ip 应用层用的是http fastcgi负责调度进程 2. <? echo 'hello tush ...
- vue resource patch方法的传递数据 form data 为 [object Object]
今天在测试 iblog 登录时,传送过去的数据总是 [object Object],以至于后台识别不出来. vue 使用了 vueResource 组件,登录方法为 patch. 经过探索,终于在官网 ...
- 在spark2中的shell使用python3
在spark2中的shell使用python3 spark2.0.0中的python默认使用python2,可以通过以下两种方式之一使用python3: PYSPARK_PYTHON=python3 ...
- JavaScript初识(二)
接上一篇: 九丶伪数组 arguments arguments代表的是实参.有个讲究的地方是:arguments只在函数中使用 (1)返回函数实参的个数:arguments.length fn(2,4 ...
- 【来龙去脉系列】RSA算法原理
如果你问我,哪一种算法最重要? 我可能会回答"公钥加密算法". 因为它是计算机通信安全的基石,保证了加密数据不会被破解.你可以想象一下,信用卡交易被破解的后果. 进入正题之前,我先 ...
- 【作业留存】根据IATF框架,设计的一种中小型企业安全拓扑
- I-129表
http://www.uscis.gov/i-129 移民局使用的非移民性质的工作身份申请表(I-129)表格将于下月底正式作废,4月30日之后,公民和移民服务局只接受新的I-129表格. 据了解,非 ...