Application Development and Automation 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: 
Read only

scroll bar in table control

Former Member
0 Likes
1,022

hi

I need to make the vertical scroll bar of table control to work. I tried a lot but it is not working.

my codings:

in pbo:

LOOP WITH CONTROL TCK1 .

MODULE FILL_TABLE_CONTROL .

where TCK1 is table control name.

in pai :

LOOP WITH CONTROL TCK1 .

MODULE READ_TABLE_CONTROL .

i also tried some code of already given answers in sdn pls help me and say what is the coding in pob and pai.

hi

I need to make the vertical scroll bar of table control to work. I tried a lot but it is not working.

my codings:

in pbo:

LOOP WITH CONTROL TCK1 .

MODULE FILL_TABLE_CONTROL .

where TCK1 is table control name.

in pai :

LOOP WITH CONTROL TCK1 .

MODULE READ_TABLE_CONTROL .

i also tried some code of already given answers in sdn pls help me and say what is the coding in pob and pai.

8 REPLIES 8
Read only

Former Member
0 Likes
972

Hi,

You can use DESCRIBE statement in the PBO


   DESCRIBE TABLE t_header1 LINES lv_lines.
   <tabcontrolname>-lines = lv_lines + 20.

Read only

0 Likes
972

hi

thanks for ur answer but when i use this statement in pbo i am getting the error as statement describe is not defined check your spelling what to do now......

Read only

0 Likes
972

hi

thanks for ur answer but when i use this statement in pbo i am getting the error as statement describe is not defined check your spelling what to do now......

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
972

Hi,

It will work fine. There seems no reason for getting such error message.

Try using this code in PBO:-


PROCESS BEFORE OUTPUT.
  MODULE status_screen.

  LOOP WITH CONTROL tck1.
    MODULE fill_table_control.
  ENDLOOP


MODULE status_screen.
  DATA lv_lines TYPE i.

  DESCRIBE TABLE it_final "<--your internal table
  LINES lv_lines.

  tck1-lines = lv_lines + 20.
ENDMODULE.

Hope this helps you.

Thanks & Regards,

Tarun

Read only

Former Member
0 Likes
972

Hi Priya,

in your pbo module,

<tablecontrolname>-lines = '200'.----


>give your table control name - lines

your scroll bar will come give number more than 20 then you can able to see your scroll bar.

Read only

Former Member
0 Likes
972

HI, try to use this logic

PROCESS BEFORE OUTPUT.

*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TC_TG'

MODULE tc_tg_change_tc_attr.

*&SPWIZARD: MODULE TC_TG_CHANGE_COL_ATTR.

LOOP AT gt_contacts

INTO gs_contacts

WITH CONTROL tc_tg

CURSOR tc_tg-current_line.

MODULE tc_tg_get_lines.

MODULE TC_TG_CHANGE_FIELD_ATTR

ENDLOOP.

MODULE status_0100.

PROCESS AFTER INPUT.

*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TC_TG'

LOOP AT gt_contacts.

CHAIN.

FIELD gs_contacts-partner.

FIELD gs_contacts-name_first.

FIELD gs_contacts-name_last.

MODULE tc_tg_modify ON CHAIN-REQUEST.

ENDCHAIN.

FIELD gs_contacts-seq

MODULE tc_tg_mark ON REQUEST.

ENDLOOP.

MODULE tc_tg_user_command.

MODULE get_partner_names.

*&SPWIZARD: MODULE TC_TG_CHANGE_TC_ATTR.

*&SPWIZARD: MODULE TC_TG_CHANGE_COL_ATTR.

MODULE exit_command_0100 AT EXIT-COMMAND.

MODULE user_command_0100.

MODULE tc_tg_get_lines OUTPUT.

g_tc_tg_lines = sy-loopc.

ENDMODULE. "TC_TG_GET_LINES OUTPUT

Read only

0 Likes
972

Hi Priya ,

Try using this,

move the records number of your internal table into field LINES of tablecontrol. for example create a new module:

PROCESS PBO

MODULE SET_DATA_TO_T_CTRL.

LOOP..

ENDLOOP.

MODULE SET_DATA_TO_T_CTRL.

DESCRIBE TABLE ITAB LINE SY-TABIX.

<TABLECONTROL>-LINES = SY-TABIX.

ENDMODULE

Thanks ,

Ruchi

Read only

Former Member
0 Likes
972

Hi,

Page by page scrolling, the number of rows to be scrolled during the loop pass can be taken from the system field SY-LOOPC.

Please go through the below code for your reference.

REPORT ZTEST.

CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.

DATA: ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

DATA: itab TYPE TABLE OF demo_conn,

fill TYPE i.

TABLES demo_conn.

DATA: lines TYPE i,

limit TYPE i.

SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.

CALL SCREEN 100.

MODULE status_0100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

DESCRIBE TABLE itab LINES fill.

flights-lines = fill.

ENDMODULE.

MODULE fill_table_control OUTPUT.

READ TABLE itab INTO demo_conn INDEX flights-current_line.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE read_table_control INPUT.

lines = sy-loopc.

MODIFY itab FROM demo_conn INDEX flights-current_line.

ENDMODULE.

MODULE user_command_0100 INPUT.

save_ok = ok_code.

CLEAR ok_code.

CASE save_ok.

WHEN 'NEXT_LINE'.

flights-top_line = flights-top_line + 1.

limit = fill - lines + 1.

IF flights-top_line > limit.

flights-top_line = limit.

ENDIF.

WHEN 'PREV_LINE'.

flights-top_line = flights-top_line - 1.

IF flights-top_line < 0.

flights-top_line = 0.

ENDIF.

WHEN 'NEXT_PAGE'.

flights-top_line = flights-top_line + lines.

limit = fill - lines + 1.

IF flights-top_line > limit.

flights-top_line = limit.

ENDIF.

WHEN 'PREV_PAGE'.

flights-top_line = flights-top_line - lines.

IF flights-top_line < 0.

flights-top_line = 0.

ENDIF.

WHEN 'LAST_PAGE'.

flights-top_line = fill - lines + 1.

WHEN 'FIRST_PAGE'.

flights-top_line = 0.

ENDCASE.

ENDMODULE.