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

optimizing the query

Former Member
0 Likes
425

Hi All,

I would like to know what would be alternate table or optimal way to make the following queries work in a more efficient manner.

1) select sfakn from vbrk into table tl_sfakn for all entries in tl_vbrp WHERE sfakn = tl_vbrp-vbeln.

2) SELECT vbeln FROM vbrp INTO TABLE tl_vbrp FOR ALL ENTRIES IN tl_vbap[] WHERE vgbel = tl_vbap-vbeln.

any help would be appreciated.

thanks

vij

2 REPLIES 2
Read only

Former Member
0 Likes
400

You'll get more answers if you mark this as a question.

You are not using indexes and I don't see any you can use, so run it in the background.

Rob

Read only

Former Member
0 Likes
400

Hi

The first and foremost thing u need to care about is to take the all the key fields Of Billing document Header Table vbrk (i.e. vbeln ) .This is the most common way to improve the performance of SQL Query .There is another road is out .If u have no option to use the key fileds

Better to Create a secondary Index (like here sfakn ) though its a very bad habit. Next For the Billing Document Item data Table always use the header table references .Its the best way to tune the code.Though You are using here One of the key fileds vbeln but still another key field

is left though its quite good to use atleast one key field.

If usefull Exepecting Rewards !!!!!!!!