‎2012 Oct 04 1:11 PM
Hi,
I am fetching all fields of data from a generic buffered DB table into an internal table.
But when I perform a select * statement It bypasses the buffer and hits the DB each time i execute the program.
Here is the scenario:
This is what I do:
SELECT * from <DBTABLE>
INTO TABLE <ITAB>
WHERE <field1> = <value>.
But the above DBTABLE has generic keys: <field1> and <field2>
Hence it bypasses the buffer area and hits the DB.
the code inspector states that I have to specify all the generic key in the where clause of the select statement to use this type of buffering, But I want fetch all the fields without using
How should I use my code to access the buffer area and not bypass it?
‎2012 Oct 05 9:05 AM
Alright I guess I will have to read from the database only.
Thank you for the prompt response.
Regards,
Karan
‎2012 Oct 04 7:47 PM
Hi Karan,
I think you either have to change the buffering type or specify all fields of the generic area.
Best regards
Thorsten
‎2012 Oct 05 5:56 AM
Hi Thorsten,
In my scenario I have to fetch all data from a standard ABAP table, So I dont want to change the buffering type.
So is there any better way to get the all data into the internal table without specifying all the fields in the generic key fields. Because in my case field1 is LANGKEY, field2 and field3 values have are all different. I just want to fetch all the data in that table into the internal table without having specify all the generic key fields.
Thanks,
Karan
‎2012 Oct 05 8:17 AM
Hi,
with this statement we can't access the buffer. Maybe there are not all generic regions in the buffer.
As Thorsten said there is only the two options (changing buffer type, or add the 2nd field). Otherwise we will read from the database.
Kind regards,
Hermann
‎2012 Oct 05 9:05 AM
Alright I guess I will have to read from the database only.
Thank you for the prompt response.
Regards,
Karan
‎2012 Oct 05 9:25 AM
Hello Karan,
if the table is buffered, I guess it is not changed frequently. Can you do the analysis and check if the 2nd field of the table has only a limited set of values that is constant in your system? If it is the case, then I think you can build a table of values of the 2nd field and either check if "IN" list is working with the buffer, if not - do multiple SELECT statements with field1 = xxx and field2 = yyy.
Kind regards,
Yuri
‎2012 Oct 05 1:10 PM
Hey Yuri,
That did it. Thanks a ton.
Regards,
Karan
‎2012 Oct 05 1:17 PM
Hi,
i assume the multiple select (SELECT statements with field1 = xxx and field2 = yyy.) worked.... not the in list, right?
Kind regards,
Hermann
‎2012 Oct 08 12:13 PM
>If it is the case, then I think you can build a table of values of the 2nd field and either check if "IN" >list is working with the buffer
The IN bypasses the buffer, if it contains more than value (there is corresponding code inspector check).
LOOP AT itab_field2 INTO wa2.
SELECT statements with field1 = xxx and field2 = wa2.
ENDLOOP.
would work and can be useful, if the values of field2 come from a small customizing table.
‎2012 Oct 08 4:02 PM
Hi Siegfried,
You are right, the 'IN' construct bypasses the buffer.
Thanks for the idea for using a customizing table.
Regards,
Karan