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 data in ALV Grid Display

Former Member
0 Likes
12,088

Hello Experts,

I would like to ask how to refresh the data in the ALV grid display after the user has pressed on a button. I am using the Function Module REUSE_ALV_GRID_DISPLAY.

Thanks.

Hello Experts,

I would like to ask how to refresh the data in the ALV grid display after the user has pressed on a button. I am using the Function Module REUSE_ALV_GRID_DISPLAY.

Thanks.

6 REPLIES 6
Read only

Former Member
1,915

try this one.

form user_command using ucomm type sy-ucomm

selfield type slis_selfield.

selfield-refresh = 'X'.

endform.

regards

Prabhu

Read only

former_member556412
Active Participant
0 Likes
1,915

Hi,

call method grid (name of grid )->refresh_table_display

exporting

IS_STABLE = <STRUCT OF TYPE LVC_S_STBL> (THIS IS FOR DATA REFRESHING)

I_SOFT_REFRESH = <VARIABLE OF CHAR 01> (THIS IS FOR ICON REFRESHING).

Regards,

Bhanu

Read only

Former Member
0 Likes
1,915

Hi,

At u'r output screen first create a button for refresh data.

when clicking the button.

write the below code under form user_command and endform.

CONSTANTS: l_c_repid TYPE sy-repid VALUE '/CCC/RDSDSLSR_GTS_RECON'.

DATA: l_i_seltab TYPE TABLE OF rsparams.

CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'

EXPORTING

curr_report = l_c_repid

  • IMPORTING

  • SP =

TABLES

selection_table = l_i_seltab

EXCEPTIONS

not_found = 1

no_report = 2

OTHERS = 3

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

SUBMIT /ccc/rdsdslsr_gts_recon WITH SELECTION-TABLE l_i_seltab.

ENDIF.

ENDFORM.

Regards,

Naveen M.

Read only

Former Member
0 Likes
1,915

Create a button in alv toolbar with some function code.

In the at-usercommand event ,

Check whether sy-ucomm = 'The function code for refresh button".

If yes , then set the value of field 'slis_selfield-refresh' to 'X'.

this will help to refresh the alv .

Read only

Former Member
0 Likes
1,915

Dear,

To refresh the data in the ALV grid display after the user has pressed on a button you can use

this Function Module 'RS_REFRESH_FROM_SELECTOPTIONS'

Cheers

fareed

Read only

Former Member
1,915

OUFFF OK!!!!, just to clarify what is the only good answer to the question:

The problem risen here is that following a user action, the context may have changed and you need to reflect that change in the ALV.

Simple example:

I had that vendor blocking program to do. I was displaying an alv of the selected vendors with one of the fields being the block status. Then at the push of a button, I was blocking the unblocked vendors one by one, modifying the blocking status field of the feeding internal table along the way.

If I had not done anything specifically to refresh the ALV, after button action was completed, the block fields on the screen would have not been updated accordingly.

So, as one guy said above, the trick is crazy simple:

selfield-refresh = 'X'!!!!

As you know, to respond to user action you have to pass a user command form to your ALV call. The structure of that form is mandatory and as below(you can change the namings as you like, as long as you have a ucomm field followed by a slis_selfield).

And bingo, if you change back the parameter selfield-refresh to 'X', it will trigger automatically a refresh from your modified internal table that feeds your ALV

form user_command using ucomm type sy-ucomm selfield type slis_selfield.

...

...

selfield-refresh = 'X'.

...

...

endform.