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

Former Member
0 Likes
628

In reports

select end select is preferable

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
600

hi

chk this

5 REPLIES 5
Read only

Former Member
0 Likes
600

it depends on the data fetching.

u can use select * from table or else select <fields> from table if u have less data or else master data.

select...endselect is used for hughe tables like BSEG, BSID, BSAD, MSEG tables.

Read only

Former Member
0 Likes
600

Hi

Don't use SELECT..ENDSELECT

use INTO TABLE internal table

and with the necessary field sin the internal Table

see this

1) Dont use nested seelct statement

2) If possible use for all entries in addition

3) In the where addition make sure you give all the primary key

4) Use Index for the selection criteria.

5) You can also use inner joins

6) You can try to put the data from the first select statement into an Itab and then in order to select the data from the second table use for all entries in.

7) Use the runtime analysis SE30 and SQL Trace (ST05) to identify the performance and also to identify where the load is heavy, so that you can change the code accordingly

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5d0db4c9-0e01-0010-b68f-9b1...

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
600

Hi Rajamehender,

Select ..Endselect is used depending upon the requirement.

If u want to check each data in the table . then use it.

generally it is not used. it increases the execution time.

In place of sel endsel populate whole data in to internal table directly.

SELECT * FROM mara <b>table INTO iab</b>

WHERE matnr in s_matnr.

Reward points if helpful.

Regards,

Hemant

Read only

Former Member
0 Likes
600

hi,

if we are using

select * from table itab where <condition>.

then we need not have to give select

endselect.

if we give

select * from itab where <condition>

endselect.

reward with points if helpful.

Read only

Former Member
0 Likes
601

hi

chk this