‎2009 Apr 28 10:10 AM
Hi All
I want to search some key words like Search and condense used in programs, all programs i am reading in internal table one by one (itab).
example
loop at itab.
itab-text CS 'SEARCH '.
i am looking for the text which starts with Search means
Search a in b.
.......... search a in b.
..................... search a in b.
cosider dots as a spaces (blanks, take it like it is written after some offset)
any format in particular line where it should starts with search.
and i want to avoid text like
loop at itab " for search a in b.
or any thing which is not satrts with search key word as well when its present after some letters also i want to avoid.
i mean to say that in particular line of program which should starts with Search first character should be search may be it is after some spaces.
pls suggest how to achieve this
thanks in advance.
‎2009 Apr 28 10:24 AM
Use the SEARCH statement:
loop at itab.
condense itab-data.
SEARCH ITAB-data for 'search' staring at 0 ending at 5.
if sy-subrc = 0.
write:/ 'Search String found'.
endif.
endloop.Regards,
Ravi Kanth Talagana
‎2009 Apr 28 10:16 AM
hi,
you mean that , u want to search Keyword in all your customized program.
please give more details.
Sanket.
‎2009 Apr 28 10:20 AM
yah it is for all program which are presnt in particular server whether its customized or standard it depends on what given in selection citeria like Z* or Y* or SAP*
‎2009 Apr 28 10:22 AM
hi,
Use
SCAN ABAP SOURCE OBJECT KEYWORDS INTO T_KEYWORDS...etc.
Using the above statement you can have all the keywords in a program into the internal table t_keywords. Try with F1 for more information.
Using SCAN you can even check for INCLUDES and also any Z Function modules using the SEARCH key word in your custom program.
Regards
Sharath
‎2009 Apr 28 10:24 AM
Use the SEARCH statement:
loop at itab.
condense itab-data.
SEARCH ITAB-data for 'search' staring at 0 ending at 5.
if sy-subrc = 0.
write:/ 'Search String found'.
endif.
endloop.Regards,
Ravi Kanth Talagana
‎2009 Apr 28 10:46 AM
hi ravi
i tried with your solution but its covering
len_Search type i,
SELECTION-SCREEN COMMENT 1(25) text170 FOR FIELD c_search.
but my requirement is in particular line if the first word is Search whether it should start with first position or after certain offset position but in that particular line the first word should be Search
‎2009 Apr 28 11:10 AM
PARAMETERS: P_NAME TYPE FNAME.
CONDENSE P_NAME.
TRANSLATE P_NAME TO UPPER CASE.
IF P_NAME+0(6) EQ 'SEARCH'.
WRITE 'Success.'.
else.
write 'Fail.'.
endif.
this code ignores prepadded spaces and tabs.
‎2009 Apr 28 11:47 PM
Hi,
why don't you try the standard abap program RPR_ABAP_SOURCE_SCAN?
This abap is designed to search for ABAP program code/screen flow logic for specific texts.
You can use multi-search string (patterns are allowed) in a program or a program set.
It's very powerful.
Enjoy it.
Kind regards.
Andrea