11-23-2005 1:17 AM
Hi,
I have a screen and having one table control.Iam doing some modifications after loading the screen.
Can any one tell me how to refresh table control?
points guaranteed
cheers
kaki
11-23-2005 1:21 AM
just refresh the internal table associated to the table control. So in PBO when it is trying to load the records from internal table to the table control, it will not have any records so it will be blank.
The basic concept behind table control is In the PBO it will load the records from internal table and in the PAI it will load back the updated records into internal table. So, if you make internal table empty it will not have records in the PBO to load the table control and it will be blank.
11-23-2005 1:25 AM
example
REPORT demo_dynpro_tabcont_loop.
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.
<b> WHEN 'REFRESH'.
refresh : itab.</b>
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.
PROCESS BEFORE OUTPUT.
MODULE status_0100.
LOOP WITH CONTROL flights.
MODULE fill_table_control.
ENDLOOP.
In the screen
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
LOOP WITH CONTROL flights.
MODULE read_table_control.
ENDLOOP.
MODULE user_command_0100.
11-23-2005 7:11 AM
just use the below stt. in PBO after modifying the entries
REFRESH CONTROL contrl FROM SCREEN dynnr.
Regards
Raja