‎2007 Dec 27 9:36 AM
I am creating a dialog to allow user modif some customized fields in ALV. But a problem was met. In testing, after I finished the modification in ALV, I press a button on toolbar "save". I direct the i_callback_user_command to my subroutine "FRM_USER_COMM". At the breakopion set in this subroutine, I found the internal table used for ALV has not been changed at all. But if I process a double click on the ALV before pressing "save", the data in internal table has been changed. Thanks.
So, please help to coach me how I can do for this case?
*the setup for user input. It is a checkbox.
w_fieldcat-fieldname = 'CHK'.
w_fieldcat-col_pos = '1'.
w_fieldcat-checkbox = 'X'.
w_fieldcat-seltext_l = 'CHK'.
w_fieldcat-edit = 'X'.
APPEND w_fieldcat TO t_fcat.
*call alv
FORM FRM_ALV_SHOW .
DATA l_repid LIKE sy-repid VALUE sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_pf_status_set = 'FRM_SET_GUISTA'
i_callback_user_command = 'FRM_USER_COMM'
i_grid_title = 'DOC NUMBERING'
is_layout = LT_LAYO
it_fieldcat = LIT_FCAT[]
i_save = 'X'
TABLES
t_outtab = IT_OUT
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE s003(zp) DISPLAY LIKE 'E'.
STOP.
ENDIF.
ENDFORM. " FRM_ALV_SHOW
*set GUI status
FORM FRM_SET_GUISTA USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STDSTA' EXCLUDING rt_extab.
ENDFORM. " FRM_SET_GUISTA
*process r_ucomm
FORM FRM_USER_COMM USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
rs_selfield-refresh = 'X'.
CASE r_ucomm.
WHEN 'SAVE'.
PERFORM FRM_SAVE.
ENDCASE.
‎2007 Dec 27 10:02 AM
Hi Robbie,
There is one gap in your code which need to fill.
Do as below -
Befor SAVE,
You need to call global object of your ALV program.
This is done by following FM-
Data ref type ref to cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = ref.
call method ref->check_changed_data
You will find all the changes of your ALV table.
Hope this will help you.
Regards
Nimesh S. Patel
‎2007 Dec 27 10:02 AM
Hi Robbie,
There is one gap in your code which need to fill.
Do as below -
Befor SAVE,
You need to call global object of your ALV program.
This is done by following FM-
Data ref type ref to cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = ref.
call method ref->check_changed_data
You will find all the changes of your ALV table.
Hope this will help you.
Regards
Nimesh S. Patel
‎2007 Dec 27 10:10 AM
Hi ,
In the FM
REUSE_ALV_GRID_DISPLAY
there is parameter I_GRID_SETTINGS
pass that parameter with create a work area of type LVC_S_GLAY
S_GLAY-EDT_CLL_CB = 'X'.
Pass the below parameter in REUSE_ALV_GRID_DISPLAY
I_GRID_SETTINGS = S_GLAY.
Please reward if useful.