2007 Dec 12 11:19 AM
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
2007 Dec 12 11:28 AM
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
2007 Dec 12 2:15 PM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |