Application Development 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: 

how to get maximum length of the source text

Former Member
0 Kudos

HI

I want to get maximum length of source text (include/ class), is there any FM. If i use READ REPORT ...with MAXIMUM WIDTH syntax i will face run time dump which are non-catchable exceptions where line length is greater than 72 characters.

So i want to collect all the report programs which may lead to dump when using READ REPORT....syntax.

Thanks

Lavanya

4 REPLIES 4

Former Member
0 Kudos

Hi,

I think that only thing You need to do is declare target internal table as a table of string. For me it works also for reports with long lines.

Regards,

Adrian

0 Kudos

HI

Actually i want to collect all reports which may lead to dump from READ REPORT....sytax

0 Kudos

Yes, but I tell You, that none of them will lead to short dump if You will use table of string as a target table. Dump is arised only if length of the longest program line is longer than length of internal table line.

So if You want to find which programs have lines which are longer than 72 chars, You can do it like this:

DATA: gt_names TYPE STANDARD TABLE OF trdir-name,
      gv_name TYPE trdir-name,
      gt_source TYPE TABLE OF string,
      gv_width TYPE i.

SELECT name FROM trdir INTO TABLE gt_names.

LOOP AT gt_name INTO gv_name.
  READ REPORT gv_name INTO gt_source MAXIMUM WIDTH INTO gv_width.
  IF gv_width GT 72.
    WRITE: / gv_name, gv_width.
  ENDIF.
ENDLOOP.

Short dump should never occur here. If I am wrong, please post your code and also a short dump.

Hope it helps.

Adrian

Former Member
0 Kudos

thanks