Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8802

Re: How to add amount of 2 records with same Key fields in an internal table?

$
0
0

sort your IT by f1 f2 f3 f4 f5 then

loop at it into wa.

 

if(wa-f1 = lv_f1 and wa-f2 = lv_f2 and wa-f3 = lv_f3 and wa-f4 =lv_f4 and wa-f5 = lv_f5).

here you add amount and put all fields into another internal table IT2.

wa2-f1 = wa1-f1.

wa2-f2 = wa1-f2.

wa2-f3 = wa1-f3.

wa2-f4 = wa1-f4.

wa2-f5 = wa2-f5+wa1-f5.

endif.

 

modify IT2 from WA2.

 

lv_f1 = wa-f1.

lv_f2 = wa-f2.

lv_f3 = wa-f3.

lv_f4 = wa-f4.

lv_f5 = wa-f5.

 

endloop.


Viewing all articles
Browse latest Browse all 8802

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>