‎2008 Feb 01 6:05 AM
Hi all,
how to create the vertical scroll bar in the table control.....i want steps or a sample example of it...plzz
‎2008 Feb 01 6:11 AM
You have to write a PAI module and a PF status which has 4 function codes for example ..'PGDO', 'PGUP', 'PGLA', 'PGFI' ...
*----
MODULE scroll INPUT.
XCODE = OK_CODE.
CASE xcode.
WHEN 'PGDO'. "one page down
offset = tabcontrl-lines - step_lines.
IF tabcontrl-top_line LT offset.
tabcontrl-top_line = tabcontrl-top_line + step_lines.
ENDIF.
WHEN 'PGUP'. "one page up
offset = step_lines.
IF tabcontrl-top_line GT offset.
tabcontrl-top_line = tabcontrl-top_line - step_lines.
ELSE.
tabcontrl-top_line = 1.
ENDIF.
WHEN 'PGLA'. " last page
tabcontrl-top_line = tabcontrl-lines - step_lines + 1.
WHEN 'PGFI'. " first page
tabcontrl-top_line = 1.
ENDCASE.
ENDMODULE. " SCROLL INPUT
*--
CONTROLS: tabcontrl TYPE TABLEVIEW
USING SCREEN '9000'.
*----
where step_lines is
step_lines = sy-loopc. " lines visible in the table
You have to write MODULE SCROLL in PAI anywhere. It should be a PAI module that's all. For assigning sy-loopc to step_lines ( an integer type), you write it in PBO module that too:
*----
LOOP AT itab1 WITH CONTROL tabcontrl CURSOR TABCONTRL-CURRENT_LINE.
MODULE ITAB_TO_SCREEN.
MODULE lines .
ENDLOOP.
*----
This 'MODULE lines' is a PBO module in which u can assign step_lines = sy-loopc.
Reward points if found helpfull..
‎2008 Feb 01 6:09 AM
write the following code in PBO
MODULE SET_LINES OUTPUT.
DATA VLINES TYPE I.
DESCRIBE TABLE ITABCTL LINES VLINES.
TABCTL-LINES = VLINES + 1.
ENDMODULE. " set_lines OUTPUT
here ITABCTL is the internal table being displayed on Table control TABCTL.
‎2008 Feb 01 6:11 AM
You have to write a PAI module and a PF status which has 4 function codes for example ..'PGDO', 'PGUP', 'PGLA', 'PGFI' ...
*----
MODULE scroll INPUT.
XCODE = OK_CODE.
CASE xcode.
WHEN 'PGDO'. "one page down
offset = tabcontrl-lines - step_lines.
IF tabcontrl-top_line LT offset.
tabcontrl-top_line = tabcontrl-top_line + step_lines.
ENDIF.
WHEN 'PGUP'. "one page up
offset = step_lines.
IF tabcontrl-top_line GT offset.
tabcontrl-top_line = tabcontrl-top_line - step_lines.
ELSE.
tabcontrl-top_line = 1.
ENDIF.
WHEN 'PGLA'. " last page
tabcontrl-top_line = tabcontrl-lines - step_lines + 1.
WHEN 'PGFI'. " first page
tabcontrl-top_line = 1.
ENDCASE.
ENDMODULE. " SCROLL INPUT
*--
CONTROLS: tabcontrl TYPE TABLEVIEW
USING SCREEN '9000'.
*----
where step_lines is
step_lines = sy-loopc. " lines visible in the table
You have to write MODULE SCROLL in PAI anywhere. It should be a PAI module that's all. For assigning sy-loopc to step_lines ( an integer type), you write it in PBO module that too:
*----
LOOP AT itab1 WITH CONTROL tabcontrl CURSOR TABCONTRL-CURRENT_LINE.
MODULE ITAB_TO_SCREEN.
MODULE lines .
ENDLOOP.
*----
This 'MODULE lines' is a PBO module in which u can assign step_lines = sy-loopc.
Reward points if found helpfull..
‎2008 Feb 01 6:14 AM
Hi,
in order to get the vertical scroll bar you just need to write the code below in your PBO of the screen.
data : N type I.
<itab is the internal table being passed to the table control>
<tabctrl> is the name of the table control being created on your screen.
describe table itab lines N.
<tabctrl>-lines = N.
This will dynamically change the number of lines of the table control. If you hardcode it only that many number of lines will be displayed in the table control.
Regards,
Satish
‎2008 Feb 01 7:30 AM
Hi,
use like:
tabcntrl-lines = sy-tfill + 1.
Regards,
Renjith Michael.
‎2008 Feb 03 10:17 AM
Hi Frns
As we know Table control comes by default with a vertical scroll bar, so we need to juss enable it , to do this , juss add a simple statement in PBO's Module - Endmodule
CONTROL-LINES = SY-DBCNT.
Hope this would solve your query, if helpful & really useful reward points.
Thanks & Regards
RK Nimma
‎2008 Mar 12 6:45 AM
in the trans se83 you get the example progs for this ..... checkout
Santhosh
‎2008 Mar 12 6:48 AM