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: 

mseg table read taking much time (ALTERNATIVE ??)

Former Member
0 Kudos

hi experts,

<b>SELECT mblnr mjahr

zeile

bwart

kdauf

kdpos

werks

erfmg

xauto

FROM mseg

INTO TABLE gt_mseg

FOR ALL ENTRIES IN gt_vbap

WHERE bwart IN (641, 101, 102)

AND kdauf = gt_vbap-vbeln

AND kdpos = gt_vbap-posnr

AND werks = gt_vbap-werks.</b>

Here in in my case mseg has 7 lakh records and vbap has 5000 record..

report is taking hell of a time to give an output..

is there any way to fine tune it

pls help me on this.

i want only erfmg field from mseg so is there any other table from where i can get the same..

points will be rewarded

Thnx,

Rajan Mehta

3 REPLIES 3

Former Member
0 Kudos

hi rajan,

create secondary index on mseg table.

Cheers,

Chandra

Former Member
0 Kudos

Hi Rajan

Check the table MSEG already has any secondary indices(Index). If yes try to change the select so that the correct index is chosen. Otherwise if your team is ok with a new index in production make a new index.

Also check the possibility of using the fields MJAHR and ZEILE in your select if you know the document year.

Regards,

Arun

Former Member
0 Kudos

Hi

Create a index on mseg using all the fields that u r passing from VBAP.

that must reduce the search time.

Another option is to create view on MSEG anf VBAP.

alternatively u can also write select query using join on mseg and vbap.

tc

saji