Skip to Content
0
Mar 14, 2021 at 01:30 PM

Dynamic where in range

61 Views

Hello experts,

I need to loop on an internal table with a dynamic where. The where should contain 'in range'.

For example, Instead of writing

DATA: lrng TYPE RANGE OF bkpf-blart.
LOOP AT <lt_bkpf> ASSIGNING FIELD-SYMBOL(<ls_bkpf>) WHERE blart IN lrng.

I want to write something like:

rng_fld_name = 'LRNG'.
ASSIGN (rng_fld_name) TO FIELD-SYMBOL(<rng>).
DATA(lv_where) = 'BLART IN ' && <rng>.
LOOP AT <lt_bkpf> ASSIGNING FIELD-SYMBOL(<ls_bkpf>) WHERE (lv_where).

The problem is that the above raises a dump in runtime

err.png

The dump is logical. But how can I write it correctly?

Thanks in advance,

Hagit

Attachments

err.png (8.3 kB)