2011 Mar 03 11:43 AM
Hi,
I have to update an itab using an ALV GRID, having an editable field.
After having modified the editable field, when I give my user command to update the itab I can verify, in debug, that the field has not been changed (also if I press enter before giving the command).
Note:
1. I'm NOT using OO programming but the functions (REUSE_ALV_GRID_DISPLAY...)
2. I took a look for other posts on this argument but I cannot find a solution
Thanks in advance for every help or suggestion.
2011 Mar 03 11:57 AM
Hi,
Please use the below code in User Command.It will work.
Iam using the same in Grid ALV.
Copy the same code in User Command.
DATA : lv_ref_grid TYPE REF TO cl_gui_alv_grid.
to reflect the data changed into internal table
IF lv_ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lv_ref_grid.
ENDIF.
IF NOT lv_ref_grid IS INITIAL.
CALL METHOD lv_ref_grid->check_changed_data.
ENDIF.
Thanks,
Venkat.
Edited by: Venkatesh Kolluru on Mar 3, 2011 12:59 PM
Edited by: Venkatesh Kolluru on Mar 3, 2011 12:59 PM
2011 Mar 03 11:57 AM
Hi,
Please use the below code in User Command.It will work.
Iam using the same in Grid ALV.
Copy the same code in User Command.
DATA : lv_ref_grid TYPE REF TO cl_gui_alv_grid.
to reflect the data changed into internal table
IF lv_ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = lv_ref_grid.
ENDIF.
IF NOT lv_ref_grid IS INITIAL.
CALL METHOD lv_ref_grid->check_changed_data.
ENDIF.
Thanks,
Venkat.
Edited by: Venkatesh Kolluru on Mar 3, 2011 12:59 PM
Edited by: Venkatesh Kolluru on Mar 3, 2011 12:59 PM
2011 Mar 03 12:08 PM
2011 Mar 03 12:38 PM
Hi guys!!!
The code is perfect, I would like to contribute with one little thing, after the "MODIFY" it will be convinient to ask :
IF SY-SUBRC NE 0.
show some message that says that you couldn't update the table.
Endif.
Hugs,
Gaby
2011 Mar 03 12:00 PM
Hi,
Try this
form user_command using v_okcode like sy-ucomm
selfield type slis_selfield.
case v_okcode.
when '&IC1'.
loop at it_final into wa_final where cmspf is not initial.
*--->Update Internal Table
*--->validate and pass new values to wa_final
modify it_final from wa_final transporting <Field>.
endif.
endloop.
selfield-refresh = 'X'.
endcase.
endform.
Perfrom USER_COMMAND, will be the import parameter of UR ALV FM
Eg :
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'