2010 Jul 19 6:25 AM
Hi guys,
The below query is taking a lot of time to execute.The main problem is with table S022.This table is going for full table scan everytime even if we give a lot of selection criteria.So is there any alternate table for S022.In selection screen the mandatory fields are Location,plant and Phase.
SELECT a~aufnr "Order number
e~arbpl "Work center
e~plnum "Plaaned order
b~objnr "Object number
a~werks "plant
c~charg "Batch
d~gamng "qty
d~gmein "UOM
d~plnbez "Material
d~aufpl "routing no
d~aprio "Order priority
d~fevor "Responsible planner group/department
f~aufpl "Routing no
f~aplzl "general counter
f~vornr "Phase
f~arbid "workcenter
f~ltxa1 "text
g~objty "Object type
g~stand " Location
INTO CORRESPONDING FIELDS OF TABLE t_afpo
FROM ( ( ( ( ( s022 AS e
INNER JOIN aufk AS a ON aaufnr = eaufnr )
INNER JOIN jest AS b ON aobjnr = bobjnr )
INNER JOIN afpo AS c ON caufnr = aaufnr
AND awerks = cdwerk )
INNER JOIN afko AS d ON daufnr = caufnr
INNER JOIN afvc AS f ON faufpl = daufpl
AND fvornr = evornr )
INNER JOIN crhd AS g ON garbpl = earbpl
AND gobjid = farbid )
WHERE a~werks IN s_werks
AND d~plnbez IN s_matnr
AND d~fevor IN s_fevor
AND e~arbpl IN s_arbpl
AND e~aufnr IN s_aufnr
AND a~auart IN r_auart
AND e~ssavd IN s_date
AND e~vornr IN s_vornr
AND g~stand IN s_stand
AND a~loekz NE 'X'
AND b~stat = c_i0002
AND b~inact = space.
2010 Jul 19 7:09 AM
Hi,
i would suggest that dont put too many joins in the select statement..
if possible try to put mulitple select statements using "for all entries".
and also join the table only with key fields so that the data fetching will be more faster..
if you are not able to use the key fields try with index fields provided by SAP..
if that is also not working then create Zindex field for the table which is using more time to fetch the data.
Regards
JK
Hi guys,
The below query is taking a lot of time to execute.The main problem is with table S022.This table is going for full table scan everytime even if we give a lot of selection criteria.So is there any alternate table for S022.In selection screen the mandatory fields are Location,plant and Phase.
SELECT a~aufnr "Order number
e~arbpl "Work center
e~plnum "Plaaned order
b~objnr "Object number
a~werks "plant
c~charg "Batch
d~gamng "qty
d~gmein "UOM
d~plnbez "Material
d~aufpl "routing no
d~aprio "Order priority
d~fevor "Responsible planner group/department
f~aufpl "Routing no
f~aplzl "general counter
f~vornr "Phase
f~arbid "workcenter
f~ltxa1 "text
g~objty "Object type
g~stand " Location
INTO CORRESPONDING FIELDS OF TABLE t_afpo
FROM ( ( ( ( ( s022 AS e
INNER JOIN aufk AS a ON aaufnr = eaufnr )
INNER JOIN jest AS b ON aobjnr = bobjnr )
INNER JOIN afpo AS c ON caufnr = aaufnr
AND awerks = cdwerk )
INNER JOIN afko AS d ON daufnr = caufnr
INNER JOIN afvc AS f ON faufpl = daufpl
AND fvornr = evornr )
INNER JOIN crhd AS g ON garbpl = earbpl
AND gobjid = farbid )
WHERE a~werks IN s_werks
AND d~plnbez IN s_matnr
AND d~fevor IN s_fevor
AND e~arbpl IN s_arbpl
AND e~aufnr IN s_aufnr
AND a~auart IN r_auart
AND e~ssavd IN s_date
AND e~vornr IN s_vornr
AND g~stand IN s_stand
AND a~loekz NE 'X'
AND b~stat = c_i0002
AND b~inact = space.
2010 Jul 19 7:09 AM
Hi,
i would suggest that dont put too many joins in the select statement..
if possible try to put mulitple select statements using "for all entries".
and also join the table only with key fields so that the data fetching will be more faster..
if you are not able to use the key fields try with index fields provided by SAP..
if that is also not working then create Zindex field for the table which is using more time to fetch the data.
Regards
JK
2010 Jul 19 7:24 AM
Hi JK,
You mean to say Zindex for the SAP standard tables?..Please elaborate in detail.
2010 Jul 22 8:23 AM
Hi,
Sorry for the late response. i was on vacation.
yes.. we can create Zindex in the standard table which will act as an secondary index and will reterive the data faster.
Regards
JK
2010 Jul 27 12:28 PM
2010 Dec 22 6:18 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |