REPORT ztest line-size 200.
tables:pa0002,
pa0008.
data: begin of it_pa0002 occurs 0,
pernr like pa0002-pernr,
begda like pa0002-begda,
endda like pa0002-endda,
vorna like pa0002-vorna,
nachn like pa0002-nachn,
end of it_pa0002.
data: begin of it_pa0008 occurs 0,
pernr like pa0008-pernr,
ansal like pa0008-ansal,
lga01 like pa0008-lga01,
bet01 like pa0008-bet01,
end of it_pa0008.
data:begin of it_final occurs 0,
C,
pernr like pa0002-pernr,
begda like pa0002-begda,
endda like pa0002-endda,
vorna like pa0002-vorna,
nachn like pa0002-nachn,
ansal like pa0008-ansal,
lga01 like pa0008-lga01,
bet01 like pa0008-bet01,
end of it_final.
select-options:s_pernr for pa0002-pernr.
start-of-selection.
select pernr
begda
endda
vorna
nachn
from pa0002
into table it_pa0002
where pernr in s_pernr.
sort it_pa0002 by pernr begda descending.
if not it_pa0002[] is initial.
select pernr
ansal
lga01
bet01
from pa0008
into table it_pa0008
for all entries in it_pa0002
where pernr = it_pa0002-pernr.
sort it_pa0008 by pernr descending.
endif.
loop at it_pa0002.
it_final-pernr = it_pa0002-pernr.
it_final-begda = it_pa0002-begda.
it_final-endda = it_pa0002-endda.
it_final-vorna = it_pa0002-vorna.
it_final-nachn = it_pa0002-nachn.
read table it_pa0008 with key pernr = it_pa0002-pernr .
it_final-ansal = it_pa0008-ansal.
it_final-lga01 = it_pa0008-lga01.
it_final-bet01 = it_pa0008-bet01.
append it_final.
clear it_final.
endloop.
loop at it_final.
write:/ SY-VLINE,
IT_FINAL-C AS CHECKBOX,
it_final-pernr color 1,
it_final-begda color 1,
it_final-endda color 1,
it_final-vorna color 1,
it_final-nachn color 1,
it_final-ansal color 1,
it_final-lga01 color 1,
it_final-bet01 color 1,
SY-VLINE .
at end of pernr.
sum.
write:/ SY-VLINE,
14 'The annual salary of the employee is :' color 7 ,
118 it_final-ansal color 3,
162 SY-VLINE.
endat.
at last.
sum.
endat.
endloop.
end-of-selection.
top-of-page.
write:/50 'THIS IS OFFICE MAX COMPANY' color 3.
write:/50 'THE EMPLOYEE TEST DATA FOR THIS COMPANY' color 3.
No comments:
Post a Comment