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

Auto Refresh and Submit Program

sandip_sonar
Participant
0 Likes
1,491

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

3 REPLIES 3
Read only

bruno_begel
Discoverer
0 Likes
860

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

Read only

0 Likes
860

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.

Read only

sandip_sonar
Participant
0 Likes
860

Solved