*&---------------------------------------------------------------------*
*& Report Z_FIND_EXIT_AND_BADI
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
report z_find_exit_and_badi no standard page heading.
*&---------------------------------------------------------------------*
*& Enter the transaction code that you want to search through in order
*& to find which Standard SAP User Exits and BADIs
*&
*&---------------------------------------------------------------------*
*& For field 'SUBC' of table 'TRDIR':
*& M Module Pool
*& F Function group
*& S Subroutine Pool
*& J Interface pool
*& K Class pool
*& T Type Pool
*& X XSLT Program
*&---------------------------------------------------------------------*
*& Tables
*&---------------------------------------------------------------------*
tables: tstc , " SAP Transaction Codes
tadir , " Directory of Repository Objects
modsapt , " SAP Enhancements - Short Texts
sxs_attrt, " SAP BADI - short text
modact , " Modifications
trdir , " System table TRDIR
tfdir , " Function Module
enlfdir , " Additional Attributes for Function Modules
tstct . " Transaction Code Texts *&---------------------------------------------------------------------*
*& Variables
*&---------------------------------------------------------------------*
data: jtab like tadir occurs with header line.
data: field1().
data: v_devclass like tadir-devclass.
data: object like tadir-object.
data: bdcdata_wa type bdcdata,
bdcdata_tab type table of bdcdata.
data: opt type ctu_params. *&---------------------------------------------------------------------*
*& Selection Screen Parameters
*&---------------------------------------------------------------------*
selection-screen begin of block a01 with frame title text-.
selection-screen skip.
parameters: p_tcode like tstc-tcode obligatory.
selection-screen skip.
parameters: exit radiobutton group default 'X',
badi radiobutton group .
selection-screen end of block a01. define bdc_program.
clear bdcdata_wa.
bdcdata_wa-program = &.
bdcdata_wa-dynpro = &.
bdcdata_wa-dynbegin = &.
append bdcdata_wa to bdcdata_tab.
end-of-definition.
define bdc_detail.
clear bdcdata_wa.
bdcdata_wa-fnam = &.
bdcdata_wa-fval = &.
append bdcdata_wa to bdcdata_tab.
end-of-definition. *&---------------------------------------------------------------------*
*& Start of main program
*&---------------------------------------------------------------------*
start-of-selection.
if exit = 'X'.
object = 'SMOD'. " User-exit!
else.
object = 'SXSD'. " BADI!
endif. * Validate Transaction Code:
select single * from tstc where tcode eq p_tcode.
* Find Repository Objects for transaction code:
if sy-subrc eq . " IF 1
select single * from tadir where pgmid = 'R3TR'
and object = 'PROG'
and obj_name = tstc-pgmna."Program
* name!
move: tadir-devclass to v_devclass. " Package
if sy-subrc ne .
select single * from trdir where name = tstc-pgmna.
if trdir-subc eq 'F'. " Function Group
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 = enlfdir-area.
move: tadir-devclass to v_devclass.
endif.
endif. * Find SAP Modifactions:
select * from tadir into table jtab where pgmid = 'R3TR'
* AND object = 'SMOD'
and object = object
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. " IF 2
write: /() sy-uline.
format color col_heading intensified on.
* Exit:
if exit = 'X'.
write: / sy-vline,
'Exit Name',
sy-vline ,
'Description',
sy-vline.
* BADI:
else.
write: / sy-vline,
'BADI Name',
sy-vline ,
'Description',
sy-vline.
endif.
write:/() sy-uline.
loop at jtab.
* EXIT:
if exit = 'X'.
select single * from modsapt where sprsl = sy-langu
and name = jtab-obj_name.
format color col_normal intensified off.
write: / sy-vline,
jtab-obj_name hotspot on,
sy-vline ,
modsapt-modtext,
sy-vline.
* BADI:
else.
select single * from sxs_attrt where sprsl = sy-langu
and exit_name =
jtab-obj_name.
format color col_normal intensified off.
write: / sy-vline,
jtab-obj_name hotspot on,
sy-vline ,
sxs_attrt-text,
sy-vline.
endif.
endloop.
write: /() sy-uline.
describe table jtab.
skip.
format color col_total intensified on.
if exit = 'X'.
write: / 'No of Exits:', sy-tfill.
else.
write: / 'No of BADIs:', sy-tfill.
endif.
else. " IF 2
format color col_negative intensified on.
write: /() 'No User Exit exists'.
endif. " IF 2
else. " IF 1
format color col_negative intensified on.
write: /() 'Transaction Code Does Not Exist'.
endif. " IF 1 * Take the user to SMOD for the Exit that was selected:
at line-selection.
get cursor field field1.
check field1() eq 'JTAB'.
* For exit:
if exit = 'X'.
set parameter id 'MON' field sy-lisel+().
call transaction 'SMOD' and skip first screen.
* For BADI:
else.
clear: bdcdata_wa, bdcdata_tab[].
bdc_program 'SAPLSEXO' '' 'X'.
bdc_detail 'BDC_CURSOR' 'G_IS_BADI'.
bdc_detail 'BDC_OKCODE' '=ISSPOT'.
bdc_detail 'G_IS_BADI' 'X'.
bdc_program 'SAPLSEXO' '' 'X'.
bdc_detail 'BDC_CURSOR' 'G_BADINAME'.
bdc_detail 'BDC_OKCODE' '=SHOW'.
bdc_detail 'G_BADINAME' sy-lisel+().
opt-dismode = 'E'.
opt-defsize = 'X'.
call transaction 'SE18' using bdcdata_tab options from opt.
endif.

