‎2010 Aug 18 9:52 AM
Hi All,
I need to control the number records in table control.
For example: if 20 records ..only 20records have to show.if 4 records need to show only four records.
Now its showing same number of rows irrespective of the records.i.e when i scroll down its goes on showing empty rows.
Please help on this.
Thank You,
Anu.
‎2010 Aug 18 10:02 AM
Hi Anitha,
In the PBO in one of your PBO module , you should pass the SY-DBCNT to the table control lines.
Just have a look at the below code :-
SET PF-STATUS 'MY_MENU'.
SET TITLEBAR 'ZMY_TITLE'.
SELECT * FROM zreaders INTO TABLE itab.
MOVE-CORRESPONDING itab TO zreaders.
SORT itab BY readerid descending.
tc-lines = sy-dbcnt
Here TC is the table control name :
CONTROLS tc TYPE TABLEVIEW USING SCREEN 0100.Hope this solves your query.
Regards
Abhii
‎2010 Aug 18 10:02 AM
Hi Anitha,
In the PBO in one of your PBO module , you should pass the SY-DBCNT to the table control lines.
Just have a look at the below code :-
SET PF-STATUS 'MY_MENU'.
SET TITLEBAR 'ZMY_TITLE'.
SELECT * FROM zreaders INTO TABLE itab.
MOVE-CORRESPONDING itab TO zreaders.
SORT itab BY readerid descending.
tc-lines = sy-dbcnt
Here TC is the table control name :
CONTROLS tc TYPE TABLEVIEW USING SCREEN 0100.Hope this solves your query.
Regards
Abhii
‎2010 Aug 18 10:18 AM
tbctrl-lines = lines( itab ).
Set this property just after itab is populated.
‎2010 Aug 18 10:50 AM
Hi
Suppose you have the data in you internal table.
write this in PBO:
describe table itab lines count.
where itab is your internal table and count is a variable of type integer.
this statement will fetch the total lines of your internal table itab in variable count.
assign this count to tc-lines as below.
tc-lines = count.
TC means table control name.
it will allocate line to your table control for total number of line in your internal table.
But your table control will have the blank lines.
condition 1:
suppose your table control's widthis for 10 lines and you have 3 records so your table control will show remaining 7 lines.
and if you have 29 records then your table control will allow you to scroll and will show 29 records and 1 blank line which will not be in editable mode.
Condition 2:
if you have created a Table control as editable then it will show you remaining line because what if user wants to put some value in the table control.
So in Any case it will show you the blank lines.
I hope this will work for you.
Thanks
Lalit