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

counting table control rows

Former Member
0 Likes
1,908

hi gurus,

i hv to count the rows of the table control and basing the no. of row i hv to put the loop (do x times).so plz send me the code to count the rows.

thanks & regards,

santosh.

7 REPLIES 7
Read only

Former Member
0 Likes
1,261

in your table control structure there is a field called LINES that tell about total rows in table.

reward if useful

keep rockin

vivek

Read only

Former Member
0 Likes
1,261

HI,

write this somewhere in PAI of the screen

Describe <itab> lines <Variable>.

itab is the table that u passed to table control.

variable has the no of lines.

Cheers,

Will.

Read only

0 Likes
1,261

hi,

i want to giv the valus to the table control at the run time and after that i want to count the rows i'm not getting any value from the internal table.i hv to count the rows first and then i have to populate the internal table.

thanks

Edited by: santosh nayak on Jan 30, 2008 5:34 AM

Read only

0 Likes
1,261

It is not possible first you will have to populate the internal table from any SAP or Z table then calculate the Number of rows and pass the internal table to the table control.

Without populating the data how can you count the no of rows in the internal table. Do you not think it is illogical to count the no of rows in any internal table without populating it.

Read only

0 Likes
1,261

HI,

On any user action(say enter) on the screen PAI of that screen ll be triggered......so u can include a module say 'count' in the PAI of ur screen and write the code(describe........) inside it.....

Cheers,

Will.

Read only

Former Member
0 Likes
1,261

You are passing any internal table to the table control and displaying it.

Put DESCRIBE command on that internal table and you can check the no of rows in the table control.

Read only

Former Member
0 Likes
1,261

Hi,

Usually for table controls,we have limit the lines of table control in the PBO itself.

ie, Descirbe table <itab> lines <tblctrl>-lines.

In your case , if you require no of lines of tblctrl,

take the number of lines of tblctrl in the PAI.

ie,

line = <tblctrl>-lines.

tblctrl = Table control name,

itab = internal table used for populating data in table control

line = variable of type i.