‎2008 Aug 26 11:49 AM
Hi Everybody ,
I have Program name and a string , Is there any function module to find that string in that particular Program.
If FM doesnot exists any alternative ?
Regards ,
raju.
‎2008 Aug 26 12:04 PM
Do you need a FM for this? There is a standard report which does the search: RS_ABAP_SOURCE_SCAN
‎2008 Aug 26 11:52 AM
Hi,
Please Try below function kodule:AA_CUS_SCAN_PROG_FOR_STRING
regards
jana
‎2008 Aug 26 11:57 AM
‎2008 Aug 26 12:00 PM
‎2008 Aug 26 12:01 PM
Hi Raju ,
I am not sure about function module but there is a statement to do this.
TYPES: BEGIN OF T_TYPE,
LINE(72),
END OF T_TYPE.
DATA: PROGRAM LIKE SY-REPID VALUE 'PROGNAME',
T TYPE STANDARD TABLE OF T_TYPE WITH
NON-UNIQUE DEFAULT KEY INITIAL SIZE 500.
READ REPORT PROGRAM INTO T.
IF SY-SUBRC <> 0.
...
ENDIF.
Now Internal table T has entire code of program.
Then using keyword find you can know wheather that string is present in that particular program.
Hope this will help you.
‎2008 Aug 26 12:08 PM
I understood what u said but i need the functonaliy just like WHERE_USED LIST.
So it should highlight the string wherever it occurs.
‎2008 Aug 26 12:01 PM
Hi,
AA_CUS_SCAN_PROG_FOR_STRING*" IMPORTING
*" REFERENCE(ID_STRING1) " string
*" REFERENCE(ID_STRING2) OPTIONAL
*" REFERENCE(ID_PROGRAM) TYPE REPID OPTIONAL " program name
*" EXPORTING
*" REFERENCE(EF_FOUND)
*" TABLES
*" IT_PROGRAM
*" ET_CODING OPTIONALRegards
Adil
‎2008 Aug 26 12:04 PM
‎2008 Aug 26 12:04 PM
Do you need a FM for this? There is a standard report which does the search: RS_ABAP_SOURCE_SCAN
‎2008 Aug 26 2:22 PM
Thanks Micky ,
What u hve given is rite but we need to prepare BDC for that so for my requirement i shudnt do tht...so only i need FM.
If u can tell me.
‎2008 Aug 26 12:04 PM
Hi,
Use this code for searching string in the program
TYPES: BEGIN OF T_TYPE,
LINE(80),
END OF T_TYPE.
DATA: T TYPE STANDARD TABLE OF T_TYPE WITH
NON-UNIQUE DEFAULT KEY,
WA_T TYPE T_TYPE.
MOVE 'Alaska Texas ' TO WA_T.
APPEND WA_T TO T.
MOVE 'California Arizona ' TO WA_T.
APPEND WA_T TO T.
SEARCH T FOR '*ONA' AND MARK.
‎2008 Aug 26 12:12 PM
Hi Raju,
Check this code sample By Amit Jain, to find a string in a selected programs:
The following function module helps in search of a string in all programs existing in an environment.
RPR_ABAP_SOURCE_SCAN
Regards,
Chandra Sekhar
‎2008 Aug 26 12:14 PM
‎2008 Aug 26 12:20 PM
Hi,
Use this Function Module AA_CUS_SCAN_PROG_FOR_STRING. I have tried this. It gives the line numbers of the string also.