No. of Worked days in month

Hi friends,
I would like to know how i would be able to find the number of paid days for an employee in a particular month.
Regards,
Prashant

for getting public holiday you may refer the above person's reply(Holiday_get) .and for getting the personal leave you must have to maintain the ESS and get the details from HR_GET_LEAVE_DATA.finally sum both and subtract from total days.
Update:But you must take care one thing if there is public holiday than employee not came its fine but the problem would occurs if employee may be come on public holiday(like in india for hourly wage employees) also than you must need to maintain their presence in infotype 2002 as well.
but above case only once in while but possibilities are there
Cheers
Edited by: Ámit Güjärgoüd on Oct 14, 2008 9:50 AM

Similar Messages

  • Get working day of month for specific date

    Hi,
    I need to get the working day of a month for a specific date. For example: Which working day is the 15th of september 2005...
    Is there any function module, I could use?
    Cheers Arne

    HI arne,
    1.  DATE_CHECK_WORKINGDAY
        This is the FM.
    2. Along with that u will have to use some logic.
    3. Just copy paste in new program
       (it will help in the logic)
    <b>It will list out
    all the working days
    between two given dates</b>
    REPORT abc.
    data : num type i.
    parameters : frdate type sy-datum default '20051216'.
    parameters : todate type sy-datum default '20051221'.
    perform getinfo using frdate todate changing num.
    break-point.
    *&      Form  getinfo
          text
    FORM getinfo USING fromdate todate CHANGING numofdays type i.
      DATA :  d TYPE sy-datum.
      d = fromdate - 1.
      DO.
        d = d + 1.
        IF d > todate.
          EXIT.
          endif.
          CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
            EXPORTING
              date                       = d
              factory_calendar_id        = '01'
              message_type               = 'I'
            EXCEPTIONS
              date_after_range           = 1
              date_before_range          = 2
              date_invalid               = 3
              date_no_workingday         = 4
              factory_calendar_not_found = 5
              message_type_invalid       = 6
              OTHERS                     = 7.
        IF sy-subrc = 0.
          numofdays = numofdays + 1.
          write :/ d.
        ENDIF.
        ENDDO.
      ENDFORM.                    "getinfo
    regards,
    amit m.

  • Display data for last working day of month

    Hi
    I am trying to chart values for the last six years but only to plot the value for the last working day of the month, except for the current month where I am taking an average of the month so far. Everything I've tried has so far failed spectacularly. Has anyone resolved a similar problem?

    If I understand your dilemma correctly, you may want to create a cross-tab and then create the chart off of the cross-tab. Is the data in your tables that you want to chart on something like this:
             4/30   5/30   6/30   7/31   8/29       Sept.
    Row 1    20      30      10      25      20    (avg for month) 
    Row 2    5         10      8       15     15    (avg for month)
    etc.
    If so, 1) can you show an example of the data and 2) what kind of chart do you want to create?

  • Schedule - 3rd working day of month

    How to set up a schedule that will execute on 3rd (or fourth) working day of every month?

    Hi
    The schedule expression is something like below, but OWB can't express that - you can express execute a weekday every 4/5 weeks for example. Or you can execute on the 3/4 day (no working day specification in OWB) of each month.
    I think this is what you really want though... (this is the schedule expression for Oracle database scheduler);
    FREQ=MONTHLY; BYDAY=MON,TUE,WED,THU,FRI; BYSETPOS=3
    Cheers
    David

  • Calculation of no. of working days (per Factory Cal) between 2 date chars

    This question could be considered to be in continuation of a previous post called "Working days of month with factory calendar"
    I have two date Characteristics: say Date1 and Date2. I need to find the number of working days between them based on the factory calendar.
    (And yes we have already defined the default factory calendar in IMG under 'General Reporting settings' ).
    The previous post proposed the following:
    1) Convert date1 into factorydate (standard functionmodule)
    2) Convert date2 into factorydate (standard functionmodule)
    Perform date1 - date2 to get number of working days.
    I agree that there is a std function module to convert cal date to factory date called: 'DATE_CONVERT_TO_FACTORYDATE'
    But what are the steps for calling the conversion? Should I create a new Formula variable of 'Customer Exit type' give it a name and define the Function module in CMOD? But then how do I attach the formula variable to the date characteristic. Note that my infoobjects are Chars so I cannot do date1- date2 in the query as is possible with keyfigures!
    Please help! (my version is BW 3.0)
    Thanks
    Naresh

    Hi,
    For the above scenario when you need to calculate date 1 - date 2. we can't build a new formulae or calculated KF directly because those are the chars.
    So we need make chars to act as KF through Formulae with replacement path.
    create a formulae variable on those 2 Date chars with Processing type as replaccement then those 2 Dates can be avilable to build a formulae as ur requirement.
    Let me know if you need any more information.
    Thanks,
    Raju

  • ICalendar: How do I know what day, in month view, I am working on?

    The calendar in Mavericks is so frustrating compared to SL. How do I know what day, in month view, I am working on? There is no highlight or box or anything. Am I missing something? Also I suppose its not possible to just see 1 month anymore like it use to be instead of seeing 6 weeks. Thanks.  Sure wish Apple would let us keep our Macs the way WE like it with a classic setting everytime they add something that they think is better. Like those awesome grey icons all over the place instead of color.

    The day with the red line on top is today

  • Need working days for a particular month and year

    Hi,
    I need the number of working days for a particular month and year.Saturdays and Sundays are holidays.
    Regards,
    Vignesh

    Try this:
    SQL> var yr NUMBER;
    SQL> exec :yr := 2010;
    PL/SQL procedure successfully completed.
    SQL> with t as (select :yr yr from dual)
      2  SELECT TO_CHAR(dat,'MON-RR'),COUNT(*) FROM
      3  (select TO_DATE('01-JAN-'||yr) + lv dat FROM
      4  (select level - 1 lv,yr from t
      5  connect by level <= TO_DATE('31-DEC-'||yr) - TO_DATE('01-JAN-'||yr) + 1))
      6  WHERE TO_CHAR(Dat,'DY') NOT IN ('SAT','SUN')
      7  GROUP BY TO_CHAR(dat,'MON-RR');
    TO_CHAR(DAT,   COUNT(*)
    APR-10               22
    AUG-10               22
    DEC-10               23
    FEB-10               20
    JAN-10               21
    JUL-10               22
    JUN-10               22
    MAR-10               23
    MAY-10               21
    NOV-10               22
    OCT-10               21
    TO_CHAR(DAT,   COUNT(*)
    SEP-10               22
    12 rows selected.
    SQL> Edited by: AP on Jul 27, 2010 7:54 AM

  • How to create a recurrent event on the first or last work day of the month

    The lightning calendar allows selection of the first and last day of the month for recurrent events but for business I need to use the first and last WORK day of the month (Monday - Friday) to schedule particular tasks. In the calendar preferences under 'View' I can select the days that make up the work week but this does not transfer to an option in recurrent events. Is there another way to do this or is it just not available?

    Hi there,
    do know for the UlltimateBootCD4Win? This from CD bootable WinXP-BartPEedition with additional tools gives you the ability to make such things like partitioning, backup or formatting your HDD.
    It has many more applications which help you to maintain your system without booting your original OS.
    So I think that this CD will solve your partitioning issues.
    Heres a link: www.ubcd4win.com/
    Just try it and tell me your opinion.
    Nice weekend and greetings from the sunny south ;)

  • Function module for getting teh last working day of a month.

    Hi GURUS,
    this is criteria,please help me 
    if V_T001B- FRYE1 < month entered in selection screen
              Then throw the error message
                Else
    Find the previous period and its last working day from the function module
          (i..e Assume entered date as June 2 2009 then
                   Period 6 -1 = 5.
         Pass the month 05 to function module then
                   Find last working day.
                   Keep it in a variable (V_LAST_PRD_WRKDAY)
                           Proceed further.
    thanks in advance,
    Rajeev

    Hi Rajeev,
    You can use Function Module LAST_DAY_IN_PERIOD_GET.
    Ex:
          CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
            EXPORTING
              i_gjahr = p_gjahr
              i_periv = lwa_t009b-periv
              i_poper = lwa_t009b-poper
            IMPORTING
              e_date  = s_audat-high.
    Regards,
    Ravi K

  • How can i get a number of working days in a month PL/SQL

    How can i get a number of working days in a month(excluding Saturday and Sunday) in a query in PL/SQL ?

    Please do a search before posting
    sql>
    select count(*)
    from(
    select trunc(sysdate,'month')+rownum-1 dy
    from all_objects
    where rownum <= last_day(sysdate) - trunc(sysdate,'month')+1)
    where to_char(dy,'fmday') not in ('sunday','saturday');
    COUNT(*) 
    23
    Message was edited by:
            jeneesh
    Please try yourself to change the query to one that doesn't use a subquery..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need working days for all months in a given year

    Hi,
    I need no of working days for all the months in a given year.
    (i.e year is the input and the query should return 12 columns(jan-dec). Saturday and Sunday are holidays)
    Regards,
    Vignesh

    Maybe you can use this:
    break on month skip 1
    set linesize 200
    set pagesize 2000
    column month format a20
    column week format a4
    with req as (select '&Required_Year_YYYY' as yr from dual)
        ,offset as (select case when to_char(trunc(to_date(yr,'YYYY'),'YYYY'),'IW') in ('52','53') then 1 else 0 end as offset from req)
    select lpad( Month, 20-(20-length(month))/2 ) month,
           '('||week||')' as week, "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"
    from (
      select to_char(dt,'fmMonth YYYY') month,
      case when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 0 then '53'
           when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 1 then '54'
           when to_char(dt, 'mm') = '01' and to_char(dt,'iw') in ('52','53') then '1'
           else to_char(to_number(to_char(dt,'iw'))+offset) end as week,
      max(decode(to_char(dt,'d'),'1',lpad(to_char(dt,'fmdd'),2))) "Su",
      max(decode(to_char(dt,'d'),'2',lpad(to_char(dt,'fmdd'),2))) "Mo",
      max(decode(to_char(dt,'d'),'3',lpad(to_char(dt,'fmdd'),2))) "Tu",
      max(decode(to_char(dt,'d'),'4',lpad(to_char(dt,'fmdd'),2))) "We",
      max(decode(to_char(dt,'d'),'5',lpad(to_char(dt,'fmdd'),2))) "Th",
      max(decode(to_char(dt,'d'),'6',lpad(to_char(dt,'fmdd'),2))) "Fr",
      max(decode(to_char(dt,'d'),'7',lpad(to_char(dt,'fmdd'),2))) "Sa"
      from ( select trunc(to_date(req.yr,'YYYY'),'y')-1+rownum dt
             from all_objects, req
             where rownum <= add_months(trunc(to_date(req.yr,'YYYY'),'y'),12) - trunc(to_date(req.yr,'YYYY'),'y') )
          ,offset
      group by to_char(dt,'fmMonth YYYY'),     case when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 0 then '53'
                                                    when to_char(dt, 'mm') = '12' and to_char(dt,'iw') = '01' and offset = 1 then '54'
                                                    when to_char(dt, 'mm') = '01' and to_char(dt,'iw') in ('52','53') then '1'
                                                    else to_char(to_number(to_char(dt,'iw'))+offset) end
      ) x
    order by to_date( month, 'Month YYYY' ), to_number(x.week)
    / L.

  • To run a program in batch every month on a particular working day

    Hi All,
    I have a requirement to run a program  in batch every month on the 17th working day.
    How can I achieve this?
    Thanks in advance.
    Ankit

    Hi,
    1.Create an event in tcode- SM62.
    2. write a ABAP program include this function module- RSPC_API_CHAIN_SCHEDULE(This function module is periodic)-> give the periods
    or
    go to RSPC-->start variant and give time as you want and schedule it according to your time.
    Then go to SM37 and select your job and go to job menu -->repeat scheduling
    giving time as you want and schedule it as daily
    Regards,
    Marasa.

  • How to schdule my job on 16th working day of the every month?

    hi frnz
    I have a big task in my end, i have created one  package ,i want to execute that every month of 16th working day i want to run my job with schdule,how should i schdule my job using
    SQL AGENT IN SQL SERVER
    Can some one please help me out .......
    Thanks

    To add to Visakh's response, another method is to add the T-SQL script as the first job step to identify non-run days and raise an error when the job is not to be run.  Set this first job step on failure action to "Quit the job reporting success".
    Personally, I would use a full calendar table with an indicator of whether a given date is a working day or not.  I thing you will find such a table useful beyond this scheduling requirement.  For example:
    CREATE TABLE dbo.Calendar(
    CalendarDate date NOT NULL
    CONSTRAINT PK_Calendar PRIMARY KEY CLUSTERED
    ,CalendarYear int NOT NULL
    ,CalendarMonth int NOT NULL
    ,CalendarDay int NOT NULL
    ,BusinessDay bit NOT NULL
    See
    http://weblogs.sqlteam.com/dang/archive/2010/07/19/calendar-table-and-datetime-functions.aspx for an example of a more extensive calendar table along with a script to load US holidays.  The code below shows one method to use it for your scheduling
    requirement:
    DECLARE @RunDay bit = 0;
    WITH this_month_business_days AS (
    SELECT
    CalendarDate
    ,ROW_NUMBER() OVER(ORDER BY CalendarDate) AS BusinessDayNumber
    FROM dbo.Calendar AS c
    WHERE
    CalendarYear = DATEPART(year, GETDATE())
    AND CalendarMonth = DATEPART(month, GETDATE())
    AND BusinessDay = 1)
    SELECT @RunDay = 1
    FROM this_month_business_days
    WHERE
    BusinessDayNumber = 16
    AND CalendarDate = CAST(GETDATE() AS date);
    IF @RunDay = 0
    BEGIN
    RAISERROR ('Today is not a run day', 16, 0)
    END;
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Calculate number of working days in a month

    Hi All,
    I am trying to build a report to calculate the performance of a sales rep for the current month. This report has to exclude the holidays (saturday, sunday and one extra day in each month) in order get the exact performance. Could anyone suggest me on how to go about writing a Case statement which would get me the number of working days in a month excluding holidays.
    Thanks

    Hi,
    There are no direct oracle function that could be used to get the desired results.
    However you could try using something like
    SELECT COUNT( *)
    FROM
    (SELECT ROWNUM RNUM
    FROM ALL_OBJECTS
    WHERE ROWNUM <= TO_DATE('&1') - TO_DATE('&2') + 1
    WHERE TO_CHAR(TO_DATE('&2') + RNUM - 1, 'DY') NOT IN('SAT', 'SUN');
    Give the two date ranges that you want to look for with the highiest one first. i.e say for example - 01-FEB-2011 to 31-DEC-2010 would give the working days in JAN. However note that you might have to check for holidays related to that country/region (which could be added as a seperate table).
    If you need to get an extra day in addition to the weekends, please give the dates accordingly
    SQL> SELECT COUNT( *)
    2 FROM
    3 (SELECT ROWNUM RNUM
    4 FROM ALL_OBJECTS
    5 WHERE ROWNUM <= TO_DATE('01-FEB-2011') - TO_DATE('01-JAN-2011') + 1
    6 )
    7 WHERE TO_CHAR(TO_DATE('01-JAN-2011') + RNUM - 1, 'DY') NOT IN('SAT', 'SUN');
    COUNT(*)
    22

  • Get working days of actual month in time management

    Hello,
    a customer wants his employees to work some additional time every workday. The time is different for each employee and has to be specified on a monthly basis, but has to be shown daily in time sheet.
    Days with holidays or illness do not require additional work, but count when calculation daily quota.
    I would like to use P0050-ZTZUA to store the value of the hours which the employee has to work extra per month.
    Now I need to divide this value through the number of workdays of the actual month, to get a value per day. Unfortunately I did not find any operation to get number of workdays.
    Thanks in advance

    Hello again.
    I did not get it!
    I made a simple PCR "Z123" just to test, how to count days. It looks like this:
               D VARSTCURMO
    **           HRS=1     ADDDB9082
    I call this with ACTIO Z123 and see, that the result for timetype 9082 is 1 at every day that is evaluated in my calculation period.
    In the example I do not care for workingdays, I just wanted to test, if the counting of days is functioning.
    Since the timetype 9082 is cumulated, I get number of days of period at the end of the time calculation in SALDO-Table.
    For example:
    Day               Saldo in 9082
    January  1             1
    January  2             2
    January  3             3
    January 31            31
    My problem is, that I need the number of days at each day of the calculation. Already at January 1 I need to divide a given amount of time through the number of days (31 in the example).
    I'm afraid, that this issue cannot be solved?

Maybe you are looking for