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

problem in alv refresh

Former Member
0 Likes
1,298

hi masters,

i m working on alv report where i have to change the data.

after changing the data i have to refresh the report to show changed data.

when i clicked on refresh button it is going to pf-status after that as i shown in below code it goes to 'refresh_report'. but in this 'form refresh_report' it won't display the any report. it goes into the infinite loop. within that form- endform.

plz can u give me solution for this problem?

set pf-status 'STANDARD_FULLSCREEN'.

case sy-ucomm.

when '&REFRESH'.

perform refresh_report.

endcase.

form refresh_report .

perform build_fieldcatlog.

perform event_call.

perform populate_event.

perform data_retrieval.

perform build_listheader using it_listheader.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = v_repid

i_callback_pf_status_set = 'SET_PF_STATUS'

i_callback_user_command = 'USER_COMMAND'

i_callback_top_of_page = 'TOP_OF_PAGE'

it_fieldcat = i_fieldcat[]

i_save = 'A'

it_events = v_events

tables

t_outtab = it_header

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

endform. " REFRESH_REPORT

8 REPLIES 8
Read only

Former Member
0 Likes
896

Hi,

remove the call function reuse_alv_grid_display from the refresh_report....

just see the code below.

your form refresh_report should look like this...

form refresh_report .
perform build_fieldcatlog.
perform event_call.
perform populate_event.

perform data_retrieval.
perform build_listheader using it_listheader.

endform. " REFRESH_REPORT

OR

try using this FM

'REUSE_ALV_GRID_DISPLAY_LVC'

you need not write any code for refresh just the function code &REFRESH will do... it works automatically...

Regards,

Siddarth

Read only

MarcinPciak
Active Contributor
0 Likes
896

Hi vicky

Try this



"call these only once
perform build_fieldcatlog.
perform event_call.
perform populate_event.

perform data_retrieval.
perform build_listheader using it_listheader.

...
FORM set_pf_status USING ft_extab TYPE slis_t_extab.
  set pf-status 'STANDARD_FULLSCREEN'.
ENDFORM.                    "SET_PF_STATUS


FORM user_command USING f_ucomm TYPE sy-ucomm
                        ls_selfield TYPE slis_selfield.
    case ucomm.       "check f_ucomm not sy-ucomm
       when '&REFRESH'.   
       perform refresh_report.
    endcase.
ENDFORM.                    "USER_COMMAND

form refresh_report .

  SET SCREEN 0.       "try end up calling sequnece also before redisplaying 

call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = v_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
it_fieldcat = i_fieldcat[]
i_save = 'A'
it_events = v_events
tables
t_outtab = it_header
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
endform. 

Regards

Marcin

Read only

Former Member
0 Likes
896

hi

use fm 'RS_REFRESH_FROM_SELECTOPTIONS'

Regards

Edited by: SupriyaReddy29 on May 15, 2009 12:32 PM

Read only

Former Member
0 Likes
896

hi

try this u will definetly get ur requirement fulfilled

form user_command using ucomm type sy-ucomm

selfield type slis_selfield.

data: gstring type c.

constants: l_c_repid type sy-repid value 'ZCOE_ALV_SIMPLE'.

data: l_i_seltab type table of rsparams.

case ucomm.

  • Clicking on refresh button at toolbar

when 'REF'.

  • Calling fm to get refresh data

call function 'RS_REFRESH_FROM_SELECTOPTIONS'

exporting

curr_report = l_c_repid

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.

  • * Calling the screen after refreshing

submit sy-repid with selection-table l_i_seltab.

endif.

endcase.

endform.

Regards

Murali.M

Read only

Former Member
0 Likes
896

hi

try this u will definetly get ur requirement

form user_command using ucomm type sy-ucomm

selfield type slis_selfield.

data: gstring type c.

constants: l_c_repid type sy-repid value 'ZCOE_ALV_SIMPLE'.

data: l_i_seltab type table of rsparams.

case ucomm.

  • Clicking on refresh button at toolbar

when 'REF'.

  • Calling fm to get refresh data

call function 'RS_REFRESH_FROM_SELECTOPTIONS'

exporting

curr_report = l_c_repid

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.

  • * Calling the screen after refreshing

submit sy-repid with selection-table l_i_seltab.

endif.

endcase.

endform.

Regards

Read only

p604431
Active Participant
0 Likes
896

Hi, try this one..

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      i_callback_program              = sy-repid
      i_callback_pf_status_set      = 'ZMENU'
      i_callback_user_command  = 'USER_COMMAND_01'
      it_fieldcat                            = it_fieldcat
    TABLES
      t_outtab                 = it_spfli
    EXCEPTIONS
      program_error            = 1
      OTHERS                   = 2.

FORM user_command_01 USING ucomm    LIKE sy-ucomm
                           selfield TYPE slis_selfield.

Case ucomm.
   When '&REFRESH'.
       selfield-refresh = 'X'.
Endcase.
Ed form.

Read only

Former Member
0 Likes
896

HI

You can use Refresh_table_display method to refresh the ALV grid.

Read only

Former Member
0 Likes
896

Hi,

If you are giving input in ALV, then don't refresh like this. Use the following code.

v_ref TYPE REF TO cl_gui_alv_grid

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

e_grid = v_ref.

CALL METHOD v_ref->check_changed_data.

This will work.

Thanks and regards,

Venkat