Skip to Content
-1

Error when trying to use new Abap 7.40 : FILTER #

May 03 at 03:20 PM

69

avatar image
Former Member

Hello,
Using the new abap 7.40 capabilities, I'm trying to copy an internal table to another with a condition on a column.
And I receive this error :
Table "" does not have a key "PLNNR". A direct value or a dynamically specified key of the form "(name)" is expected.


Here is the structure of my table :
MANDT MANDT / KEY
PLNNR PLNNR / KEY
COUNTER ZCOUNTER / KEY
SUBMETHOD ZSUBMETHOD
DELETED ZDELFLAG

And following is the code :

DATA : lt_tmp_submethods TYPE TABLE OF zqm_les_jl_subm. 
DATA : lt_tmp_submethods_2 TYPE SORTED TABLE OF zqm_les_jl_subm 
WITH NON-UNIQUE KEY plnnr.

LOOP AT xtab ASSIGNING FIELD-SYMBOL(<jl_submeth>).
lt_tmp_submethods = FILTER #( lt_tmp_submethods_2 USING KEY 
plnnr WHERE plnnr = <jl_submeth>-plnnr ).
ENDLOOP.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Horst Keller
May 03 at 05:47 PM
0

Your internal table indeed has no secondary key named plnnr. It has only a primary key with a key field plnnr.

Read the documentation about internal table keys!

Your code might work with USING KEY primary_key.

https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenconstructor_expr_filter_basic.htm

Share
10 |10000 characters needed characters left characters exceeded