Skip to Content
Jan 27, 2013 at 04:21 PM

How to compare range with range?


Dear ABAP friends,

I have an itab A (structure BAPI6109SEL) at runtime and I have a Z-table B with the same structure.

Now I want to check if the value of any line in the itab A is in the content of Z-table B (like “if A is in B”).


- I EQ 123 <-> I BT 124 129 -> FALSE

- I CP ABC* <-> I BT ABC000 ABC999 -> RIGHT

- I CP 506* <-> I BT 5066000 5069ZZZ -> FALSE

I know that I can compare each field of the structure and replace the CP (*) by an interval 000 (low) and 999/ZZZ (high). But this is very expensive coding.

Is there any clue to do it in an easier way!

Thanks in advance!