Skip to Content
0
Former Member
Feb 26, 2014 at 07:42 AM

Endroutine lookup with interval logic

19 Views

Hello experts

I wrote an endroutine which lookups a field from a standard DSO: ZWWSIC.

For the WHERE condition it checks if ZPR_FROM and ZPR_TO are equal to the result field.

This works fine.

But unfortunately ZPR_FROM and ZPR_TO sometimes is an intervall consisting of more than 2 values.

How can I implement an intervall logic comparison in the code below.

LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
LOOP AT ITAB INTO WA
WHERE /BIC/ZPR_FROM = <RESULT_FIELDS>-/BIC/ZWWPRD
OR /BIC/ZWWPR_TO = <RESULT_FIELDS>-/BIC/ZWWPRD.

<RESULT_FIELDS>-/BIC/ZWWSIC = WA-/BIC/ZWWSIC.
<RESULT_FIELDS>-/BIC/ZZBRARW1 = <RESULT_FIELDS>-/BIC/ZZBRARW1.
<RESULT_FIELDS>-/BIC/ZZBRARW = <RESULT_FIELDS>-/BIC/ZZBRARW.
<RESULT_FIELDS>-/BIC/ZZBRA1 = <RESULT_FIELDS>-/BIC/ZZBRA1.
<RESULT_FIELDS>-/BIC/ZZBRA = <RESULT_FIELDS>-/BIC/ZZBRA.
<RESULT_FIELDS>-/BIC/ZWWPRD = <RESULT_FIELDS>-/BIC/ZWWPRD.
<RESULT_FIELDS>-RECORD = ICOUNT.

ICOUNT = ICOUNT + 1.
APPEND <RESULT_FIELDS> TO ITAB_TARGET.
ENDLOOP.
ENDLOOP.