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

abap code

Former Member
0 Likes
439

hi i am beginner in sap-abap

so i have a doubt so can any one clarify it.

My requirement is i have to develope a code such that user have to enter the program name (YSAMPLE) and my code should automatically read the lines of code inside the program and should display them is that possible?

2 REPLIES 2
Read only

Former Member
0 Likes
410

Hi,

Try this example:

*parameters : p_report type sy-repid.

Data: begin of itab occurs 10,

line(140),

End of itab.

Read report sy-repid into itab.

itab-line = 'Write / ''Welcome Rico''.'.

append itab.

insert report from itab.

loop at itab.

write / itab.

endloop.

Regards,

Satish

Read only

Former Member
0 Likes
410

Hi below code line will solve your query..

In that code ..p_prog is your program name...

TYPES:
  BEGIN OF type_report,
    field(250) TYPE c,                 " Line Of Report
  END OF type_report.

READ REPORT p_prog INTO i_report.

Just print each line of internal table..

i_report is your internal table..

thanks,

Brijesh