‎2008 Feb 23 8:54 AM
Dear experts,
i have four ztables and i have maintanig relation b/w four tables
table1 (Comp table key field is srno) and
table2 (projects table key field psno and relation field is srno)
table3 (jobs table key jsno and relation fields srno and psno)
table4( equipment table key esno and relation fields srno,psno,jsno)
actually i'm developing report for these tables
please tell me how can i maintain loops for this report please help me i tryed in diff ways but i'm gettin problem with clear data and append data please tell me d sol otherwise i will send detailed info
‎2008 Feb 23 9:04 AM
>
> Dear experts,
> i have four ztables and i have maintanig relation b/w four tables
> table1 (Comp table key field is srno) and
> table2 (projects table key field psno and relation field is srno)
> table3 (jobs table key jsno and relation fields srno and psno)
> table4( equipment table key esno and relation fields srno,psno,jsno)
> actually i'm developing report for these tables
> please tell me how can i maintain loops for this report please help me i tryed in diff ways but i'm gettin problem with clear data and append data please tell me d sol otherwise i will send detailed info
hi,
you are getting data from four database tables
so its best method to declare internal tables for all the four tables.
then you have to code selecet statements for four tables.
select * from table1 into table itab where f1 = field1.
select * from table2 into table jtab where f2 = field2.
select * from table3 into table ktab where f3 = field3.
select * from table4 into table ltab where f4 = field4.
now code loop statement.
loop at ltab.
read table itab with key f1 = field1.
read table jtab with key f2 = field2.
read table ktab with key f3 = field3.
read table ltab with key f4 = field4.
endloop.
this is the best method to avoid multiple loop statements.
Regards,
swaminat.
‎2008 Feb 23 9:04 AM
>
> Dear experts,
> i have four ztables and i have maintanig relation b/w four tables
> table1 (Comp table key field is srno) and
> table2 (projects table key field psno and relation field is srno)
> table3 (jobs table key jsno and relation fields srno and psno)
> table4( equipment table key esno and relation fields srno,psno,jsno)
> actually i'm developing report for these tables
> please tell me how can i maintain loops for this report please help me i tryed in diff ways but i'm gettin problem with clear data and append data please tell me d sol otherwise i will send detailed info
hi,
you are getting data from four database tables
so its best method to declare internal tables for all the four tables.
then you have to code selecet statements for four tables.
select * from table1 into table itab where f1 = field1.
select * from table2 into table jtab where f2 = field2.
select * from table3 into table ktab where f3 = field3.
select * from table4 into table ltab where f4 = field4.
now code loop statement.
loop at ltab.
read table itab with key f1 = field1.
read table jtab with key f2 = field2.
read table ktab with key f3 = field3.
read table ltab with key f4 = field4.
endloop.
this is the best method to avoid multiple loop statements.
Regards,
swaminat.
‎2008 Feb 23 9:11 AM
please give me ur mail id i will send u the code then suggest me the best way
‎2008 Feb 23 9:59 PM
Please see:
[The Performance of Nested Loops|/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops]
Rob
‎2008 Feb 25 8:58 AM
Seems to be no easy problem, because you would need a
several keys for the internal tables which is not (yet) possible.
Be aware, that an internal table does not have a key automatically, you can define the key.
Check which tables will be largest. How many lines do you expect for your tables? Define the most useful keys starting with the largest tables.
Siegfried
‎2008 Feb 26 12:02 PM
The best solution is to use JOINS in your select query and get all the required fields baluein a single Internal Table.
Regards
Sonal