07-07-2006 4:38 PM
Hi all,
I know the perform name.Is there anyway i can check externally because i don't have the program in which it is included.
Please let me know the t code for that.
07-07-2006 5:22 PM
You should be having some additional information. How did you know the perform name? For what requirement do you want this?
Subroutines, unlike function modules are local to a program or subroutine pool. So there is no uniqueness restriction on them. There can be 100s of programs which probably have the same subroutine name. I don't think it is worth trying that. Try to give us more information or get more information before you go on this search.
07-07-2006 4:39 PM
I don't think there is any straight forward of doing that.
Regards,
Ravi
07-07-2006 4:41 PM
Use program RPR_ABAP_SOURCE_SCAN to search abap programs for a particular string. limit your search criteria.
Regards
Sridhar
07-07-2006 4:42 PM
Almost impossible, unless you have some additional info.
Regards,
ravi
07-07-2006 4:44 PM
Hi,
Create the following as a report program, execute it and type the string which you want to search.
Best regards,
Prashant
Report zsearch_tool.
************************************************************************
Type pools Declaration
************************************************************************
type-pools: slis.
************************************************************************
Tables Declaration
************************************************************************
tables: trdir, trdirt, tadir, fink.
************************************************************************
Types Declaration
************************************************************************
*- Structure for ALV List
types: begin of ty_final,
typ(12) type c,
line(10) type c,
name(40) type c,
code(255) type c,
cnam(12) type c,
cdat(10) type c,
unam(12) type c,
udat(10) type c,
devclass(30) type c,
end of ty_final.
*- Structure for trdir
types: begin of ty_dir,
name type trdir-name,
cnam type trdir-cnam,
cdat type trdir-cdat,
unam type trdir-unam,
udat type trdir-udat,
devclass type tadir-devclass,
end of ty_dir.
************************************************************************
Work Area Declaration
************************************************************************
data: wa_dir type ty_dir,
wa_trdirt type trdirt,
wa_prg_final type trdirt,
wa_fieldcat type slis_fieldcat_alv,
wa_final type ty_final.
data: begin of wa_code,
line(255) type c,
end of wa_code.
************************************************************************
Internal Tables Declaration
************************************************************************
data: tb_trdirt type table of trdirt,
tb_prg_final type table of trdirt,
tb_dir type table of ty_dir,
tb_final type table of ty_final,
tb_fieldcat type slis_t_fieldcat_alv,
tb_layout type slis_layout_alv.
*- Table for programs' code
data: begin of tb_code occurs 0,
line(255) type c,
end of tb_code.
data: tb_list_top_of_page type slis_t_listheader,
tb_events type slis_t_event.
************************************************************************
Global Data Declaration
************************************************************************
data: dg_thisprog type sy-cprog,
dg_c_answer(1) type c. " answer of yes/no popup
************************************************************************
Selection Screen
************************************************************************
*-Fields for selection:
selection-screen begin of block blk with frame title text-t01.
select-options: so_pname for trdirt-name,
so_cnam for trdir-cnam,
so_cdat for trdir-cdat,
so_unam for trdir-unam,
so_udat for trdir-udat,
so_class for tadir-devclass.
parameters: pa_title type trdirt-text.
selection-screen: skip 1, uline.
select-options: so_find for fink-txtkey no intervals.
selection-screen: uline, skip 1.
parameters: pa_incl as checkbox,
pa_comnt as checkbox.
selection-screen: skip 1.
parameters: pa_text1 radiobutton group gp1,
pa_text2 radiobutton group gp1,
pa_text3 radiobutton group gp1.
selection-screen end of block blk.
************************************************************************
INCLUDE
************************************************************************
*- Top Include
include za_find_top.
************************************************************************
AT SELECTION-SCREEN
************************************************************************
at selection-screen.
*- Make sure user has entered some text to search
if so_find is initial.
message i319(01) with 'Please enter word to find'(t01).
stop.
endif.
*- Get Confirmation from user if he left program name field blank
if so_pname is initial.
call function 'POPUP_TO_CONFIRM_STEP'
exporting
defaultoption = 'N'
textline1 = 'program name is blank'(t02)
textline2 = 'Do you want to Continue?'(t03)
titel = 'Confirmation'(t04)
importing
answer = dg_c_answer.
if dg_c_answer = 'A' or dg_c_answer = 'N'.
stop.
endif.
endif.
************************************************************************
START OF SELECTION.
************************************************************************
start-of-selection.
*- Get program details from table TRDIRT
perform get_data.
*- Filter program names by title and add includes if user checked for
include includes option
perform filter_prg.
*- Check given word in source codes or text elements
perform find_word.
*- Track events of ALV list
perform eventtab_build changing tb_events.
*- Display result in ALV LIST
perform alv_list.
************************************************************************
Form declarations
************************************************************************
&----
*& Form GET_DATA
&----
Get program details from table TRDIRT
----
form get_data.
*- Get program details on basis of program name, development class, user
names and dates
select name cnam cdat unam udat devclass
from trdir inner join tadir
on trdirname = tadirobj_name
into table tb_dir
where name in so_pname and
cnam in so_cnam and
cdat in so_cdat and
unam in so_unam and
udat in so_udat and
devclass in so_class.
if sy-subrc = 0.
*- Get program title from table TRDIRT for slected entries
select * from trdirt into table tb_trdirt
for all entries in tb_dir
where name = tb_dir-name.
else.
message i319(01) with 'No program found for this criteria'(t05).
endif.
endform. " GET_DATA
&----
*& Form filter_prg
&----
Filter program using title and include option
----
form filter_prg.
types: begin of ty_incl,
include type d010inc-include,
end of ty_incl.
data: wa_incl type ty_incl,
tb_incl type table of ty_incl.
*- Convert title text in upper case
translate pa_title to upper case.
*- Filter program using title criteria
if pa_title is initial or pa_title = '*'.
tb_prg_final[] = tb_trdirt[].
else.
loop at tb_trdirt into wa_trdirt.
translate wa_trdirt-text to upper case.
if wa_trdirt-text cp pa_title.
delete tb_trdirt.
else.
append wa_trdirt to tb_prg_final.
endif.
endloop.
endif.
if tb_trdirt[] is initial.
message i319(01) with 'No program found for this criteria'(t05).
else.
*- If user selects include includes option then add includes too
if pa_incl = 'X'.
select include from d010inc into table tb_incl
for all entries in tb_trdirt
where master = tb_trdirt-name
and not include in
('<REPINI>','<SCREEN>','<SYSINI>','<SYSSEL>','DB__SSEL').
loop at tb_incl into wa_incl.
append wa_incl to tb_prg_final.
endloop.
endif.
endif.
free tb_trdirt.
endform. " filter_prg
&----
*& Form find_word
&----
Check given word in filtered programs
----
form find_word.
data: tb_textpool like textpool occurs 50 with header line.
data dl_c_tabix type sy-tabix. " local variable to store index
*- Add * to word so that CP can be used for word w/o wild cards
loop at so_find.
concatenate '' so_find-low '' into so_find-low.
translate so_find-low to upper case.
modify so_find.
endloop.
*- Get source code for filtered programs
loop at tb_prg_final into wa_prg_final.
*- If user selects check in code or both
if pa_text1 = 'X' or pa_text3 = 'X'.
read report wa_prg_final-name into tb_code.
*- Loop through all lines of code of every program
loop at tb_code into wa_code.
if pa_comnt = 'X' and wa_code+0(1) = '*'.
continue.
endif.
translate wa_code to upper case.
dl_c_tabix = sy-tabix.
*- Find given word
loop at so_find.
if wa_code cp so_find-low.
*- Transfer data into final internal table which has to be passed to ALV
read table tb_dir into wa_dir
with key name = wa_prg_final-name.
wa_final-typ = 'CODE'(t06).
wa_final-name = wa_prg_final-name.
wa_final-line = dl_c_tabix.
wa_final-code = wa_code.
wa_final-cnam = wa_dir-cnam.
wa_final-unam = wa_dir-unam.
wa_final-devclass = wa_dir-devclass.
concatenate wa_dir-cdat4(2) '/' wa_dir-cdat6(2) '/'
wa_dir-cdat+0(4) into wa_final-cdat.
concatenate wa_dir-udat4(2) '/' wa_dir-udat6(2) '/'
wa_dir-udat+0(4) into wa_final-udat.
append wa_final to tb_final.
endif.
endloop. " so_find
endloop. " tb_code
endif.
*- If user selects check in text element or both
if pa_text2 = 'X' or pa_text3 = 'X'.
*- Find text in text elements
read textpool wa_prg_final-name into tb_textpool language sy-langu.
*- Go through all text elements
loop at tb_textpool.
translate tb_textpool-entry to upper case.
*- Find given word
loop at so_find.
if tb_textpool-entry cp so_find-low.
read table tb_dir into wa_dir
with key name = wa_prg_final-name.
*- Transfer data into final internal table which has to be passed to ALV
wa_final-typ = 'TEXT ELEMENT'(t07).
wa_final-name = wa_prg_final-name.
wa_final-line = tb_textpool-key.
wa_final-code = tb_textpool-entry.
wa_final-cnam = wa_dir-cnam.
wa_final-unam = wa_dir-unam.
wa_final-devclass = wa_dir-devclass.
concatenate wa_dir-cdat4(2) '/' wa_dir-cdat6(2) '/'
wa_dir-cdat+0(4) into wa_final-cdat.
concatenate wa_dir-udat4(2) '/' wa_dir-udat6(2) '/'
wa_dir-udat+0(4) into wa_final-udat.
append wa_final to tb_final.
endif.
endloop. " so_find
endloop. " tb_textpool
endif.
endloop. " tb_prg_final
sort tb_final by typ name.
endform. " find_word
----
FORM eventtab_build *
----
Build event table *
----
form eventtab_build changing tb_events type slis_t_event.
constants: co_top_of_page type slis_formname value 'TOP_OF_PAGE'.
data: wa_events type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = tb_events.
read table tb_events into wa_events
with key name = slis_ev_top_of_page.
if sy-subrc = 0.
move co_top_of_page to wa_events-form.
append wa_events to tb_events.
endif.
endform.
----
FORM TOP_OF_PAGE *
----
Write text at TOP of page event *
----
form top_of_page. "#EC CALLED
data dl_i_lines type i.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = tb_list_top_of_page.
describe table tb_final lines dl_i_lines.
format color col_heading.
write: 'Total No. of entries: '(t08), dl_i_lines.
skip.
endform.
&----
*& Form ALV_LIST
&----
Display search results in ALV list
----
form alv_list.
*- Set program name to global variable
dg_thisprog = sy-repid.
*- Make catalog table
perform make_catalog using 'TB_FINAL' 'TYP' 'X' 12 'Record Type'(t09).
perform make_catalog using 'TB_FINAL' 'NAME' 'X' 40
'Program Name'(t10).
perform make_catalog using 'TB_FINAL' 'LINE' 'X' 10 'Line No.'(t11).
perform make_catalog using 'TB_FINAL' 'CODE' 'X' 72 'CODE'(t06).
perform make_catalog using 'TB_FINAL' 'DEVCLASS' 'X' 10
'Dev. Class'(t12).
perform make_catalog using 'TB_FINAL' 'CNAM' 'X' 12 'Created By'(t13).
perform make_catalog using 'TB_FINAL' 'CDAT' 'X' 10 'Created On'(t14).
perform make_catalog using 'TB_FINAL' 'UNAM' 'X' 12 'Changed By'(t15).
perform make_catalog using 'TB_FINAL' 'UDAT' 'X' 10 'Changed On'(t16).
*- Deisplay search result in ALV list
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_user_command = 'USER_COMMAND'
i_callback_program = dg_thisprog
is_layout = tb_layout
it_fieldcat = tb_fieldcat[]
it_events = tb_events[]
tables
t_outtab = tb_final
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " ALV_LIST
&----
*& Form make_catalog
&----
text
----
-->p_tabname table name
-->p_fieldname field name
-->p_hotspot hotspot on Status
-->p_outputlen output length
-->p_seltext_m seltext medium
----
form make_catalog using value(p_tabname)
value(p_fieldname)
value(p_hotspot)
value(p_outputlen)
value(p_seltext_m).
*- Field catalog formation
wa_fieldcat-tabname = p_tabname.
wa_fieldcat-fieldname = p_fieldname.
wa_fieldcat-hotspot = p_hotspot.
wa_fieldcat-outputlen = p_outputlen.
wa_fieldcat-seltext_m = p_seltext_m.
append wa_fieldcat to tb_fieldcat.
clear wa_fieldcat.
endform. " make_catalog
&----
*& Form USER_COMMAND
&----
Go to source code if user double click on alv list
----
-->R_UCOMM User command
-->RS_SELFIELD selected data from ALV
----
form user_command using p_ucomm like sy-ucomm
p_selfield type slis_selfield. "#EC CALLED
case p_ucomm.
when '&IC1'. " user command for double click
read table tb_final into wa_final index p_selfield-tabindex.
if wa_final-typ = 'CODE'(t06).
*- To reach that particular line of code
call function 'RS_TOOL_ACCESS'
exporting
operation = 'SHOW'
object_name = wa_final-name
object_type = 'PROG'
position = wa_final-line
exceptions
not_executed = 1
invalid_object_type = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
else.
message i319(01) with
'Double click functionality is only for'(t17)
'record type code to reach exact line of code'(t18).
endif.
endcase.
endform. "USER_COMMAND
07-07-2006 4:52 PM
Hi,
Standard program available :
RKCTSEAR
Search source code of various programs for up to two strings. Also see RPR_ABAP_SOURCE_SCAN or use search in source functionality via SE80
Best regards,
Prashant
07-07-2006 5:22 PM
You should be having some additional information. How did you know the perform name? For what requirement do you want this?
Subroutines, unlike function modules are local to a program or subroutine pool. So there is no uniqueness restriction on them. There can be 100s of programs which probably have the same subroutine name. I don't think it is worth trying that. Try to give us more information or get more information before you go on this search.