Skip to Content
0
Former Member
Jul 22, 2008 at 02:23 AM

Control break(At new) problem in loop ~ where

55 Views

Hello, everyone.

I'd like to ask question about using at new during looping with where condition.

I used at new with loop ~ where, but it doesn's work properly.

Read next. please.

I have an internal table like this.

itab.

(index) PCTGP GPM PRCTR DEXIM VRGAR~~~~

0 A0 B0 BBB 0 0

1 AA BB BBC 0 1

2 AA BB BBC 0 1

........................

3 AA BB BBC 1 0

4 AA BB BBC 1 0

And I used following sentences.

loop at itab where vrgar <> '1'.

at new prctr.

sum.

......

endat.

at new dexim.

sum

endat.

endloop.

I expected to read index 3 to sum data but at new prctr sentence was passed.

And on next at new dexim was worked well.

I thought that at new prctr work well because index 1 and 2 records wasn't read during looping , and index 3 record's prctr was different from index 0's prctr.

But at result, at new prctr was passed.

Why was this happened?

Does at new work with whole itab although the looping has where condition?

If I revise this code, what should I do for summation at prctr level?

Please answer for this question.

I really glad to see good answers.

Thanks.

P.S Sorry for poor English and Thank you read this.