Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding count number of employee

Former Member
0 Kudos

Hi All,

How can i count number of employee for a particular location through Band Wise in ABAP HR.

suppose , any particular location five bands are defined say: L1,L2,R1,R2,R3

then how many employee belongs to band L1 , L2 , R1 , R2 , R3 respectivelly for particular location.

please suggest.

Thks

Shailesh

3 REPLIES 3

Former Member
0 Kudos

Try this

cnt1 type n..............

loop at itab.

if  band = 'L1'.
cntl1 = cntl1 + 1.
elseif  band = 'L2'.
cntl2= cntl2 + 1.
elseif  band = 'R1'.
cntR1 = cntR1 + 1.
elseif  band = 'R2'.
cntR2 = cntR2 + 1.
elseif  band = 'R3'.
cntR3 = cntR3 + 1.
endif.

endloop.

Former Member
0 Kudos

Hi,

Take 5 variables...TRY THIS WAY

CASE BAND.
WHEN 'L1'.
  L1_COUNT = L1_COUNT + 1.

WHEN 'L2'.
  L2_COUNT = L2_COUNT + 1.

WHEN 'R1'.
  R1_COUNT = R1_COUNT + 1.

WHEN 'L1'.
  R2_COUNT = R2_COUNT + 1.

WHEN 'L1'.
  R3_COUNT = R3_COUNT + 1.

WHEN OTHERS.

ENDCASE.

0 Kudos

thks ,problem solved.