10-13-2010 4:20 PM
HI ALL,
I have a created an editable alv report in oops. Now i have to add a new row having similar values as the previous row at run time when a custom button is clicked in the output and after entering some values in the new row and pressing the database must be updated and also the internal table at run time itself.
for example let us suppose i have the following row in the alv output.
MATNR DESCRIPTION NAME DATE
001 TEST MATRIKS 10092001
NOW if we click the custom button added on the alv toolbar, it should a new row at the run time similar to previous row as shown below
MATNR DESCRIPTION NAME DATE
001 TEST MATRIKS 10092001
001 TEST MATRIKS 10092001 -> NEW ROW.
can we do it in alv oops? pls let me know the soln or any helpful links
thanks
john
10-13-2010 4:32 PM
Hi John,
I dont think, you can find any method for that,
one way what I can suggest is
Get the selected row index.
Insert the blank row in your internal table at this index
Refresh the container.
Hope this will help.
Thanks,
Anmol.
10-13-2010 4:35 PM
insert your new row into your internal table for the ALV display, resort, then refresh the display or reuse as appropriate.
To update the database, I might create a copy of the table prior to presentation in ALV, then when user chose to update the db (via function press), compare the two tables, obtain my delta, update the db, recreate my table copy, refresh or reuse the ALV display again....