Skip to Content
Nov 01, 2016 at 08:29 PM

SELECT default values with FOR ALL ENTRIES option

124 Views Last edit Oct 27, 2016 at 03:53 PM 2 rev

Hello All,

I am trying to construct a range table while fetching the data from database as below using default values for some fields:

TYPES: BEGIN OF ty_ranges,
         sign   TYPE ddsign,
         option TYPE ddoption,
         low    TYPE string,
         high   TYPE string,
       END OF ty_ranges.

DATA: lr_plants TYPE TABLE OF ty_ranges.

SELECT 'I' AS sign, 'EQ' AS option, werks AS low
  INTO TABLE @lr_plants
  FROM t001w.

But the problem is I cannot use FOR ALL ENTRIES option with this. I could not find any details on ABAP keyword documentation on this restriction.

I am curious to know why. Is there a performance issue? And, is there any other way to achieve this? (I am aware of using LOOP after the SELECT statement. I am trying to avoid that).

Thank you