Skip to Content
Former Member
Jul 22, 2009 at 08:59 AM

Problem using AT..NEW statement


I have a internal table with structure

posting_date   amount
20090317       1500000
20090317      -950000
20090317        5000
20090319       8700
20090327       400000
20090327       32000

I am using AT NEW POSTING_DATE to perform some operation on the amount.

loop at itab.

all the record are working fine for AT NEW except for the last record.( posting date 20090327) It does not enter into AT..ENDAT

and simply goes to the endloop..Probably the reason for this is in AT new the current posting date is compared with the one that is above it...and if they are different AT NEW gets triggered. But in my case both the second last and last posting_date are the same, that's why AT NEW is not getting triggered..Please tell me how to solve this problem, how can I do the processing of last record?

PS this problem does not occur if both second last record and last record are different.

Edited by: priyasingh on Jul 22, 2009 11:01 AM