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: 

Table Control Scroll Bar inactive

Former Member
0 Kudos

Hi All,

I am facing a strange problem. I have placed a table control on my screen and have added the columns. Rest of the functionality is also fine. However, even when the number of rows in the table exceeds its height, the Vertical Scroll bar is inactive and I cannot scroll down to the hidden line items. The horizontal scroll bar is working perfectly.The color of the Vertical Scroll bar is also Dark grey (as in inactive.)

I fail to understand what could be the reason for this? Helpful answers will be suitably rewarded

Regards,

Madhur

1 ACCEPTED SOLUTION

hymavathi_oruganti
Active Contributor
0 Kudos

u might have defined a table control with controls statement like this rt!!

CONTROLS ..........tc1

let TC1 be the name. u might have given another name.

in PBO, code like this.

select the total number of records which u r outputting.

now.<b>

TC1-LINES = SY-DBCNT</b>

the bolded statement is important. this statement informs the table control about the total number of lines.

5 REPLIES 5

hymavathi_oruganti
Active Contributor
0 Kudos

u might have defined a table control with controls statement like this rt!!

CONTROLS ..........tc1

let TC1 be the name. u might have given another name.

in PBO, code like this.

select the total number of records which u r outputting.

now.<b>

TC1-LINES = SY-DBCNT</b>

the bolded statement is important. this statement informs the table control about the total number of lines.

0 Kudos

Hi Guys,

Thanks a ton. It's working perfectly now. Thanks for the info. I am rewarding full points to Hymavathi since his answer was not only the first correct one, but also the most concise one.

Thanks again guys,

Regards,

Madhur

Former Member
0 Kudos

Hi,

Normally the controls are declared with CONTROLS stmt and lines are set in PBO.

CONTROLS: <table> TYPE TABLEVIEW USING SCREEN 2100.

check it...

Former Member
0 Kudos

Hi,

Hope u have done this:

In PBO:

MODULE Get_vbar.

In Logic:

MODULE get_vbar OUTPUT.
   tctrl_cont_items-lines = 100.
   tctrl_cont_items-v_scroll = 'X'.
ENDMODULE.

Best Regards,

Anjali

Former Member
0 Kudos

Hi Madur,

Try this code :

(assume that the name of your table control is T1)

In the screen logic you will have:

Loop with control T1.

.

module get_Looplines.

Endloop.

Module get_looplines.

Looplines = sy-loopc.

Endmodule.

In the PBO of the screen you will have a module that loads the itab and determines the total number of lines read.

Module load_itab.

. (select database table and

append to itab)

.

describe table itab lines linecount.

Endmodule.

We now have all the values to construct a scroll module.

MODULE SCROLL INPUT.

CASE SAVE_OK_CODE.

WHEN 'P--'.

T1-TOP_LINE = 1.

WHEN 'P-'.

T1-TOP_LINE = T1-TOP_LINE - LOOPLINES.

IF T1-TOP_LINE < 1.

T1-TOP_LINE = 1.

ENDIF.

WHEN 'P+'.

T1-TOP_LINE = T1-TOP_LINE + LOOPLINES.

IF T1-TOP_LINE > LINECOUNT.

T1-TOP_LINE = LINECOUNT - LOOPLINES + 1.

ENDIF.

WHEN 'P++'.

T1-TOP_LINE = LINECOUNT - LOOPLINES + 1.

ENDCASE.

ENDMODULE. " SCROLL INPUT

WHEN 'P--'.

CLEAR SY-UCOMM.

CTR1-TOP_LINE = 1.

WHEN 'P-'.

CLEAR SY-UCOMM.

CTR1-TOP_LINE = CTR1-TOP_LINE - LINECOUNT1.

IF CTR1-TOP_LINE < 1.

CTR1-TOP_LINE = 1.

ENDIF.

WHEN 'P+'.

DESCRIBE TABLE ITAB1 LINES N1.

CTR1-TOP_LINE = CTR1-TOP_LINE + LINECOUNT1.

IF CTR1-TOP_LINE > N1.

CTR1-TOP_LINE = N1.

ENDIF.

CLEAR SY-UCOMM.

WHEN 'P++'.

DESCRIBE TABLE ITAB1 LINES N1.

CLEAR SY-UCOMM.

CTR1-TOP_LINE = N1.

Cheers

Sunny

Rewrd points, if helpful