Skip to Content
0
May 11, 2020 at 04:59 AM

Filter Operator : ABAP 740 New Syntax

75 Views

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' ) .

Attachments

error.png (12.7 kB)