‎2013 Dec 06 5:43 AM
Hi experts,
I am using the below code,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND' <--------------- for this
i_callback_top_of_page = 'TITLE'
is_layout = gd_layout
it_fieldcat = it_fieldcat
i_save = 'X'
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 1.
MESSAGE 'Program Error'(004) TYPE 'E'.
ENDIF.
REFRESH: it_fieldcat.
ENDIF.
FORM user_command USING r_ucomm TYPE sy-ucomm
sel_field TYPE slis_selfield.
DATA: it_grid TYPE REF TO cl_gui_alv_grid,
lv_is_valid.
DATA: lv_flag_crt TYPE char1,
lv_flag_chg TYPE char1.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = it_grid.
CALL METHOD it_grid->check_changed_data
IMPORTING
e_valid = lv_is_valid.
if lv_is_valid is not initial and r_ucomm = '&DATA_SAVE'.
Success message .
endif.
The problem is always i am getting lv_is_valid is 'X'. whenever the it_grid get filled lv_is_valid become 'X'.
I need only when there is a change in inputfields of report output(editable columns). Now always i am getting success message.
Please suggest me a solution.
Thanks & regards
Venkat
‎2013 Dec 06 6:02 AM
Hi Venkat,
you need to take the data in another internal table before passing to the Reuse ALV FM, Then you have to compare the two tables. If not equal then there is a change in the output.
FORM user_command USING ucomm TYPE sy-ucomm
slis_self TYPE slis_selfield.
CASE ucomm.
WHEN '&DATA_SAVE'.
IF lt_final_1 <> lt_final.
endif.
endcase.
‎2013 Dec 06 6:02 AM
Hi Venkat,
you need to take the data in another internal table before passing to the Reuse ALV FM, Then you have to compare the two tables. If not equal then there is a change in the output.
FORM user_command USING ucomm TYPE sy-ucomm
slis_self TYPE slis_selfield.
CASE ucomm.
WHEN '&DATA_SAVE'.
IF lt_final_1 <> lt_final.
endif.
endcase.
‎2013 Dec 06 6:36 AM
Thanks machi......
Hope you are doing well .....
Thanks & Regards
Venkat
‎2013 Dec 06 7:25 AM
Hi Venkatram's
In your case user can only edit the field not to add the row and delete the row.
Loop at old_internal table.
read new_internal table " key field that cann't be change.
and put the logic for the fresh value "
endloop.
Regards.
Nishant Bansal
‎2016 Apr 26 5:43 PM
hello,
i also use this. i have one alv with checkbox column, its editable alv so when i click on check and edit that particular column changes reflected but on save button code why i called this get_global_form_slvc_fullscr. ? why does it work as i used it in if alv_r _grid is initial then
called following method . ??
kindly tell me what it is doing?