Skip to Content
avatar image
Former Member

Deleting in the loop by comparing values and number of values in selection

Dear Experts,

Hope you all are well. I have a little bit complex logic in which i need to delete values in an internal table on the base of equivalent values in selection table as well as equal to number of values selection screen field.

For example i have a field in selection screen which as three values A1, A2, A3. In an internal table (itab), i have values for one user1 its A1, A2, A3, for user2 its A1, A2, A3, A4, and for user 3 its A1, A2.

What i want is to delete the values in itab that are equivalent to selection table but also on the base of number of values in selection table. For Example selection table has 3 values. Itab should delete the values for user 1 because it is exactly equal to selection values, but for user 2 and user 3, these should not be deleted because user 2 has one more value A4 and user 3 has one less value A3.

Can you please write a sample logic that how can i achieve this? Please let me know.

Thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Former Member Horst Keller

    Thanks for your reply. I tried using deleting in internal table. My login does work when the values are more than the selection screen. For Example. If i have A1, A2, A3, A4 in Itab and A1, A2, A3 in logic works. But it does not work when i have values less than the values in selection screen. For Example. if i have A1, A2 its just get deleted but i just want to delete those values that are exactly equivalent to selection and at the same time equal in numbers too.

  • Sorry, this comment does not seem to match what you stated in the original post. Above you said "should not be deleted because user 2 has one more value A4" but now it's suddenly OK. You lost me here...

    Kindly get the story straight. Also might be a good idea to stop playing coy and provide more specific context and why you are doing this. There might be completely different ways and you might as well be looking for a solution to a wrong problem.

  • I've edited your question because without paragraph breaks it's very hard to understand. Please try to write your questions clearly. To this end, you need to give rather more detail - showing a worked example with sample data of what you're trying to achieve.

  • Get RSS Feed

0 Answers