report zenhtest message-id z25m_x_tool.
tables: tstc, " SAP Transaction Codes
tadir, " Directory of Repository Objects
modsapt, " SAP Enhancements - Short Texts
sxs_attrt,"Exit: Definition side: Attributes, Text table
trdir, " System table TRDIR
tfdir, " Function Module
enlfdir, " Additional Attributes for Function Modules
tstct. " Transaction Code Texts
data : g_oname type sobj_name, "Variable to hold Program Name Entered
g_tcode type tcode. "Variable to hold Transaction Code Entered
data : jtab like tadir occurs 0 with header line. "Internal Tabele declaration.. Withe header line
data : v_devclass like tadir-devclass. "Variable to hold Package of Tcode/prog entered
data : v_smod type i ,
v_badi type i ,
v_object type trobjtype.
data: l_es_erw type enh_hook_def,
l_es_erw_s type enh_hook_def_spot,
l_erw type enhincinx,
l_imp type enh_hook_source,
l_full_name type string,
l_full_name_ret type string.
data : itab_inc type standard table of d010inc, " Internal Table to handle include programs
wa_inc type d010inc. "Work area Declarations
***************************Structure Declasrations********************************************
data: begin of wa_result, " Result structure
obj_type type enhobj-obj_type,
obj_name type enhobj-obj_name,
enhspot type enhspotobj-enhspot,
enhname type enhobj-enhname,
switch_id type sfw_switch_id,
state type sfw_switchpos,
end of wa_result.
data: begin of wa_enhnames, " Enhancement name details structure
enhname type sobj_name,
main_name type enhobj-main_name,
end of wa_enhnames.
**--
data: begin of wa_enhnames_enho, " Enhancement deatils structure
enhname type enhname,
obj_name type trobj_name,
main_type type trobjtype,
end of wa_enhnames_enho.
data: begin of wa_es_head_it, "Enhnacement Spot name
enhspot type enhobj-main_name,
end of wa_es_head_it.
* Batch Input Table
data: begin of i_bdcdata occurs 0. "BDC data structure
include structure bdcdata.
data: end of i_bdcdata.
data: i_eso_it type standard table of enhspotobj, "enhancements details
i_eso_it_1 type standard table of enhspotobj, "enhancements details
i_result like wa_result occurs 0 with header line, "result table with details
i_final like wa_result occurs 0 with header line, "display table
i_enhnames like wa_enhnames occurs 0 with header line,
i_enhnames_enho like wa_enhnames_enho occurs 0 with header line,
i_es_head_it like wa_es_head_it occurs 0 with header line,
i_jtab like tadir occurs 0 with header line, "table to capture enhancements
i_jtab_enho like tadir occurs 0 with header line,
i_messtab like bdcmsgcoll occurs 0 with header line. "#EC * "BDC message tab
data : wa_eso_it like line of i_eso_it,
lv_enhname like enhobj-enhname,
lv_fld type enhname.
*"A: show all dynpros "E: show dynpro on error only N: do not display dynpro
data: ctumode like ctu_params-dismode value 'E',
*"S: synchronously *"A: asynchronously *"L: local
cupdate like ctu_params-updmode value 'L'.
**-- Include program names
types: begin of t_includes,
prog type trobj_name,
end of t_includes.
**-- Program content for text download
data: begin of content occurs 0, "#EC *
line(255), "#EC *
end of content.
**-- Types for enhancement spots
types: begin of type_enhspotobj,
enhspot type enhspotname,
version type r3state,
obj_type type trobjtype,
obj_name type trobj_name,
main_type type trobjtype,
main_name type eu_aname,
end of type_enhspotobj.
**--
types: begin of type_enho_obj,
obj_name type trobjtype,
devclass type devclass,
end of type_enho_obj.
**--
types: begin of type_switch,
switch_id type sfw_switch_id,
devclass type packname,
end of type_switch.
**--
types: begin of type_switch_state,
switch_id type sfw_switch_id,
state type sfw_switchpos,
end of type_switch_state.
**-- Names of function modules used within programmes
data: i_prog_includes type standard table of t_includes with header line.
**-- Internal table for enhancement spots
data: i_enhspotobj type standard table of type_enhspotobj with header line,
wa_enhspotobj type type_enhspotobj,
**-- Development classes for implimentation
i_enho_obj type standard table of type_enho_obj with header line,
**-- Switch
i_switch type standard table of type_switch with header line,
**-- Switch state
i_switch_state type standard table of type_switch_state with header line.
field-symbols : <l_imp> type enh_hook_source,
<l_eso> type enhspotobj,
<l_enhspotobj> type type_enhspotobj.
selection-screen begin of block b1 with frame title text-001.
parameters : r_exit radiobutton group g1 user-command ucom default 'X', "To find user exits/badis
r_espot radiobutton group g1. "To find Enhancement spots
selection-screen end of block b1.
selection-screen begin of block b2 with frame title text-002.
parameters : r_tcode radiobutton group g2 user-command ucom2 modif id a default 'X', "Search Based on Transaction Code
p_tcode type tstc-tcode modif id b, "Transaction code name
r_name radiobutton group g2 modif id c, "Search Based on Program
p_name type tadir-obj_name modif id d. "Program name
selection-screen end of block b2.
** Four MODIF ID's are used, because for 2nd block in selection screen, if transaction code has to be entered,
** then Program Name is suppose to be input inactive and vice-versa.
***********************************************************************************************************
* TOGGLING FACILITY OF SELECTION SCREEN *
***********************************************************************************************************
at selection-screen output.
loop at screen.
if r_exit = 'X'.
if screen-group1 = 'C' or screen-group1 = 'D'.
screen-active = 0. "if user exit radio button is selected, grey out Prog name parameter
modify screen.
endif.
elseif r_espot = 'X'.
"if Enhancement Spots radio button is selected
if screen-group1 = 'A' or screen-group1 = 'B' or screen-group1 = 'C' or screen-group1 = 'D'.
screen-active = '1'.
if r_tcode = 'X'.
"if Tcode radio button is selected, grey out Prog name parameter
if screen-group1 = 'D'.
screen-input = 0.
endif.
elseif r_name = 'X'.
"if Prog name radio button is selected, grey out Tcode parameter
if screen-group1 = 'B'.
screen-input = 0.
endif.
endif.
modify screen.
endif.
endif.
endloop.
***********************************************************************************************************
* SELECTION SCREEN VALIDATIONS *
***********************************************************************************************************
at selection-screen on p_tcode.
case sy-ucomm.
when 'ONLI'.
if r_tcode = 'X'. "if user selects Transaction code and does not fill in a tcode
if p_tcode is initial. " display an Error message.
message e000.
endif.
endif.
endcase.
at selection-screen on p_name.
case sy-ucomm.
when 'ONLI'.
if r_espot = 'X' and r_name = 'X'. "if user selects Program and does not fill in a prog name
if p_name is initial. " display an Error message.
message e001.
endif.
endif.
endcase.
***********************************************************************************************************
* AT SELCTION SCREEN EVENT *
***********************************************************************************************************
at selection-screen.
if r_exit eq 'X'.
clear r_name.
endif.
if r_espot = 'X'.
if r_tcode = 'X'.
clear p_name.
endif.
if r_name = 'X'.
clear p_tcode.
endif.
endif.
if r_tcode = 'X' and p_tcode is not initial. "If user enters a transaction code
select single tcode "Check if tcode exists in standard table TSTC
from tstc
into g_tcode
where tcode = p_tcode.
if sy-subrc ne 0.
message e003.
endif.
endif.
if r_name = 'X' and p_name is not initial. "If user enters program name
select single obj_name "#EC * " Check if prog name exists in standard table TADIR.
from tadir
into g_oname
where obj_name = p_name.
if sy-subrc ne 0.
message e002.
endif.
endif.
***********************************************************************************************************
* START OF SELECTION EVENT *
***********************************************************************************************************
start-of-selection.
if r_exit = 'X'. "if user wants to find user exits.
perform f_badis_exits. "Subroutine to find User Exits/Badis
elseif r_espot = 'X'. " if user want to find ENHANCEMENT SPOT.
if r_tcode = 'X'.
perform f_tcode_spots. "Subroutine to find Enhancment Spots For a given Tcdoe
else.
perform f_pname_spots. "Subroutine to find Enhancment Spots For a given Program
endif.
endif.
***********************************************************************************************************
* AT LINE SELECTION EVENT *
***********************************************************************************************************
at line-selection. "Navigation on clicking on a list item
**--
clear: lv_fld,
lv_enhname.
**--
get cursor field lv_fld value lv_enhname.
"If user clicks on Enhancment Name in list display, it transits to 2nd screen of SE19.
if lv_fld = 'I_FINAL-ENHNAME'.
if lv_enhname is not initial.
perform fbdc_dynpro using 'SAPLSEXO' '0120'.
perform fbdc_field using 'BDC_OKCODE' '=IMP_SHOW'.
perform fbdc_field using 'BDC_CURSOR' 'G_ENHNAME'.
perform fbdc_field using 'G_IS_NEW_1' 'X'.
perform fbdc_field using 'G_ENHNAME' lv_enhname.
perform fbdc_field using 'G_IS_NEW_2' 'X'.
perform fbdc_dynpro using 'SAPLSEXO' '0120'.
perform fbdc_field using 'BDC_OKCODE' '=WB_BACK'.
perform fbdc_field using 'BDC_CURSOR' 'G_ENHNAME'.
perform fbdc_field using 'G_IS_NEW_1' 'X'.
perform fbdc_field using 'G_ENHNAME' lv_enhname.
perform fbdc_field using 'G_IS_NEW_2' 'X'.
perform fbdc_transaction using 'SE19'. " Call transaction se19
endif.
"If user clicks on Enhancment Spot in list display, navigate to 2nd screen of SE18.
elseif lv_fld = 'I_FINAL-ENHSPOT'.
perform fbdc_dynpro using 'SAPLSEXO' '0100'.
perform fbdc_field using 'BDC_OKCODE' '=SHOW'.
perform fbdc_field using 'BDC_CURSOR' 'G_ENHSPOTNAME'.
perform fbdc_field using 'G_IS_SPOT' 'X'.
perform fbdc_field using 'G_ENHSPOTNAME' sy-lisel+1(29).
perform fbdc_dynpro using 'SAPLSEXO' '100'.
perform fbdc_field using 'BDC_OKCODE' '=WB_BACK'.
perform fbdc_field using 'BDC_CURSOR' 'G_BADINAME'.
perform fbdc_field using 'G_IS_BADI' 'X'.
perform fbdc_transaction using 'SE18'. " Call transaction se18
elseif lv_fld(4) eq 'JTAB'.
read table jtab with key obj_name = sy-lisel+1(20).
move jtab-object to v_object.
case v_object.
"if user clicks on a User-Exit in list display, navigate to 2nd screen of SMOD.
when 'SMOD'.
set parameter id 'MON' field sy-lisel+1(10).
perform fbdc_dynpro using 'SAPMSMOD' '2010'.
perform fbdc_field using 'BDC_CURSOR' 'MOD0-NAME'.
perform fbdc_field using 'BDC_OKCODE' '=SHOW'.
perform fbdc_field using 'MOD0-NAME' sy-lisel+1(10).
perform fbdc_field using 'MODF-CHAM' 'X'.
perform fbdc_dynpro using 'SAPMSMOD' '2010'.
perform fbdc_field using 'BDC_CURSOR' 'MOD0-NAME'.
perform fbdc_field using 'BDC_OKCODE' '=BACK'.
perform fbdc_field using 'MODF-HEAS' 'X'.
perform fbdc_transaction using 'SMOD'. "CALL TRANSACTION smod
"if user clicks on a BADI in list display
when 'SXSD'.
perform fbdc_dynpro using 'SAPLSEXO' '0100'.
perform fbdc_field using 'BDC_OKCODE' '=ISSPOT'.
perform fbdc_field using 'BDC_CURSOR' 'G_IS_BADI'.
perform fbdc_field using 'G_IS_BADI' 'X'.
perform fbdc_dynpro using 'SAPLSEXO' '0100'.
perform fbdc_field using 'BDC_OKCODE' '=SHOW'.
perform fbdc_field using 'G_BADINAME' sy-lisel+1(29).
perform fbdc_dynpro using 'SAPLSEXO' '100'.
perform fbdc_field using 'BDC_OKCODE' '=WB_BACK'.
perform fbdc_field using 'BDC_CURSOR' 'G_BADINAME'.
perform fbdc_field using 'G_IS_BADI' 'X'.
perform fbdc_transaction using 'SE18'. "CALL TRANSACTION se18
endcase.
endif.
***********************************************************************************************************
* END OF SELECTION EVENT *
***********************************************************************************************************
end-of-selection.
refresh: i_result, i_final, i_enhnames,
i_es_head_it, i_jtab, i_bdcdata,
i_messtab.
free: i_result, i_final, i_enhnames,
i_es_head_it, i_jtab, i_bdcdata,
i_messtab.
** All the internal table the feilds are refreshed and free, according to the requirement.
form f_badis_exits .
if not p_tcode is initial.
*-- Validate Transaction Code using the Standard Table TSTC.
select single * from tstc
where tcode eq p_tcode.
*-- Find Repository Objects for transaction code, which has Object Type PROG.
if sy-subrc eq 0.
select single * from tadir
where pgmid = 'R3TR'
and object = 'PROG'
and obj_name = tstc-pgmna.
**--Find Repository Objects for transaction code, which has Object Type TRAN.
if sy-subrc ne 0.
select single * from tadir
where pgmid = 'R3TR'
and object = 'TRAN'
and obj_name = p_tcode.
endif.
move : tadir-devclass to v_devclass. " Capture Package
if sy-subrc ne 0. "in case object type is function group
select single * from trdir
where name = tstc-pgmna.
if trdir-subc eq 'F'.
select single * from tfdir "#EC *
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. "Capture Package
endif.
endif.
else.
format color col_negative intensified on.
message e004.
endif.
endif.
**--
* Find SAP Modifactions
select * from tadir "Select user exits/BADIS
into table jtab
where pgmid = 'R3TR'
and object in ('SMOD','SXSD')
and devclass = v_devclass.
"To display Tcode Short Descriptions
select single * from tstct
where sprsl eq sy-langu
and tcode eq p_tcode.
format color col_positive intensified off.
if not p_tcode is initial.
write:/(19) text-007,
20(20) p_tcode,
45(50) tstct-ttext.
endif.
if not jtab[] is initial.
write:/(105) sy-uline.
format color col_heading intensified on.
write:/1 sy-vline,
2 text-008,
41 sy-vline,
42 text-009,
105 sy-vline.
write:/(105) sy-uline.
loop at jtab.
"For listing out User Exits
at new object.
if jtab-object = 'SMOD'.
format color col_group intensified on.
write:/1 sy-vline,
2 'User Exits'(300),
105 sy-vline.
"For listing out BADI's
elseif jtab-object = 'SXSD'.
format color col_group intensified on.
write:/1 sy-vline,
2 ' Business Add-in'(301),
105 sy-vline.
endif.
endat.
case jtab-object.
when 'SMOD'. "for user exits
v_smod = v_smod + 1. "counter for user exits, to give the total number of user exits.
select single * from modsapt
where sprsl = sy-langu
and name = jtab-obj_name.
format color col_normal intensified on.
write:/1 sy-vline,
2 jtab-obj_name hotspot on,
41 sy-vline ,
42 modsapt-modtext,
105 sy-vline.
when 'SXSD'.
* For BADI's
v_badi = v_badi + 1 . "counter for BADIS
select single * from sxs_attrt
where sprsl = sy-langu
and exit_name = jtab-obj_name.
format color col_normal intensified on.
write:/1 sy-vline,
2 jtab-obj_name hotspot on,
41 sy-vline ,
42 sxs_attrt-text,
105 sy-vline.
endcase.
at end of object.
write : /(105) sy-uline.
endat.
endloop.
write:/(105) sy-uline.
describe table jtab.
skip.
format color col_total intensified on.
write:/ 'No of exits:'(302), v_smod.
write:/ 'No of BADI''s:'(303), v_badi.
else.
"Incase BADI's/ User Exits do not Exist
call function 'POPUP_TO_INFORM' "EC NOTEXT
exporting
titel = 'Information Message'(500)
txt1 = 'Sorry!!!'(501)
txt2 = 'No BADI''s/User exits available for the above Transaction'(502).
leave program.
endif.
endform. " F_BADIS_EXITS
*&---------------------------------------------------------------------*
*& Form F_TCODE_SPOTS
*&---------------------------------------------------------------------*
* Finds the enhancement spots.
*----------------------------------------------------------------------*
form f_tcode_spots .
if not p_tcode is initial.
**--select tcode from tadir
select single * from tstc
where tcode eq p_tcode.
if sy-subrc eq 0.
"Select Prog behind the btransaction
select single * from tadir
where pgmid = 'R3TR'
and object = 'PROG'
and obj_name = tstc-pgmna.
"Capture Program pav\ckage
move : tadir-devclass to v_devclass.
"Else look in trdir
if sy-subrc ne 0.
select single * from trdir
where name = tstc-pgmna.
if trdir-subc eq 'F'.
select single * from tfdir "#EC *
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. "IF trdir-subc EQ 'F'
endif. "IF sy-subrc NE 0
else.
format color col_negative intensified on.
message e004.
endif.
**--
perform get_from_tadir.
endif. "IF sy-subrc EQ 0
*-Fill i_result
loop at i_eso_it assigning <l_eso>.
i_result-enhspot = <l_eso>-enhspot.
append i_result.
endloop.
if not i_result[] is initial.
delete adjacent duplicates from i_result.
sort i_jtab by obj_name.
loop at i_result.
read table i_jtab with key obj_name = i_result-enhspot
binary search.
if sy-subrc = 0.
i_result-obj_name = i_jtab-obj_name.
read table i_eso_it into wa_eso_it with key enhspot = i_jtab-obj_name+0(30)
binary search.
if sy-subrc = 0.
i_result-obj_type = wa_eso_it-obj_type.
endif.
modify i_result.
clear i_result.
endif.
endloop.
"select Name/ID's of Enhancement Spots
select enhspot
into table i_es_head_it
from enhspotheader
for all entries in i_result
where enhspot = i_result-enhspot
and version = 'A'.
"Select Enhancement names and main prog names
if sy-subrc = 0.
select enhname
main_name
appending table i_enhnames
from enhobj
for all entries in i_es_head_it
where main_type = 'ENHS'
and main_name = i_es_head_it-enhspot.
if sy-subrc = 0.
sort i_enhnames by main_name.
delete adjacent duplicates from i_enhnames comparing enhname main_name.
**-- Get the development calss for the enhacement spots & implimentation
select obj_name
devclass
into table i_enho_obj
from tadir
for all entries in i_enhnames
where obj_name = i_enhnames-enhname and
object = 'ENHO'.
if sy-subrc = 0.
**-- Get the switch details
select switch_id
devclass
into table i_switch
from sfw_package
for all entries in i_enho_obj
where devclass = i_enho_obj-devclass.
if sy-subrc = 0.
**-- Get the switch status
select switch_id
state
into table i_switch_state
from sfw_switch_state
for all entries in i_switch
where switch_id = i_switch-switch_id.
endif.
endif.
**--
loop at i_result.
i_final-obj_type = i_result-obj_type.
i_final-obj_name = i_result-obj_name.
i_final-enhspot = i_result-enhspot.
loop at i_enhnames where main_name = i_result-enhspot.
**-- Populate the switch
read table i_enho_obj with key obj_name = i_enhnames-enhname. "#EC *
if sy-subrc = 0.
read table i_switch with key devclass = i_enho_obj-devclass.
if sy-subrc = 0.
read table i_switch_state with key switch_id = i_switch-switch_id.
if sy-subrc = 0.
i_final-switch_id = i_switch_state-switch_id.
i_final-state = i_switch_state-state.
endif.
endif.
endif.
**--
i_final-enhname = i_enhnames-enhname.
append i_final.
endloop.
if sy-subrc <> 0.
append i_final.
endif.
clear i_final.
endloop.
endif.
endif.
**-- Also consider the Enhancement implimentation which are not part of enhancement spot's
loop at i_jtab where object = 'ENHO'.
i_jtab_enho = i_jtab.
append i_jtab_enho.
endloop.
**--
if not i_jtab_enho[] is initial.
select enhname "EC#..,bzw.
obj_name
main_type
into table i_enhnames_enho
from enhobj
for all entries in i_jtab_enho
where enhname = i_jtab_enho-obj_name+0(30)
and obj_type = 'ENHS'.
if sy-subrc = 0.
**-- Select the enhancement spot object
**--
select * "#EC
from enhspotobj
into corresponding fields of table i_eso_it_1
for all entries in i_enhnames_enho
where enhspot = i_enhnames_enho-obj_name+0(30).
if sy-subrc = 0.
sort i_eso_it_1 by enhspot.
endif.
**-- Populate the final table
delete adjacent duplicates from i_enhnames_enho comparing enhname.
loop at i_enhnames_enho.
read table i_final with key enhname = i_enhnames_enho-enhname.
if sy-subrc <> 0.
clear: i_final.
**--
clear: wa_eso_it.
read table i_eso_it_1 into wa_eso_it with key
enhspot = i_enhnames_enho-obj_name+0(30) binary search.
if sy-subrc = 0.
i_final-obj_type = wa_eso_it-obj_type.
endif.
i_final-enhspot = i_enhnames_enho-obj_name.
i_final-enhname = i_enhnames_enho-enhname.
append i_final.
endif.
endloop.
endif.
endif.
**--
loop at i_final.
format color col_normal intensified on.
at new enhspot.
write: /1 sy-vline,
2 i_final-enhspot hotspot on,
34 sy-vline.
endat.
case i_final-obj_type.
when 'REPS' or 'PROG'.
write: 36 'Source Code Enhancement'(304).
when 'INTF' or 'SXSD'.
write: 36 'BADI Enhancement'(305).
when 'FUNC' or 'FUGR'.
write: 36 'Function group Enhancement'(306).
when 'CLAS'.
write: 36 'Class Enhancement'(307).
when others.
write: 36 i_final-obj_type.
endcase.
write: 64 sy-vline,
66 i_final-enhname hotspot on,
100 sy-vline,
101 i_final-switch_id,
132 sy-vline.
**--
case i_final-state.
when 'T'.
write 133 'On'(308).
when 'S'.
write 133 'Stand-by'(309).
when 'F'.
write 133 'Off'(310).
endcase.
write: 150 sy-vline.
endloop.
write:/(150) sy-uline.
endif.
endform. " F_TCODE_SPOTS
*&---------------------------------------------------------------------*
*& Form GET_FROM_TADIR
*&---------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
form get_from_tadir .
" select records whose object types are enhancment spots/implimentations
select * from tadir
into table i_jtab
where pgmid = 'R3TR'
and object in ('ENHS','ENHO')
and devclass = v_devclass.
"to display short texts for tcode
select single * from tstct
where sprsl eq sy-langu
and tcode eq p_tcode.
format color col_positive intensified off.
* Transaction Code
write:/1 text-018.
if not p_tcode is initial.
write: 30(20) p_tcode.
endif.
write: 55(50) tstct-ttext.
skip.
if not i_jtab[] is initial.
**-- Genral information.
format color col_heading intensified on.
write:/ 'To see Enhancement spot/Implementation in detail, please click on values under column'(311).
write:/(150) sy-uline.
format color col_heading intensified on.
write:/1 sy-vline,
2 text-015,
34 sy-vline,
36 text-016,
64 sy-vline,
66 text-014,
100 sy-vline,
101 'Switch'(520),
132 sy-vline,
133 'Switch State'(521),
150 sy-vline.
write:/(150) sy-uline.
**--Required details from enhspotobj table
select * "#EC
from enhspotobj
into corresponding fields of table i_eso_it
for all entries in i_jtab
where enhspot = i_jtab-obj_name+0(30).
if sy-subrc eq 0.
sort i_eso_it by enhspot.
endif.
else.
"Information popup
call function 'POPUP_TO_INFORM'
exporting
titel = 'Information Message'(503)
txt1 = 'Sorry!!!'(504)
txt2 = 'No Enhancements available for the selected Transaction'(505).
leave program.
endif. "IF NOT I_JTAB[] IS INITIAL
endform. " GET_FROM_TADIR
*&---------------------------------------------------------------------*
*& Form F_PNAME_SPOTS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form f_pname_spots .
"select record corresponding to entered tcode
select single tcode from tstc "#EC *
into p_tcode
where pgmna = p_name.
select single * from tstc
where tcode eq p_tcode.
if p_tcode is initial.
select single * from trdir where name = p_name.
if trdir-subc eq 'I'.
" in case include programs, select required details from d010inc
select * from d010inc
into table itab_inc
where include = p_name.
if itab_inc is not initial.
loop at itab_inc into wa_inc.
select single * from tstc "#EC *
where pgmna = wa_inc-master.
if sy-subrc = 0.
exit.
endif.
endloop.
tstc-pgmna = p_name.
endif.
endif.
endif.
if sy-subrc eq 0.
if not tstc-pgmna is initial.
**-- Select the include program's which are there in the main program
perform f_find_include_programs using tstc-pgmna.
**-- Append the main program also into internal table I_PROG_INCLUDES
i_prog_includes-prog = tstc-pgmna.
append i_prog_includes.
**--
if not i_prog_includes[] is initial.
**-- Select the enhancement spot's data from ENHSPOTOBJ
**-- All the includes in itab I_PROG_INCLUDES
select enhspot
version
obj_type
obj_name
main_type
main_name
into table i_enhspotobj
from enhspotobj
for all entries in i_prog_includes
where obj_name = i_prog_includes-prog and
version = 'A'.
if not i_enhspotobj[] is initial.
**--Select Transaction code description in system language
select single * from tstct
where sprsl eq sy-langu
and tcode eq p_tcode.
format color col_positive intensified off.
**-- Transaction Code
write:/1 text-013,
25(20) p_tcode,
48(50) tstct-ttext.
skip.
**-- Genral information.
format color col_heading intensified on.
write:/ 'To see Enhancement spot/Implementation in detail, please click on the enhancements of your choice'(325).
write:/(150) sy-uline.
format color col_heading intensified on.
write:/1 sy-vline,
2 text-015,
34 sy-vline,
36 text-016,
64 sy-vline,
66 text-014,
100 sy-vline,
101 'Switch'(522),
132 sy-vline,
133 'Switch State'(523),
150 sy-vline.
write:/(150) sy-uline.
endif. "IF NOT i_enhspotobj[] IS INITIAL
endif. " IF not I_PROG_INCLUDES[] is initial.
else.
"information popup
call function 'POPUP_TO_INFORM'
exporting
titel = 'Information Message'(506)
txt1 = 'Sorry!!!'(507)
txt2 = 'No Enhancements available for the selected Transaction'(508).
leave program.
endif.
else.
"information popup
call function 'POPUP_TO_INFORM'
exporting
titel = 'Information Message'(509)
txt1 = 'Sorry!!!'(510)
txt2 = 'No Enhancements available for the selected Transaction'(511).
leave program.
endif. "IF sy-subrc EQ 0
**---
**--
if not i_enhspotobj[] is initial.
**--
loop at i_enhspotobj assigning <l_enhspotobj>.
i_result-enhspot = <l_enhspotobj>-enhspot.
append i_result.
endloop.
if not i_result[] is initial.
**--remove redundant records
delete adjacent duplicates from i_result.
**--sort table
sort i_enhspotobj by enhspot.
**--Populate rest of i_result
loop at i_result.
***--get obj_name and main_type values from ENHSPOTOBJ table
read table i_enhspotobj into wa_enhspotobj with key enhspot = i_result-enhspot
binary search.
if sy-subrc = 0.
i_result-obj_name = wa_enhspotobj-obj_name.
i_result-obj_type = wa_enhspotobj-main_type. " obj_type.
endif.
modify i_result.
clear i_result.
endloop.
**--
select enhspot
into table i_es_head_it
from enhspotheader
for all entries in i_result
where enhspot = i_result-enhspot
and version = 'A'.
if sy-subrc = 0.
**-- Get the enhancement id data from ENHOBJ
select enhname
main_name
appending table i_enhnames
from enhobj
for all entries in i_es_head_it
where main_type = 'ENHS'
and main_name = i_es_head_it-enhspot.
if sy-subrc = 0.
**--sort table
sort i_enhnames by main_name.
delete adjacent duplicates from i_enhnames comparing enhname main_name.
**-- Get the development calss for the enhacement spots & implimentation
select obj_name
devclass
into table i_enho_obj
from tadir
for all entries in i_enhnames
where obj_name = i_enhnames-enhname and
object = 'ENHO'.
if sy-subrc = 0.
**-- Get the switch details
select switch_id
devclass
into table i_switch
from sfw_package
for all entries in i_enho_obj
where devclass = i_enho_obj-devclass.
if sy-subrc = 0.
**-- Get the switch status
select switch_id
state
into table i_switch_state
from sfw_switch_state
for all entries in i_switch
where switch_id = i_switch-switch_id.
endif.
endif.
**--
loop at i_result.
i_final-obj_type = i_result-obj_type.
i_final-obj_name = i_result-obj_name.
i_final-enhspot = i_result-enhspot.
loop at i_enhnames where main_name = i_result-enhspot.
**-- Populate the switch
read table i_enho_obj with key obj_name = i_enhnames-enhname. "#EC *
if sy-subrc = 0.
read table i_switch with key devclass = i_enho_obj-devclass.
if sy-subrc = 0.
read table i_switch_state with key switch_id = i_switch-switch_id.
if sy-subrc = 0.
i_final-switch_id = i_switch_state-switch_id.
i_final-state = i_switch_state-state.
endif.
endif.
endif.
**--Populate enhancement name
i_final-enhname = i_enhnames-enhname.
append i_final.
endloop.
clear i_final.
endloop.
endif.
endif.
endif.
**--
**--Fill up the final display table
loop at i_final.
format color col_normal intensified on.
write: /1 sy-vline,
2 i_final-enhspot hotspot on,
34 sy-vline.
**--Description of object types
case i_final-obj_type.
when 'REPS' or 'PROG'.
write: 36 'Source Code Enhancement'(315).
when 'INTF' or 'SXSD'.
write: 36 'BADI Enhancement'(316).
when 'FUNC' or 'FUGR' .
write: 36 'Function group Enhancement'(317).
when 'CLAS'.
write: 36 'Class Enhancement'(318).
when others.
write: 36 i_final-obj_type.
endcase.
**--Enhancement names and switch id
write: 64 sy-vline,
66 i_final-enhname hotspot on,
100 sy-vline,
101 i_final-switch_id,
132 sy-vline.
**--Switxh state
case i_final-state.
when 'T'.
write 133 'On'(319).
when 'S'.
write 133 'Stand-by'(320).
when 'F'.
write 133 'Off'(321).
endcase.
write: 150 sy-vline.
endloop.
write:/(150) sy-uline.
elseif i_enhspotobj[] is initial.
"information popup
call function 'POPUP_TO_INFORM'
exporting
titel = 'Information Message'(509)
txt1 = 'Sorry!!!'(510)
txt2 = 'No Enhancements available for the selected Transaction'(511).
endif.
endform. " F_PNAME_SPOTS
*&---------------------------------------------------------------------*
*& Form fbdc_dynpro
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->PROGRAM text
* -->DYNPRO text
*----------------------------------------------------------------------*
form fbdc_dynpro using program type any dynpro type any.
clear i_bdcdata.
i_bdcdata-program = program.
i_bdcdata-dynpro = dynpro.
i_bdcdata-dynbegin = 'X'.
append i_bdcdata.
endform. "FBDC_DYNPRO
*----------------------------------------------------------------------*
* Insert field *
*----------------------------------------------------------------------*
form fbdc_field using fnam type any fval type any.
clear i_bdcdata.
i_bdcdata-fnam = fnam.
i_bdcdata-fval = fval.
append i_bdcdata.
endform. "FBDC_FIELD
*----------------------------------------------------------------------*
* Start new transaction according to parameters *
*----------------------------------------------------------------------*
form fbdc_transaction using value(l_tcode) like tstc-tcode.
refresh i_messtab.
call transaction l_tcode using i_bdcdata
mode ctumode
update cupdate
messages into i_messtab.
refresh i_bdcdata.
clear i_bdcdata.
endform. "fbdc_transaction
*&---------------------------------------------------------------------*
*& Form F_FIND_INCLUDE_PROGRAMS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_TSTC_PGMNA text
*----------------------------------------------------------------------*
form f_find_include_programs using p_tstc_pgmna type any.
data: lv_fip_prog(255),
lv_tail(255). "#EC *
*--- Lines for include
data: i_inc_lines like content occurs 0 with header line.
**-- Read ABAP
read report p_tstc_pgmna into i_inc_lines.
**-- Examine each line of ABAP
loop at i_inc_lines.
**-- find include programs.
if i_inc_lines(1) = '*' or i_inc_lines is initial.
continue.
endif.
translate i_inc_lines-line to upper case.
shift i_inc_lines-line up to 'INCLUDE'.
if ( i_inc_lines-line(7) eq 'INCLUDE' ) or
( i_inc_lines-line(7) eq 'INCLUDE' )
and i_inc_lines-line+8(9) ne space
and sy-tabix <> 1.
lv_fip_prog = i_inc_lines-line+8(64).
split lv_fip_prog at '.' into lv_fip_prog lv_tail.
**- Append program name to list of include programs
select single * from trdir where name eq lv_fip_prog.
check sy-subrc eq 0.
i_prog_includes-prog = lv_fip_prog.
append i_prog_includes.
*--- Recursively look for other includes.
perform f_find_include_programs using lv_fip_prog.
endif.
endloop.
endform. " F_FIND_INCLUDE_PROGRAMS
Useless as you used custom message class. Please remove the coding.
ReplyDeleteyou are helping, respect please, the code is fine, you do not know how to use the code
Deleteits fine just give yr message
ReplyDeletei cant understand sir
ReplyDelete