Skip to Content
-1

ABAP CDS Where In clause

Hello Gurus,

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

Thanks

Hasnaa

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • 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.

    Add comment
    10|10000 characters needed characters exceeded