Application Development 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: 

select statement

Former Member
0 Kudos

hi,

if we hav 10000 records in a list.suppose we want to retrieve 6 records .,without using where clause in select statement. and also that records r stored in random places...how to retrieve without where clause.

thanx.

vijay

3 REPLIES 3

Former Member
0 Kudos

Hi,

You can <b>create view with condition</b> so that you have got all 6 record exactly.

Reg,

Hariharan Natarajan.

Former Member
0 Kudos

Hai Vijay,

If that Database table is having indxes,You can use them.

Indexes are not specified in the where clause.

Hers is sample code using indexes.Here index is on first column of Database table.

Have a look at this.

DATA:

xcarrid LIKE SPFLI-carrid,

xconnid LIKE SPFLI-connid,

xcityfrom LIKE SPFLI-cityfrom.

SELECT carrid connid cityfrom

FROM spfli

INTO (xcarrid, xconnid, xcityfrom)

WHERE carrid = 'LH ' AND cityfrom = 'FRANKFURT'

<b> %_HINTS ORACLE 'INDEX("SPFLI" "SPFLI~001")'</b>

.

WRITE: / xcarrid, xconnid, xcityfrom.

ENDSELECT.

This type of selection improves the performance a lot when the records are very high.

Hope this helps you.

<b>Reward points if it helps you.</b>

Regds,

Rama chary.Pammi

Sathish
Employee
Employee
0 Kudos

You can try with view maintenance...

the attached link has few suggestions which can be used..

https://wiki.sdn.sap.com/wiki/display/ABAP/ABAP+Performance