2008 Nov 21 7:20 AM
Hi experts,
I am facing performance issue with the last select query, the one dealing with CE1US00.
SELECT brand
INTO TABLE gt_brand
FROM z0cx_brand
WHERE brand IN s_brand.
IF NOT gt_brand[] IS INITIAL.
SELECT matnr
mtart
zz_brand
INTO TABLE gt_mara
FROM mara
FOR ALL ENTRIES IN gt_brand
WHERE zz_brand = gt_brand-brand
AND matnr IN s_matnr
AND mtart IN s_mtart.
IF NOT gt_mara[] IS INITIAL.
SELECT perio
gjahr
artnr
bukrs
kokrs
werks
pstyv
wwbra
vv630
vv699
INTO TABLE gt_ce1us00
FROM ce1us00
FOR ALL ENTRIES IN gt_mara
WHERE artnr = gt_mara-matnr
AND wwbra = gt_mara-zz_brand
AND perio = p_perio
AND gjahr = p_gjahr
AND bukrs IN s_bukrs
AND kokrs IN s_kokrs
AND werks IN s_werks
AND pstyv = p_pstyv.
ENDIF.
ENDIF.
I don't have any more input field to use in where
condition.
Primary keys :
MANDT
PALEDGER
VRGAR
VERSI
PERIO
PAOBJNR
PASUBNR
BELNR
POSNR
index1
MANDT
VRGAR
RBELN
RPOSN
index2
MANDT
TIMESTMP
PAOBJNR
index3
MANDT
PAOBJNR
PERIO
index4
MANDT
BELNR
Please suggest something for the performance enhancement.
Hi experts,
I am facing performance issue with the last select query, the one dealing with CE1US00.
SELECT brand
INTO TABLE gt_brand
FROM z0cx_brand
WHERE brand IN s_brand.
IF NOT gt_brand[] IS INITIAL.
SELECT matnr
mtart
zz_brand
INTO TABLE gt_mara
FROM mara
FOR ALL ENTRIES IN gt_brand
WHERE zz_brand = gt_brand-brand
AND matnr IN s_matnr
AND mtart IN s_mtart.
IF NOT gt_mara[] IS INITIAL.
SELECT perio
gjahr
artnr
bukrs
kokrs
werks
pstyv
wwbra
vv630
vv699
INTO TABLE gt_ce1us00
FROM ce1us00
FOR ALL ENTRIES IN gt_mara
WHERE artnr = gt_mara-matnr
AND wwbra = gt_mara-zz_brand
AND perio = p_perio
AND gjahr = p_gjahr
AND bukrs IN s_bukrs
AND kokrs IN s_kokrs
AND werks IN s_werks
AND pstyv = p_pstyv.
ENDIF.
ENDIF.
I don't have any more input field to use in where
condition.
Primary keys :
MANDT
PALEDGER
VRGAR
VERSI
PERIO
PAOBJNR
PASUBNR
BELNR
POSNR
index1
MANDT
VRGAR
RBELN
RPOSN
index2
MANDT
TIMESTMP
PAOBJNR
index3
MANDT
PAOBJNR
PERIO
index4
MANDT
BELNR
Please suggest something for the performance enhancement.
2008 Nov 21 7:25 AM
Hi
U can use indexes of database table to make performance bit better.
Thanks
Vishal Kapoor
2008 Nov 21 9:11 AM
yeah i know that , but the problem is i don't have all the fields of the index.
2008 Nov 21 9:22 AM
Hi,
You should always try using primary index fields, if not possible then secondary index fields.
Even if you cannot do anything from either of the two then try this,
Use Less distinct fields on the top.
In your case , you can use bukrs ,gjahr ,werks on the top in the where condition..then followed by less distinct values..
Even when you use secondary index if you have 4 fields in your sec index and you are using only two fields from the top then the index is useful only upto that two fields provided they are in sequence.
2008 Nov 27 4:40 AM
I resolved this issue.
Actually i have removed for all entries and now i am using
the options from the selection screen in place of for all entries.
Here it was possible.