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

Internal Tables

Former Member
0 Likes
668

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????

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
620

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.

4 REPLIES 4
Read only

Former Member
0 Likes
621

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.

Read only

0 Likes
620

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.

Read only

0 Likes
620

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.

Read only

0 Likes
620

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.