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

Re: collect statement issue

$
0
0

hi i think it will helpful,

 

collect statement when used helps to reduce redundant data [avoid duplicate record] as when collect used for two records having same [character] fields and and some amount fields differently then it will add the numeric values of both fields and assign the obtained value to the first record fields.

 

if when two records having character fields differently then it will two records separately as two records in internal table.

 

Collect: Collects/sums up the numerical fields for a similar key field

for example:

 

select vbeln netwr  into (itab-vbeln, itab-netwr) from vbak where vbeln in s_vbeln.

   collect itab.

endselect.

if the data is

 

So          amount

10001      500

10005      200

10001      300

10005      200

 

it will come as

 

10001    800

10005    400

 

 

 

regards,

roopa.


Viewing all articles
Browse latest Browse all 8927

Trending Articles



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