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 statement Optimisation.

Neslinn
Participant
0 Likes
403

Hi All,

I have the below code:

SELECT * FROM prps

INTO CORRESPONDING FIELDS OF TABLE lt_prps_temp

WHERE pbukr = g_bukrs.

But the internal table -LT_PRPS_TEMP contains the fields in PRPS but not in the same order. In this case how can i change the 'INTO CORREPONDING FIELDS' to 'INTO TABLE'.

Thanks & Regards,

Neslin.

2 REPLIES 2
Read only

Former Member
0 Likes
382

You can mention the field list in the select statement ratherthan giving SELECT * as it is a performance issue.

If you really need all the fields then you can give.

Avoid using into corresponding too.

Also if you can use primary key field PSPNR in the where clause that improves the performance drastically.

Thanks,

Srinivas

Read only

Former Member
0 Likes
382

Hi, you should replace

SELECT *

by

SELECT field1 field2 field3...

Where fieldn are the fields you have in internal table for prps.

Hope it helps.