‎2009 May 15 10:28 AM
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
‎2009 May 15 10:58 AM
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_REPORTOR
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
‎2009 May 15 11:10 AM
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
‎2009 May 15 11:32 AM
hi
use fm 'RS_REFRESH_FROM_SELECTOPTIONS'
Regards
Edited by: SupriyaReddy29 on May 15, 2009 12:32 PM
‎2009 May 15 11:35 AM
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
‎2009 May 15 11:38 AM
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
‎2009 May 15 12:00 PM
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.
‎2009 May 18 9:11 AM
HI
You can use Refresh_table_display method to refresh the ALV grid.
‎2009 May 18 11:32 AM
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