‎2012 Dec 19 4:57 AM
Hi friends...
i have an issue..when i am editing the report after execution...the requirement was it must save the changed the value...but the save functionality was not working
in my report..plase help me...
thanks in advance
‎2012 Dec 19 5:02 AM
hi
what is the value in sy-ucomm when you press save button?
is it same as that fo r_ucomm?
regards
vaibhav
‎2012 Dec 19 5:19 AM
HI VAIBHAV..
SY-UCOMM VALUE IS &SAVE_DATA..BUT WHEN I CHANGED THE SY-UCOMM NOT WORKING
‎2012 Dec 19 6:04 AM
hi
do one thing change r_ucomm with sy-ucomm and thenn check .
regards
vaibhav
‎2012 Dec 19 5:20 AM
just now i changed the code ztable as internal table(ty_output)...but it is not working
‎2012 Dec 19 5:28 AM
Hi,
please check this link "http://wiki.sdn.sap.com/wiki/display/Snippets/ALV+with+edit+and+save+functionality"
Regard's
Smruti
‎2012 Dec 19 5:29 AM
Vishnu,
Please use CALL METHOD ref_grid>refresh_table_display to refresh the changed data on to the screen. Also, try this code after check_changed_data.
save_ok = ok_code.
CLEAR ok_code.
CASE sy-ucomm.
WHEN 'SAVE'.
Please let me know if this helps.
Thanks,
Sreekanth
‎2012 Dec 19 9:37 AM
Hi Vishnu,
one thing i want to know wether you are trying to save the edited data in the database or else you want to save it locally into internal table.
I observed that in your code you commented the important code that is needed for saving functionality
* CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
*
* IMPORTING
** ET_EXCLUDING =
** E_REPID =
** E_CALLBACK_PROGRAM =
** E_CALLBACK_ROUTINE =
* e_grid = g_grid.
* CALL METHOD g_grid->check_changed_data
* IMPORTING
* e_valid = is_valid.
the above logic is key for your code. for saving functionality process these logic in PAI module.
Hope this may helps you....
‎2012 Dec 19 1:40 PM
Hi ,
Please refer to below link
<link to blocked site removed by moderator>
Thanks,
Raghunadh.K
Message was edited by: Thomas Zloch
‎2012 Dec 19 2:18 PM
Hi Vishnu,
Change your call ALV as below and add status and user_command routines. Don't forget to set SAVE button on STATUS.
PERFORM build_events TABLES _it_event.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'STATUS'
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcat
it_events = it_event[]
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
FORM build_events TABLES p_it_event TYPE slis_t_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_it_event[]
EXCEPTIONS
list_type_wrong = 1
OTHERS = 2.
CLEAR p_it_event.
p_it_event-name = slis_ev_data_changed.
p_it_event-form = 'DATA_CHANGED'.
APPEND p_it_event.
ENDFORM. " BUILD_EVENTS
FORM status USING p_extab TYPE slis_t_extab.
"Set the Button using the staus
"Copy the Standard status from the program SAPLKKBL status
" STANDARD using SE41, and use that here.
"Pf status
SET PF-STATUS 'STANDARD' EXCLUDING p_extab.
ENDFORM. " STATUS
FORM alv_user_command USING p_ucomm LIKE sy-ucomm
p_selfield TYPE slis_selfield.
DATA: _ref_grid TYPE REF TO cl_gui_alv_grid.
IF _ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = _ref_grid.
ENDIF.
CALL METHOD _ref_grid->check_changed_data.
CASE p_ucomm.
* Double-Click
WHEN '&IC1'.
WHEN '&DATA_SAVE'.
WHEN 'SAVE'.
PERFORM save_changes.
ENDCASE.
* CALL METHOD _ref_grid->refresh_table_display.
* CALL METHOD _ref_grid1->refresh_table_display
* EXPORTING
* is_stable = lvc_s_stbl.
p_selfield-refresh = 'X'.
ENDFORM. "alv_user_command