SELECT....FOR ALL ENTRIES
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?
Vinod Kumar replied
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.