‎2008 Feb 16 7:01 PM
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
‎2008 Feb 16 7:29 PM
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
‎2008 Feb 18 7:33 AM
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 !!!!!!!!