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

How to search a term in the source code

Former Member
0 Likes
844

Hello ,

How to search a term in the source code. I have selection screen , on which a program name will be given and term to search. How can I proceed to know whether this term is available in the source code of the program

Thanks and regards,

Satya

Hello ,

How to search a term in the source code. I have selection screen , on which a program name will be given and term to search. How can I proceed to know whether this term is available in the source code of the program

Thanks and regards,

Satya

5 REPLIES 5
Read only

Former Member
0 Likes
791

Hi

You can use the command

SCAN ABAP-SOURCE < Program name> tokens into itab

statements into itab1..

or use the fun module

RPR_ABAP_SOURCE_SCAN

Reward points if useful

Regards

Anji

Message was edited by:

Anji Reddy Vangala

Read only

Peter_Inotai
Active Contributor
0 Likes
791

You can also use Code Inspector for searching.

Peter

Read only

0 Likes
791

Hi Peter,

I'm new to code inspector.

According to the documentation I can create a variant and in the 'Search Functs.' ---> 'Search ABAP Statement Patterns' I specified FOR ALL ENTRIES

When I execute the code inspector for an ABAP that contains the text FOR ALL ENTRIES it does NOT return any information.

How is this suppossed to work?

Thanks.

Soyab

[email protected]

Read only

Former Member
0 Likes
791

use the following syntax

SCAN ABAP-SOURCE int_abap_source

TOKENS INTO l_tokens

STATEMENTS INTO l_statements

STRUCTURES INTO l_structures

KEYWORDS FROM l_keywords

OVERFLOW INTO l_overflow.

Read only

Former Member
0 Likes
791

Hi naga,

1. one option is to retrive the source code of the requried program,

into internal table using the syntax READ REPORT (just see f1 help on it)

READ REPORT prog INTO itab [MAXIMUM WIDTH INTO wid].

2. Then we can loop / search the internal table for the required term.

regards,

amit m.