Skip to Content
avatar image
Former Member

SELECT....FOR ALL ENTRIES

Hi SDN,

I am a BI developer and face the following problem.

I have a statement SELECT.FROM...INTO CORRESPONDING FIELDS OF itab_A..FOR ALL ENTRIES IN itab_B....WHERE.

Due to a certain scenario, there are no records in itab_B and I get an error message from SAP BI system that duplicate keys are being entered into the target itab_A.

For itab_A the dump shows TABLE[initial]. Does it mean it had no records?

If so, how could the statement cause duplicate rows in itab_A? I mean, if FOR ALL ENTRIES IN returns 0, records, shouldn't that cause no records in itab_A, much less an error message of duplicate keys?

Please advise.

Thanks.

SM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 12, 2010 at 05:25 PM

    Hi,

    FOR ALL ENTRIES automatically deletes duplicates based in selected field list. How u have defined your itab? does your itab has explicit key defined? Try to define your itab as TYPE STANDARD TABLE OF.

    Thanks,

    Vinod.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

      If FOR AL ENTRIES internal table is initial, WHERE condition is ignored and all the records will be extracted from the table against which SELECT statement is executed. Before using FOR ALL ENTRIES, it is mandatory to check whether this table is initial or not.

      Regards

      Vinod