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 Report : show commented code in output

former_member624066
Participant
0 Likes
1,257

Hi,

I have to display only commented code as the output.

User will give the program (abap report) name and it should display only commented lines in that program.

Is there any option or command or tcodes that can extract only selected text?

Pls advise.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
818

Run the program below, i hope it suits ur requirement

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE lv_frttl.

PARAMETERS: program LIKE sy-repid.

SELECTION-SCREEN END OF BLOCK b1.

DATA: gt_code(255) TYPE c OCCURS 0,

gv_code LIKE LINE OF gt_code,

gt_code2(255) TYPE c OCCURS 0,

temp like gv_code.

INITIALIZATION.

  • sets the value for the title of the parameters block

lv_frttl = 'Parameter'.

START-OF-SELECTION.

READ REPORT program INTO gt_code.

LOOP AT gt_code INTO gv_code.

if gv_code+0(1) eq '*'.

write:/ gv_code.

endif.

endloop.

Reward points if useful, get back in case of query...

Cheers!!!

3 REPLIES 3
Read only

Former Member
0 Likes
818

Hi

try the fun modules

ABAP_SCAN_DATA_DESCRIPTION

S_ABAP_OBJECTS_SCAN

and try to get the commented lines data and display them

Reward if useful

regards

Anji

Read only

Former Member
0 Likes
818

Hello Suyog

Please develop a program using the following ABAP stmt..

READ REPORT <the rep name entered by user> INTO <Int table>

Loop at internal table and check first character ' * ' or search for ' " ' , if found disply the line...

Hope it helps...

Regards,

Arun

Read only

Former Member
0 Likes
819

Run the program below, i hope it suits ur requirement

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE lv_frttl.

PARAMETERS: program LIKE sy-repid.

SELECTION-SCREEN END OF BLOCK b1.

DATA: gt_code(255) TYPE c OCCURS 0,

gv_code LIKE LINE OF gt_code,

gt_code2(255) TYPE c OCCURS 0,

temp like gv_code.

INITIALIZATION.

  • sets the value for the title of the parameters block

lv_frttl = 'Parameter'.

START-OF-SELECTION.

READ REPORT program INTO gt_code.

LOOP AT gt_code INTO gv_code.

if gv_code+0(1) eq '*'.

write:/ gv_code.

endif.

endloop.

Reward points if useful, get back in case of query...

Cheers!!!