‎2007 Jun 06 2:01 PM
hi
I am trying to create a ZProgram A which will scan the code of another Z program B and check whether code standards are maintained in it or not.
So for this I need to copy the source code of Z Program B into Z Program A's internal table.
Can you help me how to get the source code into an internal table, I mean how to read it.
All helpful answers will be rewarded
‎2007 Jun 06 2:04 PM
‎2007 Jun 06 2:04 PM
‎2007 Jun 06 2:04 PM
Hello,
Do like this:
Regards,
Vasanth
DATA itab TYPE string OCCURS 0 WITH HEADER LINE.
READ REPORT <prog> INTO itab.
LOOP AT itab.
IF sy-tabix = 25.
EXIT.
ELSE.
WRITE:/ itab.
ENDIF.
ENDLOOP.
‎2007 Jun 06 2:05 PM
Hi,
Please check program RPR_ABAP_SOURCE_SCAN for logic to read source code.
Regards,
Ferry Lianto
‎2007 Jun 06 2:05 PM
Use
READ REPORT prog INTO itab.
Reads the program prog from the database into the internal table itab. The line length of table itab should be at least 72 characters
‎2007 Jun 06 2:05 PM
‎2007 Jun 06 2:06 PM
Hi
Use the command
SCAN ABAP-SOURCE <PROGRAMNAME> TOKENS INTO ITAB2
STATEMENTS INTO ITAB3...
OR TRY THE FUN MODULE
RPR_ABAP_SOURCE_SCAN
Reward points for useful Answers
Regards
Anji
‎2007 Jun 06 2:08 PM
‎2007 Jun 06 2:30 PM
‎2007 Jun 06 2:13 PM