Dynamic SELECT with FOR ALL ENTRIES IN: take 2
we are now having a bit of new trouble with the following SELECT ... special thanks to Raul and Suhas for their previous contributions.
... FIELD-SYMBOLS: <itab1> TYPE standard table. ASSIGN ATTR_T_I->* TO <itab1>. select FIELD1 FIELD2 from DBTAB1 into CORRESPONDING FIELDS OF table <itab1> FOR ALL ENTRIES IN <itab1> where (condition). ...
ATTR_T_I is a static attibute of type table containing 10 records where all records have FIELD1 and FIELD2 empty.
The select finds in DBTAB1 entries fulfilling the 'condition' for 8 of the above 10 records in ATTR_T_I.
Hence, after the select 8 of the 10 records in ATTR_T_I have the fields FIELD1 and FIELD2 filled (ie not empty).
So far so good!
BUT: the 2 remaining records (i.e. those without entries in DBTAB1 fullfilling 'condition') have been deleted! Why? This is not what we want nor expected.
Any ideas out there how to fix this?