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?

Similar Messages

  • 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..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 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.

  • 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

  • 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 ;)

  • Getting last day of the month

    hi ,
    is there an existing date funtion to get last day of the month ?
    pls advise
    else
    i'll try to add_month + 1 to current month and format to the first day and minus 1 day from that new month
    tks & rdgs

    last_day function
    <br>
    jeneesh

  • How to find out average files i am getting every day in a month?

    How to find out average files I am getting every day in a month?

    Do you mean average count of files received?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Function Modules to get First day of week, month, Year

    Can anyone name the Function Modules for getting First day of week, month ,year.

    to get first day of week use this function;   WEEK_GET_FIRST_DAY
          CALL FUNCTION 'WEEK_GET_FIRST_DAY'
               EXPORTING
                    WEEK         = '201107'
               IMPORTING
                    DATE         = l_date
               EXCEPTIONS
                    WEEK_INVALID = 1
                    OTHERS       = 2.
    with DATE_COMPUTE_DAY function you can get date number in week.
    CALL FUNCTION 'DATE_COMPUTE_DAY'
           EXPORTING
                DATE = workdate
           IMPORTING
                DAY  = day_of_week_num
           EXCEPTIONS
                OTHERS  = 8.
      CASE day_of_week_num.
        WHEN 1.
          hold_day_of_week = 'Monday'.
        WHEN 2.
          hold_day_of_week = 'Tuesday'.
        WHEN 3.
          hold_day_of_week = 'Wednesday'.
        WHEN 4.
          hold_day_of_week = 'Thursday'.
        WHEN 5.
          hold_day_of_week = 'Friday'.
        WHEN 6.
          hold_day_of_week = 'Saturday'.
        WHEN 7.
          hold_day_of_week = 'Sunday'.
        WHEN OTHERS.
          hold_day_of_week = 'invalid'.
      ENDCASE.

  • Getting the day of the month

    I think it is kind of odd that the "day" property in the Date
    class will only return the day of the week and not the day of the
    month... How would you go about getting the day of the month
    selected lets just from a DateField entry... so lets just say some
    one does something like this
    var date:Date = DateFieldEntry.selectedDate;
    trace(date.day.toString());
    It give me back the day of that particular week in the
    month... but I really don't have any use for that... I need the day
    of the month! How would I go about getting that?

    yeah... I know the "date" property returns a numeric value of
    the current month, day and year... but I was hoping there was a
    property of some sort that I could just use instead of having to
    parse the numeric value returned for what I want..

  • 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

  • Getting last days of several months - Bex Analyzer

    Hello, BW experts~
    I need to calculate with last days of several months.
    For example,
    - The sales in July: $100
       -> sales per day in July = $100 / <b>31</b>
    - The sales in last month(June): $100
       -> sales per day in last month(June) = $100 / <b>30</b>
    - The sales in 2 month ago(May): $100
       -> sales per day in 2 month ago = $100 / <b>31</b>
    I used to calculate a last day on a month with a customer exit variable. It works well when executing  the BEx query with one month. But, when executing the query with 3 months, it doesn't work well.
    For example, when executing the query in July, all last days, which are calculated via customer exit variable, become 31. Only one month.
    - Last day -
    July: <b>31</b>
    Last month(June): <b>31</b>
    2 month ago(May): <b>31</b>
    They have to be each 31(July), 30(June), 31(May).
    I want to get fit last days of several months at a time and one BEx query.
    Is it possible? (I wish it's possible.)
    Can I do something in CMOD?
    Thank you~
    Sihyoung Jurn

    Hi,
    You can get it by creating 3 formula variables with 'customer ext' as processing.
    Let us assume user enters the First month by a 'user entry' variable.
    In the code of user exit for 1st formula variable you will calculate the last day of the user entered month.
    In the code of user exit for 2nd formula variable you will calculate the last day of the (prevoius month to user entered month).
    Similarly for 3rd Formula Variable also.
    there will be 3 Restricted key figures.
    one for sales of user entered month.
    2nd one for sales of prevoius month to user entered month.
    3nd one for sales of two month to user entered month.
    you will have 3 calculated kfs.
    in first one you do 1st RKF/Formula variable1.
    in second one you do 2nd RKF/Formula variable2.
    in third one you do 3rd RKF/Formula variable3.
    Hope, you understood my explanation.
    With rgds,
    Anil Kuamr Sharma .P

  • How to get the day value from the current time?

    Hi,
    I like to write a program that prints out the current time in the formate as "Thu May 3 07:57:02 PDT 2002". Then I want to get the day, time, year and month value out and do some manipulation.
    I know to format the current time, I can use
    SimpleDateFormat formatter
    = new SimpleDateFormat ("EEE MM.dd hh:mm:ss z yyyy");
    Date currentTime_1 = new Date();
    Now how do I get the day, time, year and month value? All the getday(), gettime()..,method have been deprecated. Can anyone provide the answer?
    Thanks.

    Try using Calendar.get(int) and take a look at the constants used to specify the field you are trying to access.

  • Second working day of a month

    hello abaper,
      Cud u pls tel me how to get second working date of any month

    Function group                 Function group short text
    Function Module Name           Short text for function module
    CATSXT_UTIL
    CATSXT_GET_HOLIDAYS
    DTCO
    CHECK_HOLIDAY
    COLLECT_HOLIDAY_DT
    FB00
    BKK_CHECK_HOLIDAY
    HRFBN00GENERAL                 Function Group for FBN FMs
    HR_FBN_GET_HOLIDAY_PLAN_COST   Display FlexBen Holiday Cost in IT0377
    HRFBN00MISCEL                  Function Group for Misce. Plans FBN
    HR_FBN_UPDATE_HOLIDAY_QUOTA    Anmeldung eines Mitarbeiters für Sonstige Pläne
    HRPAYBE_SRD_UN05
    HR_BE_DAQ_UN05_NATUDAY_HOLIDAY Get nature of day
    HR_BE_UN05_PUBLIC_HOLIDAY      Get replacement day for public holiday falling on a day-
    off
    HRPAYDETM01
    HR_DE_CHECK_HOLIDAY
    HR_DE_GET_HOLIDAY
    HR_DE_REMOVE_HOLIDAY_FROM_LIST
    HRTIM00FORMS
    HR_FORMS_READ_HOLIDAYS
    RHBD
    RH_REQUEST_ON_BEFOREHOLIDAYS
    RH_REQUEST_ON_HOLIDAYS
    RPTM
    RP_GET_REMAINING_HOLIDAY
    SALP_UI                        User Interface for PerfDB
    SALP_UI_F4_HOLIDAY             f4-help for holiday & factory calendar
    SCA5                           Calendar: Additional functions
    HOLIDAY_CALENDAR_GET
    HOLIDAY_GET
    SCAL                           Calendar functions
    HOLIDAY_CHECK_AND_GET_INFO     Calendar function: Public holiday check with information
    SCTR                           Transport public holiday texts
    HOLIDAYTEXT_CORRECT_KEY
    HOLIDAYTEXT_FIND_OUT_RULES
    SFT1                           CHDO HOLIDAY => Gen. by RSSCD000
    HOLIDAY_WRITE_DOCUMENT         CHDO HOLIDAY => Gen. by RSSCD000
    SFT2                           CHDO HOLIDAYCAL => Gen. by RSSCD000
    HOLIDAYCAL_WRITE_DOCUMENT      CHDO HOLIDAYCAL => Gen. by RSSCD000
    WSAF
    WSAF_OUTBOUND_PUBHOLIDAYS
    try these...
    ALSO
    Date, Month and Popup Related Function Modules
    Date/Month Related Function Modules:
    DATE_COMPUTE_DAY u2013 Finds day of the month
    DATE_CONV_EXT_TO_INT  - user formatted date is converted to system date
    DATE_GET_WEEK  - convert date into year + week format
    DATE_TO_DAY u2013 gives weekday from date
    DATE_IN_FUTURE u2013 takes number of days and date  - gives future date in user format and system format
    MONTH_PLUS_DETERMINE u2013 add or subtract month from a date
    RH_GET_DATE_DAYNAME - return the day based on the date provied
    DATE_COMPUTE_DAY
    DATE_TO_DAY
    RP_CALC_DATE_IN_INTERVAL_SG u2013 add/subtract year/month/days from a date
    DAY_ATTRIBUTES_GET
    WEEK_GET_FIRST_DAY u2013 take input as YYYYWW and it gives first day of the week.
    MONTH_NAMES_GET u2013 language is only parameter. Returns internal table with months.
    MONTH_PLUS_DETERMINE u2013 subtract months from date

  • How to get 10th day of every month?

    Hi All,
    please find the below requirement , how to achive this?
    " Show the Actual as a bar on a monthly frequency, with Actual costs shown as they existed on the 10th business day of each month, going back six months – the Target can be shown as a line"
    Please help me out
    thanks
    Swapna

    HI ,
    implement this function in ur colum edit
    EVALUATE('TRUNC(%1,''MONTH'')+09',colmn_name)
    u wil get answer for this requirement
    regards
    srinivas

  • How to get same day of a month in every year in the DB ( To update a flag )

    Hi,
    I am trying to formulate an update query for a flag table in our database which contains dates, and flag columns. Currently the system have dates for the next ten years. The flags are updated with values 0 or 1 if a particular date falls under the required criteria.
    I need to update flag column for the same day of the month in every year. e.g. 2nd Sunday of October. The value should be updated to all years in the table. Currently I am using the following query to update the current year.
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7;
    and for next year Like
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = add_months(NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7,+12)-1;
    This is not an excellent way to do it as it does not take care of leap years and it does not scan and update values in the whole table for all years correctly.
    Can any one help me to resolve this please.

    Hi,
    user10903866 wrote:
    Hi,
    I am trying to formulate an update query for a flag table in our database which contains dates, and flag columns. Currently the system have dates for the next ten years. The flags are updated with values 0 or 1 if a particular date falls under the required criteria.
    I need to update flag column for the same day of the month in every year. e.g. 2nd Sunday of October. The value should be updated to all years in the table. Currently I am using the following query to update the current year.
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7;That's the 2nd Sunday after October 1; the 2nd Sunday of October is the 2nd Sunday after September 30, so you need to subtract 1 more day before calling NEXT_DAY.
    I'd do it this way:
    WHERE   c_date = NEXT_DAY ( TO_DATE ( '01-OCT-2013', 'DD-MON-YYYY') - 8
                             , 'SUNDAY'
                     ) + (7 * 2)     -- Last number is week numberRemember, calling NEXT_DAY like this depends on your NLS_DATE_LANGUAGE.
    and for next year Like
    UPDATE FILTERCALENDAR SET YEAR_WINDOW=1 WHERE c_date = add_months(NEXT_DAY( TO_DATE('OCT-2013','MON-YYYY'), 'SUNDAY') + (2-1)*7,+12)-1;If you want the 2nd Sunday in October, 2014, then take the previous expression, and just change 2013 to 2014:
    WHERE   c_date = NEXT_DAY ( TO_DATE ( '01-OCT-2014'     -- or any month and year you want
                                        , 'DD-MON-YYYY'
                            ) - 8
                             , 'SUNDAY'
                     ) + (7 * 2)     -- Last number is week number
    This is not an excellent way to do it as it does not take care of leap years and it does not scan and update values in the whole table for all years correctly.
    Can any one help me to resolve this please. 
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    In the case of a DML operation (such as UPDATE) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
    Explain, using specific examples, how you get those results from that data.
    See the forum FAQ {message:id=9360002}

Maybe you are looking for

  • Importing iTunes playlists to Sonos

    I use a Sonos to play my itunes music -- where do I find the itunes playlist files so I can put them in my music folder and import them to Sonos playlists?

  • Purchse Register

    Hi, What is significance of purchse ragister in business point of view?    How this report will be prepared in +BI ?+     How this report will be prepared in R/3 with help of ABAP? Thanks and Regards   Anil Patil

  • Creation of WBS Element Hierarchy

    Hi Friends, I have input file like the below(1 Project definition and n WBS elements) Project Definition     WBS Element HE-000200                           HE-000200.01                      HE-000200.01.00001                      HE-000200.01.00002

  • File Adapter determining file size

    I have added a Header Variable to my Receive activity so that I can capture the size of the file coming in. I've also added a "size" element to the InboundFileHeader.wsdl. I can't figure out how to populate that header variable! I was hoping it would

  • Mac OS X, PSE 6.0 won't open downloaded .asl files

    Down loaded fx .asl files, moved them to the Styles fill but I can't get them to open by any path. New brushes, gradients and patterns, all fine.