Skip to Content
0
Former Member
Jul 30, 2009 at 09:21 AM

Read Report

32 Views

Dear All,

I have a requirement where i need to read the source code of a report into an internal table along with the line number.

We have READ REPORT programname INTO tablename but in this case i will get only the source code.

Ex : If the source code of programname is

       DATA : a TYPE c,                               
              b TYPE c,                               
              c TYPE c.                               
       a = 'A'.                                       
       b = 'B'.                                       
       CONCATENATE a b INTO C.                        
       WRITE: c.                                      

If i do a read report for the above program i will get output in my table as

       TEXT                                          LINENO
       DATA : a TYPE c,                               
              b TYPE c,                               
              c TYPE c.                               
       a = 'A'.                                       
       b = 'B'.                                       
       CONCATENATE a b INTO C.                        
       WRITE: c.                                      

What i need is something like the below.

       TEXT                                          LINENO
       DATA : a TYPE c,                               1
              b TYPE c,                               2
              c TYPE c.                               3
       a = 'A'.                                       4
       b = 'B'.                                       5
       CONCATENATE a b INTO C.                        6
       WRITE: c.                                      7

I dont want to do a loop and add line numbers to each line as it may take time when the souce code is large.

Thanks,

Hari Prasad