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

Select Query

Former Member
0 Likes
943

Dear all

I have a doubt in Select query while using INDEXES.My index name is 'B' and in that index the field order is like

Matnr

Werks

lgort...

Suppose in my 'Where Clause' i am just giving like

where werks in s_werks and

lgort in s_lgort... i mean i am avoiding the first field of the index.

i want to know in this cause it will follow the index or it will bypass.

Please help me....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
926

Hi,

No problem . It will follow the index.In where class if it is in order the performance will be more.

If in order checking of the fields will be in order .So cursor will move ahead.If disorder the cusrsor will move fornt for one field and come back for other field.So poor performance.....

6 REPLIES 6
Read only

Former Member
0 Likes
927

Hi,

No problem . It will follow the index.In where class if it is in order the performance will be more.

If in order checking of the fields will be in order .So cursor will move ahead.If disorder the cusrsor will move fornt for one field and come back for other field.So poor performance.....

Read only

0 Likes
926

Thanks Murali.. And one more thig is, is there any change in the case of MANDT field.. I mean in the index if the first field is 'MANDT' is there any change.. please tell that also..

thanks

Read only

0 Likes
926

Hi,

No change.MANDT field should always be in first position.

Read only

0 Likes
926

Hi Murali

Thanks a lot for quick reply.. But plz understand my Qn.. if the field order in the INDEX is like

MANDT

Matnr

werks... at this moment can i use

where matnr in s_matnr

and werks in s_werks...

whether it will follow the index or nor. Or it is necessary that i should write the MANDT at first to follow the index... that is my question... plz answer this also..

thanks..

Read only

0 Likes
926

Hi,

No need to write MANDT in where condition.Because by default selection statement will select the records of login client only you can not select the other clients.If you want to select other client data you have to write syntax in seletion statement

SELECT *

INTO table itab

FROM table name CLIENT SPECIFIED

WHERE mandt = '000'.

Pls. reward if useful.....

Read only

Former Member
0 Likes
926

Hi,

There wont be any problem while selecting records. But, u will end up in performance error when u do code inspector check.

Reward if helpful.

Regards,

Ramya