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

Scan Report pogram

Former Member
0 Likes
1,292

Hi Friends,

I have requirement where i need yo find all the internal table declarations in my programe and check whether they start with it_.

Thanks,

Urmila.T

1 ACCEPTED SOLUTION
Read only

former_member209217
Active Contributor
0 Likes
1,262

Hi,

Use this statement for getting all declarations and keywords used in a report


SCAN ABAP-SOURCE         report
    TOKENS           INTO        tokens_all
    STATEMENTS  INTO        statements
    LEVELS            INTO        levels
    KEYWORDS     FROM      keywords
    WITH ANALYSIS

Regards,

Lakshman.

Edited by: Lakshman N on Oct 29, 2009 8:15 AM

11 REPLIES 11
Read only

Former Member
0 Likes
1,262

So whats your question here? Except manually scanning the program i dont think there is any other way

Read only

former_member209217
Active Contributor
0 Likes
1,263

Hi,

Use this statement for getting all declarations and keywords used in a report


SCAN ABAP-SOURCE         report
    TOKENS           INTO        tokens_all
    STATEMENTS  INTO        statements
    LEVELS            INTO        levels
    KEYWORDS     FROM      keywords
    WITH ANALYSIS

Regards,

Lakshman.

Edited by: Lakshman N on Oct 29, 2009 8:15 AM

Read only

Former Member
0 Likes
1,262

READ REPORT... is the statement used to read the contents of ur program into an internal table.Press F1 on it for syntax and documentation.

Now loop that internal table and for each line check whether it conatins the string(CS) type standard table of... if so the check whether the internal table name begins with it_ or not for this u can split that particular line at space into different variables or any internal table and then u can check it.

Regards,

Shafivullah Mohammad

Read only

GauthamV
Active Contributor
0 Likes
1,262

Use program RPR_ABAP_SOURCE_SCAN and SEARCH for the string you required.

Read only

Sm1tje
Active Contributor
0 Likes
1,262

and how would you specify that it has to look for internal tables NOT starting with 'IT_'?

Read only

Former Member
0 Likes
1,262

Thats why even i dint suggest RPR_ABAP_SOURCE_SCAN. Lets see what Gautam has to say

Read only

former_member222860
Active Contributor
0 Likes
1,262

Use this Report:

RPR_ABAP_SOURCE_SCAN

Read only

Former Member
0 Likes
1,262

Internal tables data declarations start with "begin of"or have a statement with "occurs" in the data declaration.

You can scan your report(s) on those statements.

regards, Léon Hoeneveld

Read only

0 Likes
1,262

Not if you first declare table types and then declare the internal tables referencing the table types.

What the OP wants to do might be covered by the code inspector naming convention check, tx SCI.

Thomas

Read only

Former Member
0 Likes
1,262

report RS_ABAP_SOURCE_SCAN

Read only

matt
Active Contributor
0 Likes
1,262

As Thomas pointed out:

Use the code inspector