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

INDEXES

Former Member
0 Likes
474

hi all,

i want to create the secondary index on mseg table.

here i am having select stament like this...

which fields can i select in the secondary index.

give me a brief explain.

SELECT MSEG~MBLNR

MSEG~BWART

MSEG~WERKS

MSEG~SHKZG

MSEG~MATNR

MSEG~ERFMG

MSEG~UMWRK

MKPF~MBLNR

MKPF~BUDAT

MSEG~XAUTO

MSEG~EBELN

INTO TABLE I_3MSEG

FROM MSEG

INNER JOIN MKPF

ON MSEGMBLNR = MKPFMBLNR

WHERE MSEG~BWART IN ('301')

AND MSEG~MATNR IN S_MATNR

AND MSEG~WERKS IN S_SPLANT

AND MSEG~UMWRK IN S_RPLANT

AND MKPF~BUDAT IN S_AEDAT

AND MSEG~XAUTO <> 'X'

AND MSEG~EBELN IN S_EBELN.

Regards..

Anand.N

hi all,

i want to create the secondary index on mseg table.

here i am having select stament like this...

which fields can i select in the secondary index.

give me a brief explain.

SELECT MSEG~MBLNR

MSEG~BWART

MSEG~WERKS

MSEG~SHKZG

MSEG~MATNR

MSEG~ERFMG

MSEG~UMWRK

MKPF~MBLNR

MKPF~BUDAT

MSEG~XAUTO

MSEG~EBELN

INTO TABLE I_3MSEG

FROM MSEG

INNER JOIN MKPF

ON MSEGMBLNR = MKPFMBLNR

WHERE MSEG~BWART IN ('301')

AND MSEG~MATNR IN S_MATNR

AND MSEG~WERKS IN S_SPLANT

AND MSEG~UMWRK IN S_RPLANT

AND MKPF~BUDAT IN S_AEDAT

AND MSEG~XAUTO <> 'X'

AND MSEG~EBELN IN S_EBELN.

Regards..

Anand.N

2 REPLIES 2
Read only

Former Member
0 Likes
457

hi

In below select statement, u r not using any key fields like MBLNR,

MJAHR ,ZEILE in condition. So it should give some performance problem. You can take BWART,XAUTO,MATNR,WERKS,LGORT fields in secondary index as the same order.

Reward if it dose.

Thanks

Siva Kumar

Read only

Former Member
0 Likes
457

I wouldn't create a secondary index on a standard SAP table just to speed up one SELECT statement. There is overhead to the creation of indexes. Try to find a programming solution. Can you ensure that S_MATNR is not empty before the SELECT? What about S_EBELN?

Rob