*&---------------------------------------------------------------------*
*& 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. angular_ui-router ——依赖注入

    Angularjs ui-router - 组件: $state / $stateProvider:管理状态定义.当前状态和状态转换.包含触发状态转换的事件和回调函数,异步解决目标状态的任何依赖项,更 ...

  2. webpack react基础配置一

    简单介绍webpack react基本配置,入门型: 环境配置: 依赖nodejs,官网下载最新版的nodejs:nodejs.org/en 安装完nodejs  npm便自动集成了,通过npm安装其 ...

  3. django 富文本展示 以及 post提交出错

    1.富文本转义 使用 {{ content.record.content | safe }} 2.post提交报错 页面表单内追加 <form id="f"action=&q ...

  4. Java 枚举类

    如果要定义一个枚举类: public enum Size { SAMLL, MEDIUM, LARGE, EXTRA, EXTRA_LARGE}; 实际上,这个声明定义的类型是一个类,它刚好有4个实例 ...

  5. DllImport attribute的总结

    C#有没有方法可以直接都用已经存在的功能(比如Windows中的一些功能,C++中已经编写好的一些方法),而不需要重新编写代码? 答案是肯定,就是通过接下来要说的 DllImport . DllImp ...

  6. mysql replace

    replace(object, search,replace) 示例:update table set col1 = replace(col1, 'a', 'A'); 将col1字段中的小写a替换成大 ...

  7. C#利用HttpWebRequest进行post请求的示例(HTTPS)

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.N ...

  8. GUI 下

    11.6 Swing组件 JButton JLabel JTextField JTextArea JTable JTree publicclass JTableDemo extends JFrame ...

  9. 使用Fusioncharts实现后台处理进度的前台展示

    本文要解决两个问题: 1.在ajax的数据交互中,如何获得后台的处理进度? 2.在前台界面中,如何使用图形化的方式展示后台处理进度?   关于第一个问题,不是本文的重点,简单说一下思路.因为HTTP协 ...

  10. 图片资源的加密和cocos2d-x中的解密

    主要处理png图片,其他格式图片也是一样的原理.阅读前可以简略了解一下png格式图片的Data trunck. 首先使用python脚本去掉png的PNG SIG(8 bytes) 以及末尾的PNGI ...