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: 

display only the selected rows in interactive alv

0 Kudos

So I have created an alv with records. My requirement is once I select the record,only those records have to be displayed and edited and get saved. editing and saving part is done. Please help me with displaying only the selected rows. pfa.

15 REPLIES 15

roberto_forti
Contributor

Hi Dyvia,

I recommend you starting to understand how ALV ABAP OO works.

Suggested SAP link below.

https://help.sap.com/doc/erp2005_ehp_06/6.0.6/en-US/4e/b7a512999e0134e10000000a42189b/frameset.htm

Regards,

0 Kudos

Hi Robin,

Thanks for the link. I am new to abap. And my seniors have suggested to keep the coding not in oo abap for now.

Can you help me with the sample codes plzz?

Regards,

Divya.

Hi Dyvia,

Move the corresponding record which was changed and saved to another internal table and consider displaying it, ok?

Regards,

0 Kudos

Why?

Really, didn't you ask why?

matt
Active Contributor

Probably the "seniors" can't program in OO... 😉

Your "seniors" have got it very wrong.

Procedural is NOT a stepping stone to OO, it makes it more difficult in my and many others' experience. At some stage you have to un-learn what you think you know and start looking at it from a different angle.

Learn the right way. These guidelines have been published almost ten years ago:

https://help.sap.com/http.svc/rc/abapdocu_750_index_htm/7.50/en-US/index.htm

Ganesh_Pandian
Explorer
0 Kudos

As interactive ALV does not looks like a optimal solution.

Select the rows and give a pushbutton , when the push button is clicked, you can delete the non selected rows and refresh the ALV. so that you can edit and save afterwards.

former_member241258
Active Participant
0 Kudos

hi

i have modified your sample code. see attached file.

demo.txt

Do not spoon feed people: you are not helping them at all into growing and understanding how to work and improve.

0 Kudos

hi,

i did not developed New, just modified her code.

SimoneMilesi
Active Contributor
0 Kudos

And you'd loose the full alv, so you have to retrieve the data again (or use a copy of the original table).
As user, once i update data, i'd love to have the whole picture again, without waiting the report retrieve it once more.

SimoneMilesi
Active Contributor

Without reading your code, this is how i'd set up my flow:

  1. Retrieve my data and show the alv
  2. Mark interested lines and press a specific button
  3. Editable ALV popup with selected fields
  4. Once the user confirms the changes, i update my initial ALV and refresh it, closing the popup.

Ganesh_Pandian
Explorer
0 Kudos

Not retrieving the entire report again, you do refresh the internal table only. not going again though all the logics again

SimoneMilesi
Active Contributor
0 Kudos

How do you refresh the internal table? Retreiving data again to fill and refresh your internal table, the one you suggested to delete rows from.

This could lead to long waiting time which is a really poor user experience.


The other option is to use a copy of the same table, but, again, you can have an issue with memory if the data is huge.

Ganesh_Pandian
Explorer
0 Kudos

This can be achievable either way, as you said it totally depends on the situation of the Program and the no. of records it is handling!

Deleting the rows will not take much time and even throwing the data to a temporary table is also okay. but that also depends on the No. of records as you said. it may lead to issues with memory.

It is up to you to optimize the program!