*&-------------------------------------------------------------------------*
* Create a list for the current year showing the cumulated days of absence
* - for each company code
* - for each personnel area
* - for each Personnel Subarea
*--------------------------------------------------------------------------*
tables: pernr,
t554t, "Absence texts
t001p. "Personnel subareas
infotypes: 0001, "Organizational Assignment
2001 mode n. "Absences
data: begin of it_abstab occurs 20,
bukrs like p0001-bukrs,
werks like p0001-werks,
btrtl like t001p-btrtl,
moabw like t001p-moabw, "Subarea grouping for absences
awart like p2001-awart,
abwtg like p2001-abwtg,
end of it_abstab.
get pernr.
rp-provide-from-last p0001 space pn-begda pn-endda.
rp-read-t001p p0001-werks p0001-btrtl space.
move-corresponding: p0001 to it_abstab,
t001p to it_abstab.
rp-read-all-time-ity pn-begda pn-endda.
loop at p2001.
if p2001-abwtg gt 0.
move-corresponding p2001 to it_abstab.
collect it_abstab.
endif.
endloop.
end-of-selection.
sort it_abstab.
loop at it_abstab.
format intensified off.
perform re554t using it_abstab-moabw it_abstab-awart.
perform print.
at end of btrtl. "Personnel subarea
format intensified on.
sum.
clear t554t-atext.
perform print.
endat.
at end of werks. "Personnel area
format intensified on.
sum.
clear t554t-atext.
perform print.
endat.
at end of bukrs. "Company code
format intensified on.
sum.
clear t554t-atext. perform print.
skip.
endat.
at last.
format intensified on.
sum.
clear t554t-atext. perform print.
skip.
endat.
endloop.
*-----------------------------------------------------------------*
* FORM PRINT
*-----------------------------------------------------------------*
* Print cumulated absence days
*-----------------------------------------------------------------*
form print.
write: / it_abstab-bukrs,8 it_abstab-werks,14 it_abstab-btrtl,20 it_abstab-awart,26 t554t-atext,
60 it_abstab-abwtg.
endform.
*-----------------------------------------------------------------
* FORM RE554T
*-----------------------------------------------------------------
* Read absence texts
*-----------------------------------------------------------------
form re554t using value(grouping) "Subarea grouping for absences
value(absence).
check t554t-sprsl ne sy-langu
or t554t-moabw ne grouping
or t554t-awart ne absence.
select single * from t554t
where sprsl = sy-langu
and moabw = grouping
and awart = absence.
if sy-subrc ne 0.
clear t554t.
endif.
endform.
ALSO READ:
- HR TABLES.
- HR Tables & Infotypes.
- HR T-Codes.
- Sample HR Report Program On Macros.
- Employee Data Using Function Module In HR ABAP.
- BDC For The Action Transfer Of Location In HR ABAP.
.....Back To Index On HR ABAP.
.....Back To MAIN INDEX.
No comments:
Post a Comment