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: 

Function to determine absence hours on key date

Former Member

Hi,

I need to determine employee absence hours given a key date. Is there a standard function module or any way to determine this?

I know there is infotype 2001 (table PA2001) which stores employee absences for a date period (BEGDA and ENDDA). However I require absence hours on a specific date.

thanks

Jason

12 REPLIES 12

Former Member
0 Kudos

Hi,

Are you asking about absence hours?

Try with PA2001-STDAZ(Absence Hours).

Also, you can check PA2001-BEGUZ(Start Time) and PA2001-ENDUZ(End Time).

Jake

kesavadas_thekkillath
Active Contributor
0 Kudos

You can check fm BAPI_ABSENCE_GETDETAIL or HR_ABS_ATT_TIMES_AT_ENTRY

0 Kudos

Thanks for your replies. Unfortunately none provide what I require so far.

I'm aware of PA2001-STDAZ containing absence hours but this is only for a period of leave (BEGDA and ENDDA) from what I can see.

BAPI_ABSENCE_GETDETAIL and HR_ABS_ATT_TIMES_AT_ENTRY both also seem to only show absences based on a period of leave.

I need to determine absence hours based on a specific key date. eg. employee has 1 absence record in PA2001 for period 01.07.2012 to 11.07.2012. I need something which gives me absence hours if I pass in, say single date of 05.07.2012??

0 Kudos

Please try providing the same date to BEGDA and ENDDA ?

0 Kudos

Hi Kesavadas,

Thanks, I tried passing in same date to BEGDA and ENDDA in BAPI_ABSENCE_GETDETAIL and HR_ABS_ATT_TIMES_AT_ENTRY but it reports back no values in selected period. It only works for leave periods of 1 day. I need to pass the full period leave dates (as per PA0001 record) to BEGDA and ENDDA for it to return values in the function.

So unfortunately still not sure how to determine absence hours based on a specific key date?

cheers

Jason

0 Kudos

Mister, in 2023 it it still a problem i cannot find something useful in sap documentation. my mentor said me to use pa2001-stdaz to get hours for abscence which < 1 shift (or 8 hours) and pa0007 -> t552a -> t550a-sollz for other cases. but i'm not sure about this strange condition.

Maybe you know the simplest way to get abscence hours for period?

oleksandrm
Explorer
0 Kudos

february 2024 😄

i cant find solution for this sh*t.

my mentor explained that taking values from 2001 infotype absences is wrong,

sometimes it is necessary to take values from tables t550a-sollz (hours) using working schedule rule (pa0007, t552, ...). now i can to pull data from all these tables, but i cant get this condition. it it related with pa2003...? i would like to have a piece of simple abap code😄

KKilhavn
Active Contributor

What are you looking for: Recorded absences, missing timewriting, or both? I would say that only Time Evaluation results will give you the definitive answer. Searching for "ABAP Time Evaluation result" will probably help you find out how to read them, and your local time evaluation expert should be able to tell you which parts of the result you need to check.

Kjetil Kilhavn (Vettug AS) - ABAP developer since Feb 2000

0 Kudos

Did you try a BAPI such as BAPI_TIMEAVAILSCHEDULE_BUILD (aka HR_PERSONAL_TIME_LIST) ?

0 Kudos

No, i will check them. Thank you

Recently i found hr_personnal_work_schedule. It is great for no-one-day absences , if i add check for days to ignore days of the absence, that are outside the period , which user selected.

For one-day and part-day absences i created my own weird module, i am testing it now ) if it will be hopeless i would seek standard solutions again )))

0 Kudos

Hi @Ole , have you resolved it yet?

0 Kudos

Yes, i finally resolved it last week . Now my program is about 1300 code lines , because im still newbie, there must be more easy and clear solution😄 to detetmine all absences/attendances in a department for 2 years , my program execution 's time about 30-40 secs

It will take about a week to comment it and format code😄😄😄