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

Performance issue with a select query.....on ce1us00.

amit_singh20
Explorer
0 Likes
596

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.

4 REPLIES 4
Read only

Former Member
0 Likes
555

Hi

U can use indexes of database table to make performance bit better.

Thanks

Vishal Kapoor

Read only

0 Likes
555

yeah i know that , but the problem is i don't have all the fields of the index.

Read only

0 Likes
555

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.

Read only

0 Likes
555

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.