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: 

Looping Select-Options with the help of ranges

shubh7767
Explorer
0 Kudos
975

I need to loop the select-options value for the condition when the user will enter random values with the help of the select single values option in select-options. I need to validate those entries against the TVARVC table value for the low-high range. so, how we can loop select-options entries (i/p)s without using a loop statement?

Can we loop it with the help of ranges ?

Could you assist me with the same?

8 REPLIES 8

adityaIngale
Active Participant
0 Kudos
859

loop at <your select-option>.

endloop.

This will loop your values in select-options one by one.

Is this you are looking for?

FredericGirod
Active Contributor
0 Kudos
859

how we can loop select-options entries (i/p)s without using a loop statement?

Why do you want to not used LOOP ?

shubh7767
Explorer
0 Kudos
859

Hi Aditya, Without the Loop statement, I want to proceed. Is there any other way you know?

shubh7767
Explorer
0 Kudos
859

Hi Frederic, my lead don't want me to use loop for select-options.

adityaIngale
Active Participant
859

Hi shubh7767,

Check these new Iteration Expression.

https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abeniteration_expressions.htm

Regards,

Aditya

FredericGirod
Active Contributor
0 Kudos
859

you should not use LOOP with RANGES because it is a non-sens. You have to make a SELECT and use the result of the SELECT. But you specify you would like to read the LOW value, not used the RANGES

shubh7767
Explorer
0 Kudos
859

Hey Frederic, Exactly, what i had been told to my lead. Thank you for your inputs and confirmation.

Sandra_Rossi
Active Contributor
859

I'm not sure to understand exactly what you are looking for, but based on the discussion between you and Frederic, if you use at least HANA and ABAP 7.52, you can use SELECT ... FROM @itab:

  1. SELECT-OPTIONS s_xx ...
  2. SELECT ... FROM tvarvc ...
  3. Load the values of TVARVC into an internal table
  4. SELECT ... FROM @itab WHERE value IN @s_xx ...

or more directly you could possibly use SELECT ... FROM tvarvc WHERE ... IN @s_xx ...