Application Development 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: 

REFRESH ALV

Former Member
0 Kudos
89

Hi Guys , Im showing some registers using classic alv , however some of the registers change theirs values during after push a button in the menu , how can i show the new values for my registers i mean refresh the ALV. thank you

1 ACCEPTED SOLUTION

Former Member
0 Kudos
47

If you are using OOPS ALV,

Call method

REFRESH_TABLE_DISPLAY

else if you are using CALL REUSE_ALV_GRID_DISPLAY

CALL REUSE_ALV_GRID_DISPLAY once again

4 REPLIES 4

Former Member
0 Kudos
48

If you are using OOPS ALV,

Call method

REFRESH_TABLE_DISPLAY

else if you are using CALL REUSE_ALV_GRID_DISPLAY

CALL REUSE_ALV_GRID_DISPLAY once again

former_member188685
Active Contributor
0 Kudos
47

if you are using the Grid function, in the user command you have to code like this..

form user_command using p_ucomm type sy-ucomm
p_selfld type slis_selfield.
 
data ref1 type ref to cl_gui_alv_grid.
"For capturing the selected data
call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
importing
e_grid = ref1.
call method ref1->check_changed_data.
 
case p_ucomm.
when '&DATA_SAVE'.  "based on your action
 
"Now you see/check here internal table will have changed 
"values
p_selfld-refresh = 'X'.
endcase.
endform. "user_command

Former Member
0 Kudos
47

For resuse alv list display, dont call the function again. Instead do like this :

In the user command of the alv list, set the flag that would refresh the list after a user command is performed


*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND                                             *
*&---------------------------------------------------------------------*
FORM user_command USING r_ucomm LIKE sy-ucomm
                        rs_selfield TYPE slis_selfield.
" Check the user command etc...

"     refresh the list when the user command to send the IDoc.
      rs_selfield-refresh = 'X'.

For oosp use the method as mentioned above.

regards,

Advait.

robert_altenstraer
Active Participant
0 Kudos
47

Hi

when you use the oo ALV you must register foolwing events:

The ENTER: ( you must register it if you use the ITS .. )

CALL METHOD alv_grid->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_enter

EXCEPTIONS

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.

also the change event if you use the edit function of the alv.. ( Don´t forget the IS_LAYOUT !! )

CALL METHOD alv_grid->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_modified

EXCEPTIONS

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.