Application Development and Automation 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: 
Read only

Function Module for holidays and work days ?

Former Member
0 Likes
2,854

Hi experts,

Is there any function module that shows all working hours like FUNCTION 'CATS_GET_TARGET_HOURS' but that has also holiday like alv on transaction PT03.

Thanks in advance

3 REPLIES 3
Read only

former_member205488
Active Participant
0 Likes
1,458

Hello!

There is fm RKE_SELECT_FACTDAYS_FOR_PERIOD - it shows all working days in period. It could be useful.

Read only

Former Member
0 Likes
1,458

" you can function module/method this code where sollz is the number of hours in the day available to work based on an employees working time

make sure you check the holiday calendar for each workdate that is not a holiday

    select single schkz into (wa_schkz) from pa0007

           where pernr = pernr

             and begda <= workdate

             and endda >= workdate.

   if sy-subrc = 0.

        select single * from t551a into wa_t551a

                  where motpr = '08' "UK grouping

                    and zmodn = wa_schkz.

      call function 'DAY_IN_WEEK'

        exporting

          datum         = workdate

        importing

          wotnr         = wotnr.

case wotnr.

      when 1.

        select single sollz from t550a into req_hours

               where motpr = '08'

                 and tprog = wa_t551a-tprg1.

      when 2.

        select single sollz from t550a into req_hours

               where motpr = '08'

                 and tprog = wa_t551a-tprg2.

      when 3.

        select single sollz from t550a into req_hours

               where motpr = '08'

                 and tprog = wa_t551a-tprg3.

      when 4.

        select single sollz from t550a into req_hours

               where motpr = '08'

                 and tprog = wa_t551a-tprg4.

etc

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
1,458

Hi

The below FM's might help you.

RKE_SELECT_FACTDAYS_FOR_PERIOD - Detects all working days in a time frame in accordance with factory calendar

OIJP_CHECK_HOLIDAY - IS-OIL TSW : Determines if a given date is a holiday or not

Thanks,

Sreeram