Skip to Content
0
Former Member
May 07, 2012 at 06:53 AM

AT NEW Statement is not working.

905 Views

Hi everyone,

Here i am trying to display the count of number entries are there against an employee number.

For ex. an employee with emp no 1000 is present in the table thrice then the count shoul be 3.

For this i used the AT NEW statement in loop.The code is below one.

Data : Count2 type i.

select * from zsr_opl into table ot_opl.

loop at it_opl.


at new emp-no.

WRITE : / IT_OPL-EMP_NO.

ENDAT.

COUNT2 = COUNT2 + 1.

AT END.

WRITE : / COUNT2.

COUNT2 = 0.

ENDAT.

ENDLOOP.

HERE ZSR_OPL IS THE DB TABLE WHERE EMP-NO IS NOT KEY FIELD.

Moderator Message: Please be more specific about the problem - thread locked.

Message was edited by: Suhas Saha