‎2009 Mar 13 8:16 AM
with the program id as the input can i read the contents of the program ,if so pls let me the logic?
‎2009 Mar 13 8:21 AM
Hi ,
You can use the FM RV_REPORT_READ , to read source code using the program name.
Regards,
Arun
‎2009 Mar 13 8:19 AM
F1 HELP!!!!
READ REPORT prog INTO itab [MAXIMUM WIDTH INTO wid].
‎2009 Mar 13 8:21 AM
Hi ,
You can use the FM RV_REPORT_READ , to read source code using the program name.
Regards,
Arun
‎2009 Mar 13 8:22 AM
i cant understand what u mean by read .
read is used for the reading the contents of an internal table right
what is that report ?
‎2009 Mar 13 10:20 AM
Again F1 help will tell you that in REPORT prog, prog is the name of your program, or as you like to call it, PROGRAM ID.
The source will be read into an internal table.
Uwe's suggestion would be even 'better', or let me put it another way: More 'up to date', since he uses the Object Oriented way or retrieving the source code.
‎2009 Mar 13 8:30 AM
Hello
You can use class CL_WB_SOURCE for your purpose:
DATA:
go_source TYPE REF TO cl_wb_source,
gt_code TYPE TABLE OF string.
CREATE OBJECT go_source
IMPORTING
source_name = '<name of your report>'.
CALL METHOD go_source->get_source_tab
EXPORTING
source = gt_code.
Regards
Uwe
‎2009 Mar 13 10:05 AM
Haii,
Go through this program..its a simple program which searches for a text in entire Report. So ur requirement is almost fulfilled here i guess. You just need to remove the search functionality in this program and thats it.
*********************************
REPORT ZRAMA_BISPIEL.
TABLES: trdir.
PARAMETER : pa_text(30) type c.
SELECT-OPTIONS : so_name FOR trdir-name MATCHCODE OBJECT zsh_example.
data: begin of jtab occurs 0,
line(300),
end of jtab.
data : wa like jtab.
DATA : rata LIKE trdir OCCURS 0 WITH HEADER LINE.
DATA : repid type sy-repid.
DATA : fval type trdir-name.
DATA : cnt type n.
DATA : off type n.
SELECT name FROM trdir INTO rata WHERE name IN so_name.
append rata.
ENDSELECT.
WRITE: /02 'PrgName', 53 'Text',95 'Line No'.
uline.
LOOP AT rata.
read report rata-name into jtab.
jtab-line = rata-name.
append jtab.
search jtab for pa_text.
if sy-subrc = 0.
WRITE : /02 rata-name, 50 pa_text,90 sy-tabix.
endif.
ENDLOOP.
AT LINE-SELECTION.
get cursor value fval.
EDITOR-CALL FOR REPORT fval DISPLAY-MODE.
**************************************************************
Cheers,
r a m a . .
Edited by: newtoAbap on Mar 13, 2009 11:06 AM