查找增强出口和BADI程序的更多相关文章

  1. 【ABAP系列】SAP ABAP模块-查找系统出口或BADI的方法

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP模块-查找系统出 ...

  2. 查找SAP标准程序用户出口及BADI的方法

    查找SAP标准事务代码中使用的BADI: 在SE24中,查看类对象CL_EXITHANDLER,在其方法(Methods)GET_INSTANCE 的第14行打断点,之后运行事务代码: 当有BADI将 ...

  3. sap 三代出口(BADI)的查找方法

    sap 三代出口(BADI)的查找方法 对于根据事务代码查找对应的BADI,网上介绍的方法很多,但总结下来无非就两种方法,在此把它记录下来,方便以后自己查阅了.(1)通过SE24,输入CL_EXITH ...

  4. SAP 增强-出口选找方法-全部

    ■ SAP 中如何寻找增强 方法一:利用TCODE寻找增强(第二代的增强) 执行一个程序(源代码后附),在选择屏幕处输入你所需要增强的程序TCODE,执行後,就会出现一个列表,那里就有关于如何增强这个 ...

  5. ABAP FIELD-SYMBOLS 有大作用- 将没有可改参数的增强出口变得也能改主程序的值了

    看下图代码: report  z_xul_test2 中 定义了 全局变量 G_DATA1 , 分别调用了 z_xul_tes1 中的 form  和 function zbapi_test , 这两 ...

  6. ABAP FIELD-SYMBOLS 有大作用- 将没有可改參数的增强出口变得也能改主程序的值了

    看下图代码: report  z_xul_test2 中 定义了 全局变量 G_DATA1 , 分别调用了 z_xul_tes1 中的 form  和 function zbapi_test , 这两 ...

  7. page61-将二分查找重写为一段面向对象的程序

    1 将二分查找重写为一段面向对象的程序 (用于在整数集合中进行查找的一种抽象数据类型) public class StaticSETofInts [API] StaticSETofInts(int[] ...

  8. SAP ABAP 查找用户出口

    1.查找事物代码程序名 2.查找用户出口 T-CODE:SE80 在子例程中查找以USEREXIT开头的子程序.

  9. SAP基本搜索帮助及增强出口

    se11创建基本搜索帮助时,各个参数的含意 选择方法   指定命中列表的数据来源,可以是数据库表,视图,CDS.如果指定了搜索帮助出口函数则该字段可以不输,数据来源可以在出口中自行指定 对话类型: 输 ...

随机推荐

  1. HTML 字符图案

    Dog: <!-- :: :;J7, :, ::;7: ,ivYi, , ;LLLFS: :iv7Yi :7ri;j5PL ,:ivYLvr ,ivrrirrY2X, :;r@Wwz.7r: : ...

  2. [已解决] MAVEN安装代码到本地库,安装jar, source, javadoc的方式

    mvn install:install-file -Dfile=a.jar -DgroupId=gid -DartifactId=aid -Dversion=0.0.1 -Dpackaging=jar ...

  3. json pickle time

    多层装饰器: 字符串格式化: 当字符串格式化时 , %% 生成器 使用函数创造的 yield递归模块PY:模块其他:类库 先导入 后使用 自定义模块内置模块第三方模块为什么要有模块 将代码归类模块的内 ...

  4. 利用opencv训练样本分类

    参考:http://www.cnblogs.com/easymind223/archive/2012/07/03/2574826.html http://www.tuicool.com/article ...

  5. react-native 调用 TouchableOpacity (触摸透明) 时报了一个警告

    `useNativeDriver` is not supported because the native animated module is missing. Falling back to JS ...

  6. table表格,让thead固定,tbody有滚动条,关键是都对齐的纯css写法。

    找了好久才找到一篇可以简单粗暴就能用的,所以拿过来算是收藏了.里面有一个css2里的命令是我没用过的也是这里面关键的:table-layout:fixed; 原理很简单,有爱研究的童鞋可以去css官网 ...

  7. 修正iOS从照相机和相册中获取的图片方向(转)

    - (UIImage *)fixOrientation { // No-op if the orientation is already correct if (self.imageOrientati ...

  8. Spark学习(三) -- SparkContext初始化

    标签(空格分隔): Spark 本篇博客以WordCount为例说明Spark Job的提交和运行,包括Spark Application初始化.DAG依赖性分析.任务的调度和派发.中间计算结果的存储 ...

  9. mysql服务器和配置优化

    一.存储引擎 mysql中有多种存储引擎,一般常见的有三种:   MyIsam InnoDB Memory 用途 快读 完整的事务支持 内存数据 锁 全表锁定 多种隔离级别的行锁 全表锁定 持久性 基 ...

  10. Mifare系列2-非接触卡标准(转)

    本文转自 文/闫鑫原创转载请注明出处http://blog.csdn.net/yxstars/article/details/380799 根据信号发送和接收方式的不同,ISO/IEC14443-3定 ...