03-01-2006 6:11 AM
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
03-01-2006 6:17 AM
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.
03-01-2006 6:17 AM
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.
03-01-2006 7:00 AM
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
03-01-2006 6:18 AM
Hi,
Normally the controls are declared with CONTROLS stmt and lines are set in PBO.
CONTROLS: <table> TYPE TABLEVIEW USING SCREEN 2100.
check it...
03-01-2006 6:27 AM
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
03-01-2006 6:38 AM
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