Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

adding new rows at run time in alv oops

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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.

Former Member
0 Kudos

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....