01-26-2008 2:11 PM
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.
01-27-2008 9:13 AM
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
*--
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.
01-26-2008 2:47 PM
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
01-27-2008 9:13 AM
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
*--
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.