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

Selection Logic

varun_maharshi
Active Participant
0 Likes
945

I have this particular requirement I need to select the values from the REGUP table with SGTXT which I have values for that and LAUFI which ends with R.

What is the best possible way to the selection which gives good performance as this is an interface which is pefromance intensive.

Please help. Points will be awarded for the right help.

10 REPLIES 10
Read only

Former Member
0 Likes
910

Hi Varun,

select *

from regup

into table it_regup

where laufi like '%R'

and sgtxt in s_sgtxt.

Regards,

Ravi

Read only

0 Likes
910

Does that give performance. This table contains a large number of records as this is a utility company

Read only

0 Likes
910

As long as this statement is not inside a loop statement or another select-endselect statement,

It doesn't hurt performance much.

Regards,

Ravi

Read only

0 Likes
910

The thing is that I am not selecting REGUP directly from values of the Selection screen. I need to select the records with help of the key from values of BSAK table which is also huge amount of data. So does this statement can hold that much amount of data?

Read only

0 Likes
910

Not sure if performance will be better or not. Give it a try using a range.




 report zrich_0001.

 data: it_regup type table of regup with header line.

 select-options s_sgtxt for it_regup-sgtxt.

 ranges: r_laufi for it_regup-laufi.

 clear r_laufi.
 r_laufi-sign = 'I'.
 r_laufi-option = 'CP'.
 r_laufi-low    = '*R'.
 append r_laufi.

 select * from regup into table it_regup
             where laufi in r_laufi
              and sgtxt in s_sgtxt.


 check sy-subrc  = 0.

Regards,

Rich Heilman

Read only

0 Likes
910

Hi Varun,

Practically the limit set to the internal table capacity would be sufficiently large .

But then, we cannot judge what is the performance of a select statement without seeing it in the bigger picture.

Regards,

Ravi

Read only

Former Member
0 Likes
910

use like option in where clause.

<b>where laufi like '%R'</b>

Regards

vijay

Read only

0 Likes
910

Right now we dont have that much amount of data to test that. Thats why I am very much concerned about this select. Does this thing will help by creating an index on sgtxt and selecting the values with that and then weeding out the values which do not have LAUFI with R at end. Which will be better.

Read only

0 Likes
910

Yes, the option of weeding out the entries without an R at the end would be a better option , as this operation would not be at the database level(Which consumes more time).

select *

from regup

into t_regup

where <where cond>.

delete itab where laufi cp '*R'.

Regards,

Ravi

Read only

former_member181966
Active Contributor
0 Likes
910

Yes you can select on table and in selection you can say

Select from table where LAUFI like '%R%' and SGTXT in your_values.

e,g

Select * from regup INTO CORRESPONDING FIELDS OF wa where LAUFI like '%R%' .

endselect.

Hope this’ll give you idea!!

<b>P.S award the points.</b>

Good luck

Thanks

Saquib Khan

"Some are wise and some are otherwise"