Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Program that searches code statements in Z programs

Former Member
0 Likes
2,520

Hi gurus,

Im wrting a program that search in all Z programs a certain statement, like all programs that have the Call Transaction statement but im facing dificulties to know the tables where the code of a programa is.

Is there anyway to get this? can i actually get a code from a program in a standart table?

Thanks in advance,

Best Regards,

João Martins

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
1,569

For this already have a standard program

RPR_ABAP_SOURCE_SCAN

I think this will solve your problem

a®

7 REPLIES 7
Read only

Former Member
0 Likes
1,569

Please press F1 on READ REPORT.

Rob

Read only

former_member194669
Active Contributor
0 Likes
1,570

For this already have a standard program

RPR_ABAP_SOURCE_SCAN

I think this will solve your problem

a®

Read only

GauthamV
Active Contributor
0 Likes
1,569

You can use RPR_ABAP_SOURCE_SCAN program to search for any string in all programs.

Read only

Former Member
0 Likes
1,569

Hi ,

try this..

RSRSCAN1 -- to find a string or comment or source code contains text in the reports and their includes

or

RPR_ABAP_SOURCE_SCAN - Scan ABAP Report Sources

Prabhudas

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,569

2 more :

program RS_ABAP_SOURCE_SCAN : exists in basis 7.0

program AFX_CODE_SCANNER : exists in basis 7.0

Note:

program RPR_ABAP_SOURCE_SCAN : does NOT exist in basis 7.0 (supplied in ECC?)

program RSRSCAN1: exists in basis 7.0 but will dump if some sources have lines wider than 72 characters

Read only

0 Likes
1,569

fetch all z* names from trdir.

select * from trdir 
            where name like 'Z%' ."check the field name in trdir as i am not infront of sap now

now 
loop at itab into is.
read report is-name into itab2. "you can search your line in this itab2 with read statement on itab2.

endloop

Read only

_IvanFemia_
Active Contributor
0 Likes
1,569

Hi,

you can use the report RPR_ABAP_SOURCE_SCAN as suggested, but if you need more computing and manage the result witha Z program you could take a look to the code below

This example retrieve all the occurrence of INCLUDE statement in a report source code.

READ REPORT IP_REPONAME INTO SOURCE.
  gt_kw = 'INCLUDE'.
  APPEND gt_kw.
  SCAN ABAP-SOURCE SOURCE TOKENS      INTO gt_tk
                          STATEMENTS  INTO gt_stm
*                          OVERFLOW    INTO OVERFLOW_AREA
       KEYWORDS FROM gt_kw
       PROGRAM  FROM IP_REPONAME
*       INCLUDE PROGRAM  FROM IP_REPONAME
       MESSAGE  INTO MESS
       WITHOUT TRMAC
*       WITH INCLUDES
       WITH ANALYSIS.

This solve your issue

Regards,

Ivan