2009 Feb 05 11:20 AM
Hi Guru,
I am displaying one ALV grid using class.
In that I have to change some value of one column.
I want to get the index for the same. I can not use get_selected_row because i am not selecting any row.
Is there any method in the class.
Please sugget.
Thanks.
2009 Feb 05 11:23 AM
In that I have to change some value of one column.
If this an editable ALV, then you can make use of the event data_changed or data_change_finished of the class.
regards,
Advait
Hi Guru,
I am displaying one ALV grid using class.
In that I have to change some value of one column.
I want to get the index for the same. I can not use get_selected_row because i am not selecting any row.
Is there any method in the class.
Please sugget.
Thanks.
2009 Feb 05 11:23 AM
In that I have to change some value of one column.
If this an editable ALV, then you can make use of the event data_changed or data_change_finished of the class.
regards,
Advait
2009 Feb 05 11:25 AM
Hi Sandeep,
Just try the method: method GET_TABLE_FOR_ALV_GRID
Hope this will help you...
2009 Feb 05 11:28 AM
hi,
In the class CL_GUI_ALV_GRID u hv a method as : CHECK_CHANGED_DATA
this triggers a event "data_changed " and returns the value of the changed data in a column or any cells.
there is also a Method "GET_CHANGED_DATA"... try that
regards,
ags.
2009 Feb 05 11:32 AM
Hi,
Use:-
When you double-click on any cell of alv grid, use this code to fetch the data of the line that you currently clicked, its working:-
When you double click on the ALV grid line, you will have sy-ucomm = '&IC1'.
So when you define a i_callback_user_command for the FM reuse_alv_grid_display, and create it as:-
FORM command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
DATA : ok_code TYPE sy-ucomm.
ok_code = ucomm.
CASE ok_code.
WHEN '&IC1'. "for double click on alv grid line
" your code
ENDCASE.
ENDFORM.
As you have used selfield TYPE slis_selfield, the field selfield will hold all the values.
To know on which row you have clicked and to retain that line, use code:-
Suppose you are currently displaying data from internal table itab and corresponding to it you have work area wa.
read table itab into wa index selfield-tabindex. "index value of line you clicked
" now you have the contents of line that you double clicked currently
Now to know the field name that you clicked, use:-
selfield-fieldname " will fetch you the name of field that you clicked
Now using the work-area and the name of field that you clicked, you can easily make out the details of the field i.e., field name and field value and you can code as per your requirement.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
2009 Feb 05 11:34 AM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |