‎2008 Dec 24 6:20 AM
Hi,
Ive created an ALV report using REUSE_ALV_GRID_DISPLAY FM. I want to delete selected rows. The code is working fine, however after deletion i've to refresh the display to show new data set. for e.g. if initially i had 10 rows and i deleted 3 rows it should show me 7 rows.
To achieve this , i'm repopulating the internal table and calling the REUSE_ALV_GRID_DISPLAY FM again. This is working fine.
I want to know whether i'm using the optimal approach or does anyone see a drawback in this method & suggest a better way.
Thanks Guys for going thro this post !
‎2008 Dec 24 6:24 AM
hi
before populating into the ALV .just do what eever you want.. and at finally you just send to the alv..
this is the one of the best approach ..
Thanks,
GSANA
‎2008 Dec 24 7:29 AM
Ok, there are 2 approches to this.
1. 1. You delete the data base table entries ,
2. reselect evrything from databse in inetrnal table.
3. show internal table details in alv.
this will make sure your databse delete was successful.
2. 1. You delete the data base table entries ,
2. Pop us the success message / error message if database deleet successds / falis.
3. delete the entris from original internal table
4. Deisplay the internal table entries again.
this avaoids the databse selection again and this will be more optimized approch.
hope this answers your question.
‎2008 Dec 24 7:48 AM
Hi Mac,
You have used REUSE_ALV_GRID_DISPLAY FM.As far as mu understanding goes, you want to delete selected rows.
To achieve this , what i suggest you.
1) final internal table consists of the data before deletion .
2) make the necessary deletions/additions in the internal table.
3) populate into another internal table final_int_table_temp which is of the similar structure
4) use this temp final table in the Fm and display
the problem with the repopulating the internal table,is we are giving effort to the Database which is again a performance issue hence whatever changes you want to do confine it upto the internal table level only.
hope you understood the solution.
get back if still you have the doubt.
thanks
srikanth.p
‎2008 Dec 24 9:08 AM