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

Index on View

Former Member
0 Likes
5,063

Hi All,

Is it possible to create an index on View tabel.

13 REPLIES 13
Read only

Former Member
0 Likes
2,909

Hello

It is impossible.

Because View is not table.

Read only

0 Likes
2,909

I m having a program with select statement, which is trying to retrieve data from view. since all the key field of the view are not used for data retrival, select statement is taking hell lot of time.

Please suggest what to do?

Read only

0 Likes
2,909

there are lot of methods for the optimization

paste down your select query

Read only

0 Likes
2,909

As I suggested above create index for the table that is taking much time for execution(finout by using ST05) in your view,I used same in my program it is taking less time compare to before index.

Read only

0 Likes
2,909

It's a standard SAP program in transaction Iw37.

Read only

0 Likes
2,908

wait or create an additional index on the tables with the fields you do the select on

within se11 you can create new indexs

and if it's iw37 pleasy fill in the ordertype and werks that helps speeding up the select

Edited by: A. de Smidt on Jul 16, 2008 11:58 AM

Edited by: A. de Smidt on Jul 16, 2008 11:59 AM

Read only

0 Likes
2,908

SELECT (g_selfields_tab) FROM viafvc

INTO CORRESPONDING FIELDS OF TABLE ht_viafvc_st

WHERE arbid IN arbid

AND werks IN werks

AND steus IN steus

AND ktsch IN ktsch

AND ltxa1 IN ltxa1

AND istru IN istru

AND anlzu IN anlzu

AND rueck IN rueck

AND fsavd IN fsavd

AND fsavz IN fsavz

AND ssavd IN ssavd

AND ssavz IN ssavz

AND fsedd IN fsedd

AND fsedz IN fsedz

AND isdd IN isdd

AND isdz IN isdz

AND iedd IN iedd

AND iedz IN iedz

Read only

0 Likes
2,908

replace that corresponding keword

1>arrange the structure of your internal table similar to the select statement

2>Do you want to retrive all the fields ?if no then specify the name of the fields here.

Read only

0 Likes
2,908

SELECT (g_selfields_tab) FROM viafvc

INTO CORRESPONDING FIELDS OF TABLE ht_viafvc_st

WHERE arbid IN arbid

AND werks IN werks

AND steus IN steus

AND ktsch IN ktsch

AND ltxa1 IN ltxa1

AND istru IN istru

AND anlzu IN anlzu

AND rueck IN rueck

AND fsavd IN fsavd

AND fsavz IN fsavz

AND ssavd IN ssavd

AND ssavz IN ssavz

AND fsedd IN fsedd

AND fsedz IN fsedz

AND isdd IN isdd

AND isdz IN isdz

AND iedd IN iedd

AND iedz IN iedz

%_hints oracle 'INDEX("MSEG" "MSEG~ZMS")'.

let MSEG is one of table in your view and ZMS is the index.

try to do index for AFVV or AFVC by checking which one is taking muchtime.

Edited by: SnickyUcan on Jul 16, 2008 12:03 PM

Read only

christine_evans
Active Contributor
0 Likes
2,908

A database view is not a table. It is effectively a join between tables that is defined in the database rather than locally in your program. You can, of course, create indexes on the tables - though if they are SAP standard tables you should consider carefully whether a new index is really necessary.

Read only

Former Member
0 Likes
2,908

Hi

You can create index only on tables.

and view is not a table. so you cannot create index on views.

With Regards

Nikunj.

Read only

Former Member
0 Likes
2,908

Just goto view

and see if you can find and any tab for view???

i hope you got the answer.

Its not possible.

Read only

former_member125931
Active Participant
0 Likes
2,908

Create index for any table that your view table contains,you can use it in your select query.