Skip to Content

Filter Operator : ABAP 740 New Syntax

Hello All

Getting error with Filter Operator.

I assume USING KEY is mandatory but with Default Key option Using Key can't be used.


And If I change the Default Key to Unique Key my VALUE operator starts to give error.

How to fix this ?

TYPES:
BEGIN OF lty_ord,
vbeln TYPE vbeln_va,
posnr TYPE posnr_va,
auart TYPE vbak-auart,
END OF lty_ord,

lty_ord_tab TYPE TABLE OF lty_ord WITH DEFAULT KEY.

* Prepare a Structure and a table using VALUE constructor operator.

DATA(wa_ord) = VALUE lty_ord( vbeln = '0000000001' posnr = '000010' auart = 'DT' ).


DATA(li_ord) = VALUE lty_ord_tab( ( vbeln = '0000000001' posnr = '000010' auart = 'TS' )
( vbeln = '0000000002' posnr = '000010' auart = 'TS' )
( vbeln = '0000000002' posnr = '000010' auart = 'TS' )
( vbeln = '0000000003' posnr = '000020' auart = 'FS' ) ).

DATA(li_ord_fliter) = FILTER lty_ord_tab( li_ord WHERE vbeln = '0000000001' AND posnr = '000010' AND auart = 'TS' ) .

error.png (12.7 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on May 11 at 06:38 AM

    The Filter Argument requires a sorted or hashed key.

    lty_ord_tab TYPE SORTED TABLE OF lty_ord WITH DEFAULT KEY.
    lty_ord_tab TYPE HASHED TABLE OF lty_ord WITH DEFAULT KEY.
    
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.