05-30-2008 9:05 AM
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.
05-30-2008 9:25 AM
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
05-30-2008 9:25 AM
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
05-30-2008 9:32 AM
U can create Secondary Index With any name , Only System will give u warning..
05-30-2008 9:31 AM
05-30-2008 10:02 AM
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.
05-30-2008 10:20 AM
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.
05-30-2008 12:12 PM
problem solved.
secondary index has been activated well & it is working fine.
05-30-2008 9:37 AM
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