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: 

help mseg

Former Member
0 Kudos

hi experts,

I want to get the mblnr, bwart, matnr, charg, menge, aufnr fields data from mseg table based on aufnr.

but aufnr is not key field it is taking so much time.

even secondary index is not working.

is there any other table where I can get these fields data other than mseg based on aufnr.

help required.

1 ACCEPTED SOLUTION

prasanth_kasturi
Active Contributor
0 Kudos

hi,

go to mseg table and you create a secondary index in that table with mandt and aufnr

start the name of secondary index with z

reward if helpful

prasanth

7 REPLIES 7

prasanth_kasturi
Active Contributor
0 Kudos

hi,

go to mseg table and you create a secondary index in that table with mandt and aufnr

start the name of secondary index with z

reward if helpful

prasanth

0 Kudos

U can create Secondary Index With any name , Only System will give u warning..

Former Member
0 Kudos

Hi Uday,

Just paste your code here so that we can help modify it.

0 Kudos

hi,

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: s_date FOR afko-gltrp. "start to finish date

SELECTION-SCREEN END OF BLOCK b1.

START-OF-SELECTION.

SELECT aufnr gstrp gltrp FROM afko INTO TABLE i_prod WHERE gltrp IN s_date.

IF sy-subrc EQ 0.

SELECT mblnr

mjahr

zeile

bwart

matnr

werks

lgort

charg

menge

meins

aufnr FROM mseg INTO TABLE i_mseg

FOR ALL ENTRIES IN i_prod WHERE aufnr = i_prod-aufnr

%_HINTS ORACLE 'INDEX("MSEG" "MSEG~ZPD")'.

fetching from mseg table is taking more time even after using secondary index.

0 Kudos

Are you sure that it is using the secondary index - have you checked in ST05? Database hints usually work but if you get the syntax wrong the system will ignore them and the only way I have got one to work is to use a slightly different syntax.

%_HINTS ORACLE 'INDEX("&TABLE&" "SETHEADER" "SETHEADER~2")'.

Personally, I would only create a new index on an important SAP standard table as a last resort. In your case, I would first try using the Controlling tables COEP / COBK, or COVP (a view of the two). COEP-OBJNR is indexed and holds the object reference of the AUFNR which you can get from AUFK.

0 Kudos

problem solved.

secondary index has been activated well & it is working fine.

Former Member
0 Kudos

hi uday,

what other selections or values do you obtain befire doing a SELECT on MSEG.

What selection criteria do you use in you report.

do let us know we can guide you on this .

Thanks

Venugopal