2023 Apr 20 11:35 AM
Well here is my code
WHEN 'BORRAR_PRO'.
DO 2 TIMES.
READ TABLE gt_doc_txt INTO wa_doc_txt INDEX ps_selfield-tabindex.
DELETE gt_doc_txt
WHERE cod_producto = wa_doc_txt-cod_producto.
ENDDO.
it works when i hardcode the times of the do, but i need to know how many record are selected to know how many times the do have to work.
The code are in the user_command USING pv_ucomm.
2023 Apr 20 11:36 AM
Welcome to the SAP Community. Thank you for visiting us to get answers to your questions.
Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.
First, please see https://community.sap.com/resources/questions-and-answers, as this resource page provides tips for preparing questions that draw responses from our members. Second, feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html, as that will help you when submitting questions to the community.
I also recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.
Now for some specific suggestions on how you might improve your question:
* Outline what steps you took to find answers (and why they weren't helpful) -- so members don't make suggestions that you've already tried.
Should you wish, you can revise your question by selecting Actions, then Edit.
The more details you provide (in questions tagged correctly), the more likely it is that members will be able to respond.
I hope you find this advice useful, and we're happy to have you as part of SAP Community!
2023 Apr 20 11:41 AM
Which kind of ALV? CL_SALV_TABLE or the old CL_GUI_ALV_something? If it's something oldie like the FM 'REUSE_ALV', I fear I cannot tell you, I'm old, but a failsafe device on my memory prevents me to access data from those dark years when I was used to FM's and FORMs...
2023 Apr 20 3:02 PM
Well, suppose user selected 10th and 20th record, so cursor is on line 20... your code delete 20th record 2 time, previously records 20 and 21... 😞
Time to switch to CL_GUI_ALV_GRID (edit?) or CL_SALV_TABLE or to read IS_LAYOUT documentation in some outdated FM ... HTPP error 419 ...
2023 Apr 21 1:36 PM
Thanks to all, i just create a new column with a checkbox, and the user have to put X on the records who wants to delete. Thanks to all, it is my first question here.