Skip to Content
0
Former Member
Sep 07, 2007 at 11:31 AM

At New statement problem

2127 Views

Hello experts,

I am currently having a problem with my At New statement. It is treating every field of the itab as a new record even though it is the same.

For example,

on the first loop the field matnr has a value of mat-A then the at new will trigger.

then on the second loop matnr has a value of mat-B then again, At New will trigger.that is correct.

But on the third loop, the field matnr will have a value again of mat-B or Mat-A- the same as that of the second or first loop. So it must not trigger the At New statement but it does.

Any solutions?

MY CODING.....

SORT IT_FINAL BY MATNR.

LOOP AT IT_FINAL.

wa_final = it_final.

at new matnr.

it_final1-matnr = wa_final-matnr.

it_final1-maktx = wa_final-maktx.

it_final1-bdmng = VAL1.

APPEND it_final1.

clear : it_final, it_final1, wa_final.

endat.

ENDLOOP.

Thanks!

REGARDS,

NAVANEETH.