2006 Nov 23 12:05 PM
for example :
select aufnr vornr sum (ISM02) sum ( ISM04) Sum (ism05) from afru into table I_afru for all entries of I_caufv where aufnr = i_caufv-aufnr group by aufnr.
can any one help based on this query
without forall entries it is working based for all entries only i want the solution Help me please.
Regards
Augustine
2006 Nov 23 12:27 PM
Another solution is to use the below logic.
1. Get min and max aufnr from i_caufv.
2. Build a range for aufnr.
3. Select aufnr vornr sum(ism02)....from afru into i_afru
where aufnr in range_aufnr group by aufnr vornr.
4. Loop at i_caufv.
read table i_afru with aufnr = i_caufv-aufnr.
endloop.
Regards
Anurag
2006 Nov 25 12:23 PM
Simple,
select aufnr vornr ISM02 ISM04 ism05 from afru into table
I_afru for all entries of I_caufv
where aufnr = i_caufv-aufnr .
<b>if sy-subrc eq 0.
sort I_afru by aufnr.
loop at l_afru.
at end of aufnr.
SUM.
l_afru_temp = l_afru.
append l_afru_temp.
endat.
endloop.
endif.</b>