abapsap-data-dictionary

Combine conditions in table expression?


I am using the line_index function and would like to search for two values, not only for carrid but also for connid. Is it possible? If so, in what way?

Because right now, this works:

lv_index = line_index( lt[ carrid = 'LH' ] ).

But after adding the code [ connid = '2407' ] like this:

lv_index = line_index( lt[ carrid = 'LH' ][ connid = '2407' ] ).

I get a syntax error:

LT[ ] is not an internal table


Solution

  • All fields (conditions) just one after the other inside one bracket:

    lv_index = line_index( lt[ carrid = 'LH'
                               connid = '2407' ] ).