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

Record count in report

Former Member
0 Likes
1,308

Hi Abaper,

Can any one help me how to calculate number of record display in report.

Thanks & Regards,

Amit

Hi Abaper,

Can any one help me how to calculate number of record display in report.

Thanks & Regards,

Amit

7 REPLIES 7
Read only

naveen_inuganti2
Active Contributor
0 Likes
1,107

Hi,

Just write the describe statement on output internal table.

ie.

data: lv_count(4) type n.

describe table <itab> lines lv_count.

__Naveen Inuganti

Read only

Former Member
0 Likes
1,107

Sy-index for the output loop. Describe statment will also work

Edited by: Phanindra Annaparthi on Feb 27, 2009 8:06 AM

Read only

former_member242255
Active Contributor
0 Likes
1,107

you can describe the internal table that you are using for output and write the no of records ..

regards,

sravan

Read only

Former Member
0 Likes
1,107

you can use DESCRIBE statement to find no of records in the table.

Regards,

Joan

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,107

Hi,

Use:-


data : line_count type i.

describe <itab>
lines line_count.
"line_count will hold the total number of records in internal table

Or you can also use:-


data : total type i.

END-OF-SELECTION.
  loop at <itab>.
    write : / <itab>-<field1>, <itab>-<field2>, <itab>-<field3>. "and so on
    total = total + 1.
  endloop.
  
  write : / total.  "total no of records displayed

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
1,107

Hi,

This is very simple, you can do by 2 ways,

1.

DESCRIBE TABLE <table name> LINES <var of type i>.

or

2.Read the records into an intrenal table.

then

loop at internal tbale
var = var+1.
endloop.

write: var "this will give you total records.

Hope this will help you.

Pooja

Read only

Former Member
0 Likes
1,107

thanks.