Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Generic Buffering issue

former_member217916
Participant
0 Likes
1,353

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?

1 ACCEPTED SOLUTION
Read only

former_member217916
Participant
0 Likes
1,179

Alright I guess I will have to read from the database only.

Thank you for the prompt response.

Regards,

Karan

9 REPLIES 9
Read only

schneidertho
Product and Topic Expert
Product and Topic Expert
0 Likes
1,179

Hi Karan,

I think you either have to change the buffering type or specify all fields of the generic area.

Best regards

Thorsten

Read only

0 Likes
1,179

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

Read only

HermannGahm
Product and Topic Expert
Product and Topic Expert
0 Likes
1,179

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

Read only

former_member217916
Participant
0 Likes
1,180

Alright I guess I will have to read from the database only.

Thank you for the prompt response.

Regards,

Karan

Read only

0 Likes
1,179

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

Read only

0 Likes
1,179

Hey Yuri,

That did it. Thanks a ton.

Regards,

Karan

Read only

0 Likes
1,179

Hi,

i assume the multiple select (SELECT statements with field1 = xxx and field2 = yyy.) worked.... not the in list, right?

Kind regards,

Hermann

Read only

0 Likes
1,179

>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.

Read only

0 Likes
1,179

Hi Siegfried,

You are right, the 'IN' construct bypasses the buffer.

Thanks for the idea for using a customizing table.

Regards,

Karan