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

upto 1 rows

Former Member
0 Likes
792

Is the following statement possible to re-write using UPTO 1 ROWS instead of using select single?

SELECT * FROM tcurf INTO TABLE i_tcurf

FOR ALL ENTRIES IN i_t005

WHERE kurst = 'M'

AND fcurr = i_t005-waers

AND tcurr = gv_curr

AND gdatu => w_likp-erdat.

Please help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
760

If you are having all the Key Fields for the where condition you can use select single Statement.

If you are not having all the key fields it is good to use UP TO 1 rows for better performance.it will not show warning message in the extended check.

Both will retrieve only one record.

For your case you can use select single statement since all the Key fields are used in the where condition.

Regards

Raghu

Edited by: dearvirus on Nov 3, 2008 6:40 PM

Is the following statement possible to re-write using UPTO 1 ROWS instead of using select single?

SELECT * FROM tcurf INTO TABLE i_tcurf

FOR ALL ENTRIES IN i_t005

WHERE kurst = 'M'

AND fcurr = i_t005-waers

AND tcurr = gv_curr

AND gdatu => w_likp-erdat.

Please help.

5 REPLIES 5
Read only

Former Member
Read only

raja_narayanan2
Active Participant
0 Likes
760

Hi.....

Even though it has many entries...that matches your condition, if you use UP TO 1 ROWS i will select the first row from that matching condition....

Its based on your requirement.....

Regards

Raja

Read only

raviprakash
Product and Topic Expert
Product and Topic Expert
0 Likes
760

>

> Is the following statement possible to re-write using UPTO 1 ROWS instead of using select single?

>

> SELECT * FROM tcurf INTO TABLE i_tcurf

> FOR ALL ENTRIES IN i_t005

> WHERE kurst = 'M'

> AND fcurr = i_t005-waers

> AND tcurr = gv_curr

> AND gdatu => w_likp-erdat.

>

> Please help.

Hi sap_kolkata06,

Yes the statement written by you can be rewritten using the addition upto 1 rows. There is not harm in writting so. It will only output a single record in that case.

Regards,

Ravi.

Read only

Former Member
0 Likes
760

For performance perspective, i suggest you to go for select single option.

-Siva

Read only

Former Member
0 Likes
761

If you are having all the Key Fields for the where condition you can use select single Statement.

If you are not having all the key fields it is good to use UP TO 1 rows for better performance.it will not show warning message in the extended check.

Both will retrieve only one record.

For your case you can use select single statement since all the Key fields are used in the where condition.

Regards

Raghu

Edited by: dearvirus on Nov 3, 2008 6:40 PM