‎2011 May 03 8:14 AM
Dear All,,
I have one requirement to auto refresh the ALV List Report. I am able to Refresh that list automatically, but now
I want to call another report from previous report using SUBMIT keyword. and 3rd Report using 2nd report
e.g.
1st ALV List display
When Auto Refresh It will call 2nd ALV list and again auto refresh it will call 3rd ALV list
Please, help me to solve this .
OR
How to auto refresh ALV using block List Display. i.e More than one ALV list need to be display and auto refersh at same time.
Please, suggest any good solution.
Thanks & Regards,
S SONAR
‎2011 May 03 9:58 AM
Hi,
you could use this methode to refresh an ALV :
-->Update the tempory data of ALV
wt_entete-error_emp = 'Z'.
MODIFY wt_entete INDEX rs_selfield-tabindex
TRANSPORTING error_emp.
---> reference of ALV
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lo_grid.
Refresh ALV
CALL METHOD lo_grid->refresh_table_display
EXPORTING
i_soft_refresh = 'X'.
bye
‎2011 May 03 12:18 PM
Issue Solved. Refrence code is as below.
REPORT rich_0001.
TYPE-POOLS : slis.
DATA: BEGIN OF itab OCCURS 0,
fld1 TYPE i,
fld2 TYPE i,
END OF itab.
----
CLASS lcl_event_handler DEFINITION
----
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS: on_finished FOR EVENT finished OF cl_gui_timer.
ENDCLASS. "lcl_event_handler DEFINITION
DATA: gui_timer TYPE REF TO cl_gui_timer.
DATA: event_handler TYPE REF TO lcl_event_handler.
DATA: timeout TYPE i VALUE '3'.
START-OF-SELECTION.
CREATE OBJECT gui_timer.
SET HANDLER event_handler->on_finished FOR gui_timer.
gui_timer->interval = timeout.
CALL METHOD gui_timer->run.
PERFORM write_list.
*----
FORM alv_user_command
*----
FORM alv_user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
PERFORM read_data.
rs_selfield-refresh = 'X'.
ENDFORM. "alv_user_command
*----
FORM write_list
*----
FORM write_list.
DATA: fieldcat TYPE slis_t_fieldcat_alv.
DATA: repid TYPE sy-repid.
repid = sy-repid.
PERFORM read_data.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = repid
i_internal_tabname = 'ITAB'
i_inclname = repid
CHANGING
ct_fieldcat = fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = fieldcat
i_callback_program = repid
i_callback_user_command = 'ALV_USER_COMMAND'
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. "write_list
----
FORM read_data *
----
FORM read_data.
Use your own database table here.
itab-fld1 = itab-fld1 + 1.
itab-fld2 = itab-fld2 + 1.
APPEND itab.
ENDFORM. "read_data
----
CLASS lcl_event_handler IMPLEMENTATION
----
CLASS lcl_event_handler IMPLEMENTATION.
METHOD on_finished.
Start Timer again
gui_timer->interval = timeout.
CALL METHOD gui_timer->run.
cause PAI
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'REFR'.
ENDMETHOD.
ENDCLASS.
‎2011 May 03 12:18 PM