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

Please help me tune this program,

Former Member
0 Likes
591

Hi.

I have a item master data table and a transaction table.

For a given criteria I have to find items from master data table which do no exits in transaction table.

I have listed my flow below, can you please advice if there is any other optimal way of doing it.

1. For the given criteria read items from master data table into internal table 1. Sort the internal table 1.

2. For the given criteria read items from transaction table into internal table 2. Sort and remove duplicates from the internal table 2.

3. Loop at internal table 1, and check if item exists in internal table 2. Append items not in internal table 2 into another internal table 3.

At the end internal table 3 will have the items I am interested in. I can sort and use binary search addition, but is there any other efficient way of doing this task.

Thank you,

CD

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
565

Don't use standard tables !!!!!!! They are o.k. in old coding in new coding you should

use only sorted and hashed tables and performance works automatically !!!

Forget about sorting and deleting duplicates !

> remove duplicates from the internal table 2.

use a hashed table with a unique key and collect you entries in the hash table,

Use sorted tables if the key is non-unique, or if the need also parts of the key!

Use hashed tables if the key must be unique.

Even for the append it is possible to APPEND into a sorted table, the records must come in a sort

order, i.e. if they come from a sorted table then it is o.k.

What I write is not imagination but the only really commendable way of handling internal tables.

Siegfried

5 REPLIES 5
Read only

Former Member
0 Likes
565

Nothing..its jus very straight forward!

Read only

0 Likes
565

Thanks, both master and transaction table are very large,

Though I will as much selections I can while loading internal table,

But just want to figure out if there is any better alogorithm to do this task.

thanks,

CD

Read only

Former Member
0 Likes
565

Your flow is correct . Go ahead . To avoid Performance Issues try to get the values of all the key fields of the table from the user via Selection Screen , so that your DB fetch will be faster . Looping and finding out the odd with not take much time.

Read only

Former Member
0 Likes
565

Moved to the proper forum.

Also please try to use an informative subject.

Rob

Read only

Former Member
0 Likes
566

Don't use standard tables !!!!!!! They are o.k. in old coding in new coding you should

use only sorted and hashed tables and performance works automatically !!!

Forget about sorting and deleting duplicates !

> remove duplicates from the internal table 2.

use a hashed table with a unique key and collect you entries in the hash table,

Use sorted tables if the key is non-unique, or if the need also parts of the key!

Use hashed tables if the key must be unique.

Even for the append it is possible to APPEND into a sorted table, the records must come in a sort

order, i.e. if they come from a sorted table then it is o.k.

What I write is not imagination but the only really commendable way of handling internal tables.

Siegfried