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

Refresh ALV

Former Member
0 Likes
1,471

Hi,

I'm using FM 'REUSE_ALV_HIERSEQ_LIST_DISPLAY' for ALV list .

How do I refresh the list display.

Is there any function module for the same.

Pls help

Thanjs

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,060

hi,

see the below code..

call function 'REUSE_ALV_LIST_DISPLAY'

exporting

i_callback_program = gd_repid

i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM

i_callback_user_command = 'USER_COMMAND'

  • i_grid_title = outtext

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

  • it_special_groups = gd_tabgroup

  • IT_EVENTS = GT_XEVENTS

i_save = 'X'

  • is_variant = z_template

tables

t_outtab = it_ekko

exceptions

program_error = 1

others = 2.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

endform. " DISPLAY_ALV_REPORT

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN '&DEALL'.

  • Message for reselection of lines

IF itab_display-kalab LE 0.

MESSAGE i101.

EXIT.

<b>To refresh...

rs_selfield-refresh = 'X'."structure slis_selfield</b>

Regards

Ramesh.

7 REPLIES 7
Read only

franois_henrotte
Active Contributor
0 Likes
1,060

as far as I know this is not possible

Read only

former_member183924
Active Participant
0 Likes
1,060

Hi Prabha

I created a button in my dynpro "refresh".

declaration:


DATA: alv_list1      TYPE REF TO cl_gui_alv_grid,

insert this code into the PAI module:


CASE ok_code.
  WHEN 'REFRESH'. CALL METHOD alv_list1->refresh_table_display.
ENDCASE.

Regards,

Steffen

Message was edited by: Steffen Fröhlich

sorry I was talking by an ALV-GRID...

Read only

Former Member
0 Likes
1,060
Read only

Former Member
0 Likes
1,061

hi,

see the below code..

call function 'REUSE_ALV_LIST_DISPLAY'

exporting

i_callback_program = gd_repid

i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM

i_callback_user_command = 'USER_COMMAND'

  • i_grid_title = outtext

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

  • it_special_groups = gd_tabgroup

  • IT_EVENTS = GT_XEVENTS

i_save = 'X'

  • is_variant = z_template

tables

t_outtab = it_ekko

exceptions

program_error = 1

others = 2.

if sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

endform. " DISPLAY_ALV_REPORT

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN '&DEALL'.

  • Message for reselection of lines

IF itab_display-kalab LE 0.

MESSAGE i101.

EXIT.

<b>To refresh...

rs_selfield-refresh = 'X'."structure slis_selfield</b>

Regards

Ramesh.

Read only

Former Member
0 Likes
1,060

Hi

Pls, Go through this link it will be help full for you create ALV Automatically.

http://www.alvrobot.com.ar/SRG_1.php

Let me know if u need further help.

Read only

Former Member
0 Likes
1,060

hi,

to refresh the screen we have to use below command...

rs_selfield-refresh = 'X'.

thanks,

maheedhar

Read only

Former Member
0 Likes
1,060

Take a look at the code below. Its used with REUSE_ALV_GRID_DISPLAY. But you can still customize it quite easily for your case.

DATA: lt_event_exit TYPE slis_t_event_exit,
      ls_event_exit TYPE slis_event_exit.

CONSTANTS: gc_refresh TYPE syucomm VALUE '&REFRESH'.

START-OF-SELECTION.
  PERFORM data_retrieval.
  PERFORM build_fieldcatalog.
  PERFORM build_sort.
  PERFORM build_layout.
  PERFORM build_refresh.
  PERFORM display_alv_report.

FORM display_alv_report.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = gd_repid
      i_callback_pf_status_set = 'BUILD_PF_STATUS'
      i_callback_user_command  = 'USER_COMMAND'
      is_layout                = gd_layout
      it_fieldcat              = fieldcatalog
      it_sort                  = gd_sort
      it_events                = gt_events
      it_event_exit            = lt_event_exit
      is_print                 = gd_prntparams
      i_save                   = 'X'
    TABLES
      t_outtab                 = i_zopen_alv
    EXCEPTIONS
      program_error            = 1
      OTHERS                   = 2.

  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
ENDFORM.                    " DISPLAY_ALV_REPORT

FORM user_command USING r_ucomm LIKE sy-ucomm
                        rs_selfield TYPE slis_selfield.

  CASE r_ucomm.                   "Condition on command executed

    WHEN gc_refresh.                      "When the REFRESH button has been clicked
      REFRESH i_zopen_alv.                "Refresh data
      PERFORM data_retrieval.             "Retrieve data
      rs_selfield-refresh    = 'X'.
      rs_selfield-col_stable = 'X' .
      rs_selfield-row_stable = 'X' .
  ENDCASE.
ENDFORM.                    "user_command

FORM build_refresh.
  CLEAR ls_event_exit.
  ls_event_exit-ucomm = gc_refresh.    " Refresh
  ls_event_exit-after = 'X'.
  APPEND ls_event_exit TO lt_event_exit.
ENDFORM.                    "build_refresh

Message was edited by:

Megan Flores