Skip to Content
-1

ABAP CDS Where In clause

Mar 30 at 08:59 AM

54

avatar image

Hello Gurus,

Please how can we use the SQL WHERE IN clause in abap cds?

Thanks

Hasnaa

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

1 Answer

Gibran Roberto Martínez Santos Mar 30 at 03:51 PM
0

Tthe sentence in is very useful, however it has a limitation of 1500 records (depending on your database manager)

1 select the data of the in and insert them into a Z table to then perform a select with an inner join, this implies that you will have to handle the primary key

2 Select all the records in the table and then delete the records with a loop and a binary search.

It depends a lot on the data, usually what I do is

CLEAR VL_TFILL.

DESCRIBE TABLE IT_BSIK LINES SY-TFILL.

VL_TFILL = SY-TFILL.

LOOP AT IT_BSIK .

VL_SYTABIX = SY-TABIX .

R_LIFNR-SIGN = 'I'.

R_LIFNR-LOW = IT_BSIK-LIFNR.

R_LIFNR-OPTION = 'EQ'.

COLLECT R_LIFNR.

DESCRIBE TABLE R_LIFNR.

IF SY-TFILL GE 1000 OR VL_TFILL EQ VL_SYTABIX.

PERFORM F_SELPROV .

ENDIF.

ENDLOOP.

Share
10 |10000 characters needed characters left characters exceeded