Skip to Content
Former Member
Dec 11, 2008 at 11:57 AM

Count matnr


Moderator message: please use a more informative subject in future

Dear Experts;

I am fetch values And stored in IT_EKPO. this itab available record in below format.

ebeln matnr count

10 lo45 0

10 l045 0

10 o77 0

13 li12. 0

my case is count matnr comparing ebeln.that is my output is stored it_ekpo1.for this way.

ebeln matnr count

10 lo45 2

10 lo77 1

13 li12 1

I am trying this not working .

 it_ekpo1[] = it_ekpo[].
sort it_ekpo1 by matnr comparing ebeln.
sort it_ekpo by matnr comparing  ebeln.

loop at it_ekpo.
  clear count1.
 loop at it_ekpo1 where matnr = it_ekpo-matnr.
    read table it_ekpo1 with key ebeln = it_ekko-ebeln.
      loop at it_ekpo1 where matnr = it_ekpo-matnr.

    count1 = count1 + 1.
  it_count-matnr = it_ekpo-matnr.
  it_count-count1 = count1.
  append it_count.
  clear it_count.

<<text removed>>



Edited by: Matt on Dec 11, 2008 2:40 PM - Please use tags around your ABAP. Do not say "ASAP".