*&---------------------------------------------------------------------*
*& 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. java中的队列

    转载自:http://blog.csdn.net/guijava/article/details/3784658 在java5中新增加了java.util.Queue接口,用以支持队列的常见操作.Qu ...

  2. COUNT(1)和COUNT(*)区别

    项目经常用到count(1),但是和count(*)什么区别? 从下面实验结果来看,Count (*)和Count(1)查询结果是一样的,都包括对NULL的统计,而count(列名) 是不包括NULL ...

  3. easyui DataGrid 工具类之 util js

    var jq;                var tab;                var tabsIndex;                                /**     ...

  4. 函数动态参数实现format

    变量赋值一种是字符串格式化,一种是通过format的方式 1.字符串格式化 s="i am %s,age %d"%('Jasper',23)print(s) 打印输出:i am J ...

  5. javascript 值类型与引用类型

    写的比较简单哈,只是用来记忆下 (1)值类型:undefined.null.Boolean.Number和String (2)引用类型:对象.数组.函数

  6. Web API

    https://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api ...

  7. vpsmate安装

    安装需求 操作系统:CentOS/Redhat 5.4 或 5.4 以上版本,32位或64位均可,推荐使用 CentOS 6.2 64位. 内存大小:运行时占用约 20MB 左右的服务器内存. 请使用 ...

  8. ma60笔记

    60日均线是股价的生命线,跌破生命线就有一定的下跌空间.大 盘指数也有这种规律,当指数跌破60日平均线后,意味着大盘有一定的下跌空间.大盘指数是由所有个股价格加权统计后产生的,而个股价格却有很大的差异 ...

  9. Excel-漏斗图分析(差异分析)

    漏斗图适用于业务流程比较规范.周期长.环节多的流程分析,通过漏斗各环节业务数据的比较,能够直观地发现和说明问题所在.在网站分析中,通常用于转化率比较,它不仅能展示用户从进入网站到实现购买的最终转化率, ...

  10. Adding a Controller

    MVC stands for Model, View, Controller. MVC is a pattern for developing applications such that each ...