‎2005 Dec 21 2:15 PM
Dear All,
I need to select data from two tables s071 and s060.
In my program all the data from different tables is being inserted into Internal table T_KONH.
now i need to select the data from s071 and s060 into a single internal table and compare the data being fetched on the basis of T_KOMH-knumh(using for all entries statement).
Also if there is more than one condition record found i need to sum them up(that can be done using collect statement).
ALL THE PROCESSING SHOULD NOT EFFECT THE PERFORMANCE.
Can someone suggest me with a good solution????
‎2005 Dec 21 2:21 PM
Hi Anurag,
Make the join tables s071 and s060 and put it into one internal table i_join.
loop at t_konh.
read i_join.
{
}
endloop.
‎2005 Dec 21 2:21 PM
Hi Anurag,
Make the join tables s071 and s060 and put it into one internal table i_join.
loop at t_konh.
read i_join.
{
}
endloop.
‎2005 Dec 21 2:24 PM
Hi Eswar,
Thanks! but i cannot use either inner or outer join.
Please suggest some other solution.
As the program is too big so performance is the main issue.
‎2005 Dec 21 2:42 PM
if not t_konh[] is initial.
select <flds>
from s071
into table i_s071
for all entries in t_konh
where knumh = t_konh-knumh.
endif.
if not i_s071[] is initial.
select <flds>
from s0621
into table i_s062
for all entries in i_s071
where SSOUR = i_s071-SSOUR.
endif.
‎2005 Dec 21 2:44 PM
This will give somewhat...best
if not t_konh[] is initial.
select <flds>
from s071
into table i_s071
for all entries in t_konh
where knumh = t_konh-knumh.
if sy-subrc = 0.
select <flds>
from s0621
into table i_s062
for all entries in i_s071
where SSOUR = i_s071-SSOUR.
endif.
endif.