Skip to Content
0
Former Member
May 11, 2010 at 11:06 AM

sum amount

17 Views

HI

i use this part of code:

loop at i_mapping into wa.
  if wa-xblnr ne m_xblnr and wa-mwskz ne m_mwskz.
        clear : wa1.
  move m_xblnr to wa1-xblnr.
        move m_mwskz to wa1-mwskz.
        move m_net   to wa1-znet.
        append wa1 to i_new.
        clear m_net.
   endif.
  append wa to i_new.
  add wa-znet to m_net.
  move wa-xblnr to m_xblnr.
  move wa-mwskz to m_mwskz.
endloop.

clear : wa1.
move m_xblnr to wa1-xblnr.
move m_mwskz to wa1-mwskz.
move m_net   to wa1-znet.
append wa1 to i_new.

this appends the i_mapping to i_new and appends some new lines with the summation of znet by xblnr.

i want not to sum only by xblnr but with xblnr mwskz.

to be more clear if the xblnr and mwszk in first line for example is equal with the third ( let's say that is the last line ) then i want to append a new line (forth line) with the summation of znet of first and third line.