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

Table control

Former Member
0 Likes
1,051

HI,

I working on MP.i'm using Table control.i wants to restrict the no of rows of the table control to 20.so that we can scroll down upto 20 rows only,any way? plz suggest.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,022

In PBO

MODULE FIX_TC_LINES.

Coding:

TC-LINES = 20. " Where TC is table control name

Done!!!

11 REPLIES 11
Read only

Former Member
0 Likes
1,022

Please search.

[Table Controls: Examples with Scrolling|http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbac9f35c111d1829f0000e829fbfe/frameset.htm]

Read only

Former Member
0 Likes
1,022

Hi,

I have one doubt:

Do you only want to display the first 20 records or

you want to see 20 records in the table view and after the first 20 records, you need to use scroll down to see the rest?

Regards,

Chris Gu

Read only

0 Likes
1,022

HI Chris,

thanks for the reply, i need only 20 records to be in table control.and the size of the TC is small as u can see only 5 rec at a time and scroll upto 20 records only.hope you got it.

Read only

Former Member
0 Likes
1,022

Hi,

Another question, if you only want to display 20 records, then you have to omit the rest ones, will it affect your program?

If not, then a easy way, you delete the records from the internal table , just like:

delete itab from 20. " this means delete records from line 20, so that you can get only 20 records

then in the tableview, only 20 records will be displayed.

If you have condition about these 20 records, please let me know.Maybe that solution will not work.

Regards,

Chris Gu

Read only

0 Likes
1,022

hi i will displaying only 20 records in the TC.now i am able to see blank and non editable columns also when i scroll further.i wants to restrict that Tc should not be scrollable after 20 columns

Read only

Former Member
0 Likes
1,022

Hi,

Do this way:---



*---data declarations for table control
CONTROLS: tab_cnt1 TYPE TABLEVIEW USING SCREEN '0310'.
DATA: w_ln TYPE i.

MODULE get_t_ctrl_lines OUTPUT.
  DESCRIBE TABLE it_mast LINES w_ln.
*TO MAKE VERTICAL SCROLL BAR TO COME ON RUN TIME
  tab_cnt1-lines = w_ln + 20.
ENDMODULE.                 " get_t_ctrl_lines  OUTPUT

Thanks & Regards,

Krishna..

Read only

Former Member
0 Likes
1,023

In PBO

MODULE FIX_TC_LINES.

Coding:

TC-LINES = 20. " Where TC is table control name

Done!!!

Read only

Former Member
0 Likes
1,022

Hi Kiran,

Please note my understanding is correct

if you want to display only 20 records irrespective of number of records available. then

in PBO

tc-lines = 20.

regards

Ramchander Rao.K

Read only

0 Likes
1,022

HI Chandra,

i had done this also as it is not working.after the 20th record it will be in non-editable mode and can be scrollable.i just wants the TC to be not viewable or not scrollable after 20.

Read only

Former Member
0 Likes
1,022

MODULE FIX_TC_LINES.

Coding:

DELETE ITAB FROM 21.

" This will make sure that only 20 records are there in ITAB which is the internal table whose data is to be displayed

DESCRIBE TABLE ITAB LINES TC-LINES.

Done!!!

Read only

former_member632729
Contributor
0 Likes
1,022

HI,

At PBO level you have to change the size what ever u want , if ur want to get only 20 rows at a time then u have to set in PBO.