2005 Nov 10 4:32 PM
Is there a Method in CL_gui_alv_grid to read the rows that are modified or all the rows in an alv grid?
As i can update the changes in database table.
Thanks in Advance.
Azee
Is there a Method in CL_gui_alv_grid to read the rows that are modified or all the rows in an alv grid?
As i can update the changes in database table.
Thanks in Advance.
Azee
2005 Nov 10 4:34 PM
Azee,
Use method <b>get_selected_rows</b> of Class cl_gui_alv_grid.
This method exports a Table to us that contains the row id of the selected row.
Sample Code:
data: iRowIndex type LVC_T_ROID,
waRowIndex like line of iRowIndex.
In PAI:
call method
grid->get_selected_rows(
importing
et_index_rows =
et_row_no = iRowIndex ).
Check the no of rows selected.
describe table iRowIndex lines sy-tfill.
Read the Row Number
read table iRowIndex into waRowIndex index 1.
get the corresponding record
read table iQdql into waQdql index
waRowIndex-row_id.
Modify the database
modify qdql from waQdql.
commit work.
Thanks
Kam
Note: Allot points for all the worthful helps!!!
Message was edited by: Kam
2005 Nov 10 4:43 PM
Hi Kam,
U r true for get_selected_rows,
but my requirement is i am giving user an editable grid and the user will not select any single row to change instead it ill make changes where ever required ,
So i thought if there is a method that will read modified row would make my work easy.
or is there a method tat will give u all the rows of the grid.
Regards,
Azee
2005 Nov 10 4:50 PM
Azee,
Then go with the method CHECK_CHANGED_DATA.
This method will Verify for Changes and Triggers an event DATA_CHANGED automatically.
I think,u could also use GET_CHANGED_DATA method too.
Thank
Kam
2005 Nov 10 4:36 PM
Use
CALL METHOD W_GRID1->CHECK_CHANGED_DATA
IMPORTING
E_VALID = L_VALID.
Before calling the method store the internal table data to be displayed in the grid in a temporary internal table.
If L_VALID = 'X'.
the records in the internal table will be changed with ur changed data. Then u can compare the temporary internal table with the current internal table and the changed contents u can save in the database
cheers
sharmistha
2005 Nov 10 4:38 PM
Hi,
there is one method for get_selected_rows.
Thanks & Regards,
Siri.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |