Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Former Member
replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question