2009 Aug 27 9:56 AM
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,
You can use DESCRIBE statement in the PBO
DESCRIBE TABLE t_header1 LINES lv_lines.
<tabcontrolname>-lines = lv_lines + 20.
2009 Aug 27 10:06 AM
Hi,
You can use DESCRIBE statement in the PBO
DESCRIBE TABLE t_header1 LINES lv_lines.
<tabcontrolname>-lines = lv_lines + 20.
2009 Aug 28 5:35 AM
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......
2009 Aug 28 5:36 AM
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......
2009 Aug 28 6:31 AM
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
2009 Aug 27 10:09 AM
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.
2009 Aug 27 10:10 AM
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
2009 Aug 27 10:20 AM
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
2009 Aug 27 10:22 AM
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |