Enhancement比较重要的表MODSAP,这个表里重要的字段增强名(Name),组件类型(TYP: E C S T),组件功能模块名(Member):里面记录了所有enhancement的增强.TFDIR所有的函数表,重要字段FUNCName(函数名),MAND(功能模块激活状态 如果是C代表此函数模块激活)。
REPORT ZLC_FIND_EXIT no standard page heading.
tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
tables : tstct.
data : jtab like tadir occurs 0 with header line.
data : field1(30).
data : v_devclass like tadir-devclass.
parameters : p_tcode like tstc-tcode obligatory.
select single * from tstc where tcode eq p_tcode.
if sy-subrc eq 0.
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 0.
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.
select * from tadir into table jtab
where pgmid = ‘R3TR‘
and object = ‘SMOD‘
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:/(19) ‘Transaction Code - ‘,
20(20) p_tcode,
45(50) tstct-ttext.
skip.
if not jtab[] is initial.
write:/(95) sy-uline.
format color col_heading intensified on.
write:/1 sy-vline,
2 ‘Exit Name‘,
21 sy-vline ,
22 ‘Description‘,
95 sy-vline.
write:/(95) sy-uline.
loop at jtab.
select single * from modsapt
where sprsl = sy-langu and
name = jtab-obj_name.
format color col_normal intensified off.
write:/1 sy-vline,
2 jtab-obj_name hotspot on,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
endloop.
write:/(95) sy-uline.
describe table jtab.
skip.
format color col_total intensified on.
write:/ ‘No of Exits:‘ , sy-tfill.
else.
format color col_negative intensified on.
write:/(95) ‘No User Exit exists‘.
endif.
else.
format color col_negative intensified on.
write:/(95) ‘Transaction Code Does Not Exist‘.
endif.
at line-selection.
get cursor field field1.
check field1(4) eq ‘JTAB‘.
set parameter id ‘MON‘ field sy-lisel+1(10).
call transaction ‘SMOD‘ and skip first screen.
[3]. TSDIR->Dynpro Areas CALL CUSTOMER SUBSCREEN(屏幕增强)
[4]. CUATEXTS-> GUI Interface: Menu Texts Changed(GUI 菜单文本增强)
[5].MODSAPA àsap 增强的属性
[6] MODATTRàsap增强项目属性
[7] TADIR à资源库对象的目录
[8] TFTITà函数功能的短文本
注意:出口真正应用是要在激活的状态下,也就是在TFIDR下的MAND字段为C.激活的时候要同时激活程序(se38)和出口函数(smod, cmod,出口程序都可)
当然一般情况,我们知道出口模块到modsap中找到对应的增强。可以通过下面的程序将其激活。
REPORT Zactexitfun .
update tfdir set MAND = ‘C‘.
where FUNcname = ‘EXIT_SAPMM06E_013‘.
*判断是否存在相应增强的定义(SMOD)
select single name
from modsapa
into mod0-name
where name = ‘PPCO0002‘.
if sy-subrc = 0.
endif.
select single *
from tadir
into ps_tadir_db
where pgmid = ‘R3TR‘
and object = ‘SMOD‘
and obj_name = ‘PPCO0002‘.
*判断是否存在相应增强项目的定义(CMOD)
SELECT SINGLE name FROM MODATTR into mod0-name
WHERE NAME = ‘PPCO0002‘.
*提取增强的定义的组件 (可以用此反查增强定义)
select * from modsap
where name = ‘PPCO0002‘.
当然我们可以用下面的函数来找增强的组件。MOD_SAP_MEMBER_TEXT
*获得出口功能模块的信息
select single * from tftit
where "SPRAS" = ‘1‘ AND "FUNCNAME" = ‘EXIT_SAPLCORE_001‘
if sy-subrc = 0.
endif.
*判断该增强是否移植到BADI实现
select single migrated into migrated
from modsapa where name = modname.
if sy-subrc = 0 and migrated = ‘x’.
说明此增强已经移植到BADI实现了
endif.