*&---------------------------------------------------------------------*
*& 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. [Solved]bcdedit.exe文件权限问题

    最近在项目开发过程中,要使用到C:\Windows\system32\bcdedit.exe 但是在使用过程中,发现了一个问题.在命令行下面使用bcdedit.exe,如果是以管理员方式运行的命令行就 ...

  2. java equals和==的区别

    大概说equals和==都比较的是什么: 1. boolean tem = a == b; 首先==比较的肯定是地址,从堆栈的角度说也就是说==比较的是栈上面的内容.因为栈是用来存放地址或是java中 ...

  3. JavaScript---function、this关键字相关习题

    1. 请看下列代码: function F( ){ function C( ){ return this; } return C(); } var o=new F( ); 请问上面的this值指向的是 ...

  4. 【GO】GO语言学习笔记三

    7.数组: 几乎是最常用的数据类型了... 数组就是指一系列同一类型数据 的集合.数组中包含的每个数据被称为数组元素(element),一个数组包含的元素个数被称为数 组的长度. 常规的数组声明方法: ...

  5. Program.cs

    Program.cs using System; namespace HelloWorld { class Program { [STAThread] static void Main(string[ ...

  6. python学习之迭代器与生成器

    1.迭代器省内存 迭代器只允许往后读数据,不允许回读数据 迭代器不能跳着读文件,因为他是一点一点加载文件内容到内存的,读完了可以销毁或丢掉 2.生成一个迭代器 a = iter(["fd&q ...

  7. 空格哥的第一篇Blog

    首先十分感谢博客园在这里给我的平台,我在这里学习到了很多东西,响应的,我也想要在这里记录下自己的心路历程!在学习的过程中,希望博客园一直陪伴我,小弟在这里不胜感激!这是小弟的第一篇博客,很多东西都不是 ...

  8. ceph官网的ceph块设备(二)——快照相关

    一)快照基础命令 网址:http://ceph.sptty.com/rbd/rbd-snapshot/ 1. 创建快照 # rbd snap create yhcpool/yhctest@yhctes ...

  9. 简单播放器(增加sdl事件控制)

    #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libswscal ...

  10. 浅谈一下关于使用css3来制作圆环进度条

    最近PC端项目要做一个这样的页面出来,其他的都很简单,关键在于百分比的圆环效果.我最初打算是直接使用canvas来实现的,因为canvas实现一个圆是很简便的. 下面贴出canvas实现圆环的代码,有 ...