Application Development 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: 

Reading table S026

Former Member
0 Kudos

Hello;

Is there a faster way to read table S026(material consumptions table)? My select statement is as follows but it takes too much time to read.

select s026matnr s026werks s026~mcomp

into (s026-matnr, s026-werks, s026-mcomp)

from s026 client specified

where vrsio = '000' and

ssour = space and

mandt = sy-mandt and

werks in werks and

mcomp in mcomp and

sptag in dates.

........

........

endselect.

Thanks in advance.

Ali abbasgil

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

As we are not specifying all the key fields, it is taking much time. Check if there are secondary indexes on that table. Specify that index while selecting data using HINT statement.

Regards,

Sailaja.

4 REPLIES 4

Former Member
0 Kudos

hi,

As we are not specifying all the key fields, it is taking much time. Check if there are secondary indexes on that table. Specify that index while selecting data using HINT statement.

Regards,

Sailaja.

former_member181962
Active Contributor
0 Kudos

Try this:

data: begin of t_s026 occurs 0,

matnr like s026-matnr,

werks like s026-werks,

mcomp like s026-mcomp,

end of t_s026.

select matnr werks mcomp

into table t_s026

from s026 client specified

where mandt = sy-mandt and

ssour = space and

vrsio = '000' and

sptag in dates and

werks in werks and

mcomp in mcomp.

Regards,

ravi

Former Member
0 Kudos

try not to use select-endselect....it'l affect performance.instead use the following.

data : s026 like table of s026 with header line.

select s026matnr s026werks s026~mcomp

into corresponding fields of table s026

from s026 client specified

where vrsio = '000' and

ssour = space and

mandt = sy-mandt and

werks in werks and

mcomp in mcomp and

sptag in dates.

........

........

u need not use append.this will put the data directly into the table n not the work area

0 Kudos

Instead of using ABAP, try using the Report Painter. Once the table has been installed for report painter, it should be good to go for any flexible reporting by the user.

Good luck.