2008 Jul 12 2:33 PM
Hi ,
i want to set a counter
when ever a material change.& clear when
invoice no changes..
for eg i have invoice no with 5 lineitems..
invoice no | Materail
101 Xyz
xyz
zzz
zzz
yyy..
here counter should be 3.
reset when invoice no changes.
Hi ,
i want to set a counter
when ever a material change.& clear when
invoice no changes..
for eg i have invoice no with 5 lineitems..
invoice no | Materail
101 Xyz
xyz
zzz
zzz
yyy..
here counter should be 3.
reset when invoice no changes.
2008 Jul 12 2:44 PM
I assume you have an internal table with invoice nos and each invoice has its items. Please sort the internal table by invoice no. and item and use control break statement.
loop at invoices.
at new invoice.
counter = 0.
endat.
loop at items.
AT new item.
counter = counter + 1.
endat.
endloop.
endloop.
2008 Jul 12 2:56 PM
Hi
U can use Internal Table control events inside LOOP..
AT NEW <FIELD>. " Triggers when found new value of a <FIELD>
ENDAT
AT END OF <FIELD>.
END AT.
<FIELD> ==> Material No (MATNR)
<FIELD> ==> Invoice No (BELNR)
DATA : COUNTER TYPE I.
COUNTER = O.
LOOP AT ITAB INTO WA.
AT NEW BELNR.
COUNTER = O.
ENDAT.
AT NEW MATNR.
COUNTER = COUNTER + 1.
ENDAT.
ENDLOOP.Also give a try for AT END OF
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |