‎2008 Mar 11 12:45 PM
Hi,
I Displaying the data in ALV and after display using the ls_fieldcat-edit changing the value and saving.but i cant sort the displayed data.so how tocome out this issue.
Thanks in advance for the answers.
Regards,
Dessanth
‎2008 Mar 11 12:48 PM
Hi,
Please refer to the code below:
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_bypassing_buffer = gs_test-bypassing_buffer
i_buffer_active = gs_test-buffer_active
i_callback_program = g_repid
i_callback_pf_status_set = 'F01_ALV_EVENT_PF_STATUS_SET'
i_callback_user_command = 'F01_ALV_EVENT_USER_COMMAND'
And
form f01_alv_event_user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
"#EC *
data: ls_outtab type g_ty_s_outtab,
ls_vari type disvariant,
ls_slis_layo type slis_layout_alv,
lt_slis_fcat type slis_t_fieldcat_alv,
lt_slis_sort type slis_t_sortinfo_alv,
lt_slis_filt type slis_t_filter_alv,
ls_slis_prnt type slis_print_alv,
ls_lvc_layo type lvc_s_layo,
lt_lvc_fcat type lvc_t_fcat,
lt_lvc_sort type lvc_t_sort,
lt_lvc_filt type lvc_t_filt,
ls_lvc_prnt type lvc_s_prnt.
case r_ucomm.
when 'REFRESH'.
rs_selfield-refresh = con_true.
Thanks,
Sriram Ponna.
Edited by: Sriram Ponna on Mar 11, 2008 6:41 PM
‎2008 Mar 11 12:48 PM
Hi,
Please refer to the code below:
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_bypassing_buffer = gs_test-bypassing_buffer
i_buffer_active = gs_test-buffer_active
i_callback_program = g_repid
i_callback_pf_status_set = 'F01_ALV_EVENT_PF_STATUS_SET'
i_callback_user_command = 'F01_ALV_EVENT_USER_COMMAND'
And
form f01_alv_event_user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
"#EC *
data: ls_outtab type g_ty_s_outtab,
ls_vari type disvariant,
ls_slis_layo type slis_layout_alv,
lt_slis_fcat type slis_t_fieldcat_alv,
lt_slis_sort type slis_t_sortinfo_alv,
lt_slis_filt type slis_t_filter_alv,
ls_slis_prnt type slis_print_alv,
ls_lvc_layo type lvc_s_layo,
lt_lvc_fcat type lvc_t_fcat,
lt_lvc_sort type lvc_t_sort,
lt_lvc_filt type lvc_t_filt,
ls_lvc_prnt type lvc_s_prnt.
case r_ucomm.
when 'REFRESH'.
rs_selfield-refresh = con_true.
Thanks,
Sriram Ponna.
Edited by: Sriram Ponna on Mar 11, 2008 6:41 PM
‎2008 Mar 11 12:48 PM
After saving try calling the method refresh_table_display.
Hope this helps.
Thanks,
Balaji
‎2008 Mar 11 12:49 PM
hi ,
use like this ,
DATA: sort TYPE slis_sortinfo_alv,
it_sort TYPE slis_t_sortinfo_alv.
sort-fieldname = 'PERNR'.
sort-subtot = 'X'.
SORT-UP = 'X'.
APPEND sort TO it_sort.
it will sort ur fields auto matically.
regards,
venkat.
‎2008 Mar 11 12:51 PM
Hi,
In one of the structures of ALV structure , there is an option called FIELD-SORT . Make it on.
and when the result gets displayed, u will get a sort option as an icon on tool bar.. then and there u can choose to operate SORT facility on required fields.
Shaily
‎2008 Mar 11 12:52 PM
Chances are pretty good that this is a refresh issue. It may require that after you update the internal table being displayed, you need to refresh the data.
There may be an option to REFRESH_DISPLAY (ie CALL METHOD grid_action_dropins->refresh_table_display), or you may need to exit the ALV process and restart it.