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

Re: Sum in internal table issue

$
0
0

Assume itab1 holds the basic data and you have one work are of same type (wa1). Now create another internal table of same type ( itab2) and  work area also ( wa2).

 

LOOP AT itab1 INTO wa1.

 

  LOOP AT itab2 INTO wa2 WHERE material_no = wa1-material_no.

    wa2-quantity = wa2-quantity + wa1-quantity.

    MODIFY  itab2 FROM wa2.

  ENDLOOP.

 

  IF sy-subrc NE 0.

    APPEND wa1 TO itab2.

  ENDIF.

 

ENDLOOP.

 

Now check itab2 for your required o/p.


Viewing all articles
Browse latest Browse all 9212

Trending Articles



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