Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8944

Re: Refresh button in ALV grid display

$
0
0

Its quite simple.

 

1. First add the refresh button in your GUI status with a function code, say &REF associated with it.

2. Suppose a subroutine get_data, gets data from the database using the select statement.

3.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

      i_callback_program       = sy-cprog

      i_callback_pf_status_set = 'ZSTANDARD' - " THis should have the refresh button also.

      i_callback_user_command  = 'USER_COMMAND'

      it_fieldcat              = lt_fieldcat

      it_event_exit            = lt_event_exit

    TABLES

      t_outtab                 = gt_mara.

 

4.

FORM user_command USING u_ucomm     TYPE sy-ucomm

                        r_selfield TYPE slis_selfield.     "#EC CALLED

 

  CASE u_ucomm.

    WHEN '&REF'..

      PERFORM get_data.       " Refresh data, get the latest data from database to the output table.

      r_selfield-refresh    = 'X'.

      r_selfield-col_stable = 'X'.

      r_selfield-row_stable = 'X'.

  ENDCASE.

 

ENDFORM.                    "user_command


Viewing all articles
Browse latest Browse all 8944

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>