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: 

Vertical Scroll Bar in Table

Former Member
0 Kudos

Hi,

I created a table control in which users need to make entries. The vertical scroll bar is not appearing. How do I fix this?

Thanks,

Sai.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

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

*--


in TOP include--


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..

Cheers,

Chandra Sekhar.

2 REPLIES 2

Former Member
0 Kudos

Sai sesha,

You can add or remove the scroll bar in the table control by switching off horizontal and vertical scrolling in the properties of the table control. The properties can be accessed from the screen painter by double clicking on the table control. Regarding the page up and page down functions, I believe you add those buttons in the screen layout and code for them. You can use the standard function code for the page up and page down functions.

More over vertical scroll bar will appear if you have enough entries in the table.

Hope this helps

Vinodh Balakrishnan

Former Member
0 Kudos

Hi,

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

*--


in TOP include--


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..

Cheers,

Chandra Sekhar.