2009 Apr 14 5:51 AM
Hi Gurus,
I am displaying ALV on a module Pool Dialog screen as follows.
Data : v_alv_grid TYPE REF TO cl_gui_alv_grid.
CALL METHOD V_ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = X_LAY
I_SAVE = 'X'
CHANGING
IT_OUTTAB = T_CHECK
IT_FIELDCATALOG = T_FCAT
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
The table "T_Check" has a check box field. When the user checks any check box on the ALV screen, how to get that value back into the program?
I am unable to read that check box.
Could you tell me what else I have to code?
2009 Apr 14 7:48 AM
Hi,
If using OO ALV, then use this code when you click SAVE button:-
CASE sy-ucomm.
WHEN 'SAVE'.
* to reflect the data changed into internal table
DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data.
ENDIF.
" at this point your internal table is modified from alv output.
" and then use refresh_table_display
CALL METHOD ref_grid->refresh_table_display.
" to refresh the data from internal table back to alv output.
ENDCASE.
Hope this helps you.
Regards,
Tarun
Hi,
If using OO ALV, then use this code when you click SAVE button:-
CASE sy-ucomm.
WHEN 'SAVE'.
* to reflect the data changed into internal table
DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data.
ENDIF.
" at this point your internal table is modified from alv output.
" and then use refresh_table_display
CALL METHOD ref_grid->refresh_table_display.
" to refresh the data from internal table back to alv output.
ENDCASE.
Hope this helps you.
Regards,
Tarun
2009 Apr 14 5:59 AM
Hi,
This is the frequently asked question. Search the fourm for the solution.
2009 Apr 14 7:39 AM
Dear
AT USER_command event .
u can modify your final internal table .this will retain your check box
rgds ankit
2009 Apr 14 7:48 AM
Hi,
If using OO ALV, then use this code when you click SAVE button:-
CASE sy-ucomm.
WHEN 'SAVE'.
* to reflect the data changed into internal table
DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data.
ENDIF.
" at this point your internal table is modified from alv output.
" and then use refresh_table_display
CALL METHOD ref_grid->refresh_table_display.
" to refresh the data from internal table back to alv output.
ENDCASE.
Hope this helps you.
Regards,
Tarun
2009 Apr 14 8:17 AM
Hi,
Please do like this.
FORM user_command USING r_ucomm LIKE sy-ucomm
r_selfield TYPE slis_selfield.
DATA: gd_repid LIKE sy-repid, "Exists
ref_grid TYPE REF TO cl_gui_alv_grid.
CASE r_ucomm.
WHEN 'PROCESS'.
IF ref_grid IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = ref_grid.
ENDIF.
IF NOT ref_grid IS INITIAL.
CALL METHOD ref_grid->check_changed_data .
ENDIF.
LOOP AT it_error INTO w_error WHERE check = 'X'.
ENDLOOP.
r_selfield-refresh = 'X'.
encase.
thanks ,
kat.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |