Working Days

Hi All,
I have posted a similar post in the reporting forum as i'm looking at ways to handle non-working days within SR SLA's.
For example, a Service Request is raised on Friday and I would like the number of days to close that service request to exclude Saturday and Sunday? Obviously there is no working days calender in CRM On Demand so i'm just going to ignore bank holidays etc for now. I was thinking one option being the creation of a new field on the SR entity which date stamps when the SR should be completed by. This would be calculated based on a few factors which is fine. but if this falls over a weekend the date would be inaccurate, any ideas?
Thanks
Oli @ Innoveer

I have used the following in Reporting, it might have some value to your requirements.
Okay, if your report is using the Service Request History subject area, use this code exactly:
(CASE WHEN /* Convert Sunday to the Business Day Of the Year */
DAYOFWEEK("Service Request"."Closed Date and Time" )=1
THEN (DAYOFYEAR("Service Request"."Closed Date and Time")-WEEK("Service Request"."Closed Date and Time"))-(WEEK("Service Request"."Closed Date and Time")-2) /* Convert Saturday to the Business Day Of the Year */
WHEN DAYOFWEEK("Service Request"."Closed Date and Time" )=7
THEN (DAYOFYEAR("Service Request"."Closed Date and Time")-WEEK("Service Request"."Closed Date and Time"))-(WEEK("Service Request"."Closed Date and Time")-1) /* Convert Mon-Fri to the Business Day Of the Year */
ELSE (DAYOFYEAR("Service Request"."Closed Date and Time")-WEEK("Service Request"."Closed Date and Time"))+(2-WEEK("Service Request"."Closed Date and Time")) END)
- (CASE WHEN /* Convert Sunday to the Business Day Of the Year */
DAYOFWEEK("Service Request"."Opened Date" )=1 THEN (DAYOFYEAR("Service Request"."Opened Date")-WEEK("Service Request"."Opened Date"))-(WEEK("Service Request"."Opened Date")-2) /* Convert Saturday to the Business Day Of the Year */ WHEN DAYOFWEEK("Service Request"."Opened Date" )=7
THEN (DAYOFYEAR("Service Request"."Opened Date")-WEEK("Service Request"."Opened Date"))-(WEEK("Service Request"."Opened Date")-1) /* Convert Mon-Fri to the Business Day Of the Year */
ELSE (DAYOFYEAR("Service Request"."Opened Date")-WEEK("Service Request"."Opened Date"))+(2-WEEK("Service Request"."Opened Date"))
END) + /* Adjust for Year Change */ (365 * (YEAR("Service Request"."Closed Date and Time")-YEAR("Service Request"."Opened Date")))
If your report is using the Service Request subject area, use this code exactly:
(CASE WHEN /* Convert Sunday to the Business Day Of the Year */
DAYOFWEEK("Service Request"."Closed Date and Time" )=1
THEN (DAYOFYEAR("Service Request"."Closed Date and Time")-WEEK("Service Request"."Closed Date and Time"))-(WEEK("Service Request"."Closed Date and Time")-2) /* Convert Saturday to the Business Day Of the Year */
WHEN DAYOFWEEK("Service Request"."Closed Date and Time" )=7
THEN (DAYOFYEAR("Service Request"."Closed Date and Time")-WEEK("Service Request"."Closed Date and Time"))-(WEEK("Service Request"."Closed Date and Time")-1) /* Convert Mon-Fri to the Business Day Of the Year */
ELSE (DAYOFYEAR("Service Request"."Closed Date and Time")-WEEK("Service Request"."Closed Date and Time"))+(2-WEEK("Service Request"."Closed Date and Time")) END)
- (CASE WHEN /* Convert Sunday to the Business Day Of the Year */
DAYOFWEEK("Service Request"."Opened Date and Time" )=1 THEN (DAYOFYEAR("Service Request"."Opened Date and Time")-WEEK("Service Request"."Opened Date and Time"))-(WEEK("Service Request"."Opened Date and Time")-2) /* Convert Saturday to the Business Day Of the Year */ WHEN DAYOFWEEK("Service Request"."Opened Date and Time" )=7
THEN (DAYOFYEAR("Service Request"."Opened Date and Time")-WEEK("Service Request"."Opened Date and Time"))-(WEEK("Service Request"."Opened Date and Time")-1) /* Convert Mon-Fri to the Business Day Of the Year */
ELSE (DAYOFYEAR("Service Request"."Opened Date and Time")-WEEK("Service Request"."Opened Date and Time"))+(2-WEEK("Service Request"."Opened Date and Time"))
END) + /* Adjust for Year Change */ (365 * (YEAR("Service Request"."Closed Date and Time")-YEAR("Service Request"."Opened Date and Time")))
I have verified that both formulas are error free when used in the correct subject area... the column that you start with does not matter... just be sure to completely blank the existing formula before pasting in this one.

Similar Messages

  • To find the no of working days b/w given date

    Hi ABAP Experts,
             Here i have one requirement .
             table is tfacs
              in  this table i want to know the no of working days b/w  the given date. Here i have attached my code .pls go through it and do me needful.
    TABLES : tfacs,vbrk.
    DATA: BEGIN OF ty_tfacs OCCURS 0,
            ident TYPE tfacs-ident,
            jahr TYPE tfacs-jahr,
            mon01 TYPE tfacs-mon01,
            mon02 TYPE tfacs-mon02,
            mon03 TYPE tfacs-mon03,
            mon04 TYPE tfacs-mon04,
            mon05 TYPE tfacs-mon05,
            mon06 TYPE tfacs-mon06,
            mon07 TYPE tfacs-mon07,
            mon08 TYPE tfacs-mon08,
            mon09 TYPE tfacs-mon09,
            mon10 TYPE tfacs-mon10,
            mon11 TYPE tfacs-mon11,
            mon12 TYPE tfacs-mon12,
            basis TYPE tfacs-basis,
            fenum TYPE tfacs-fenum,
            wenum TYPE tfacs-wenum,
            load TYPE  tfacs-load,
            string1(31) TYPE c,
            string2(31) TYPE c,
            string3(31) TYPE c,
            string4(31) TYPE c,
            string5(31) TYPE c,
            string6(31) TYPE c,
            string7(31) TYPE c,
            string8(31) TYPE c,
            string9(31) TYPE c,
            string10(31) TYPE c,
            string11(31) TYPE c,
            string12(31) TYPE c,
            uk(31) TYPE c,
            total1 TYPE i,
            total2 TYPE i,
            total3 TYPE i,
            total4 TYPE i,
            total5 TYPE i,
            total6 TYPE i,
            total7 TYPE i,
            total8 TYPE i,
            total9 TYPE i,
            total10 TYPE i,
            total11 TYPE i,
            total12 TYPE i,
            END OF ty_tfacs.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_jahr FOR tfacs-jahr MODIF ID b1.
    SELECT-OPTIONS : mon FOR tfacs-mon01  MODIF ID b1.
    SELECT-OPTIONS :  s_month FOR vbrk-erdat MODIF ID b2.
    SELECTION-SCREEN : END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME.
    PARAMETERS  r1 RADIOBUTTON GROUP c DEFAULT 'X' USER-COMMAND flag .
    PARAMETERS  r2 RADIOBUTTON GROUP c .
    SELECTION-SCREEN END OF BLOCK b.
             INITIALIZATION
    INITIALIZATION.
    AT SELECTION-SCREEN OUTPUT.
      IF r1 NE space.
        LOOP AT SCREEN.
          IF screen-group1 EQ 'B2'.
            screen-output = 1.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          IF screen-group1 EQ 'B1'.
            screen-output = 1.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
              start - of - selection
    start-of-selection.
      IF r1 = 'X'.
        PERFORM get-data.
        PERFORM display-data.
      ENDIF.
    &      form  get-data
           text
      -->  p1        text
      <--  p2        text
    form get-data .
      DATA :  total1  TYPE i.
      SELECT * FROM tfacs INTO TABLE ty_tfacs
                                     WHERE ident EQ 'IN'
                                     AND   jahr IN s_jahr.
      LOOP AT  ty_tfacs WHERE ident = 'IN'.
        IF sy-subrc EQ 0.
          PERFORM get_string USING ty_tfacs-string1
                                   ty_tfacs-mon01
                                   ty_tfacs-total1.
          PERFORM get_string USING ty_tfacs-string2
                                    ty_tfacs-mon02
                                    ty_tfacs-total2.
          PERFORM get_string USING ty_tfacs-string3
                                   ty_tfacs-mon03
                                   ty_tfacs-total3.
          PERFORM get_string USING ty_tfacs-string4
                                         ty_tfacs-mon04
                                         ty_tfacs-total4.
          PERFORM get_string USING ty_tfacs-string5
                                         ty_tfacs-mon05
                                         ty_tfacs-total5.
          PERFORM get_string USING ty_tfacs-string6
                                         ty_tfacs-mon06
                                         ty_tfacs-total6.
          PERFORM get_string USING ty_tfacs-string7
                                         ty_tfacs-mon07
                                         ty_tfacs-total7.
          PERFORM get_string USING ty_tfacs-string8
                                         ty_tfacs-mon08
                                         ty_tfacs-total8.
          PERFORM get_string USING ty_tfacs-string9
                                         ty_tfacs-mon09
                                         ty_tfacs-total9.
          PERFORM get_string USING ty_tfacs-string10
                                         ty_tfacs-mon10
                                         ty_tfacs-total10.
          PERFORM get_string USING ty_tfacs-string11
                                         ty_tfacs-mon11
                                         ty_tfacs-total11.
          PERFORM get_string USING ty_tfacs-string12
                                         ty_tfacs-mon12
                                         ty_tfacs-total12.
        ENDIF.
        ty_tfacs-uk = ty_tfacs-total1 + ty_tfacs-total2
                      + ty_tfacs-total3 + ty_tfacs-total4
                      + ty_tfacs-total5 + ty_tfacs-total6
                      + ty_tfacs-total7 + ty_tfacs-total8
                      + ty_tfacs-total9 + ty_tfacs-total10
                      + ty_tfacs-total11 + ty_tfacs-total12.
        MODIFY  ty_tfacs TRANSPORTING  total1 total2 total3
                                       total4 total5 total6
                                       total7 total8 total9
                                       total10 total11 total12
                                       uk.
      ENDLOOP.
    PERFORM write1-data USING 'COU' 'YEAR' 'MONTH01'
                               'MONTH02' 'MONTH03' 'MONTH04'
                               'MONTH05' 'MONTH06' 'MONTH07'
                               'MONTH08' 'MONTH09' 'MONTH10'
                               'MONTH11' 'MONTH12' 'TOTAL WDAYS' .
    LOOP AT ty_tfacs.
       PERFORM write1-data USING ty_tfacs-ident ty_tfacs-jahr
                                 ty_tfacs-total1 ty_tfacs-total2
                                 ty_tfacs-total3 ty_tfacs-total4
                                 ty_tfacs-total5 ty_tfacs-total6
                                 ty_tfacs-total7 ty_tfacs-total8
                                 ty_tfacs-total9 ty_tfacs-total10
                                 ty_tfacs-total11 ty_tfacs-total12
                                 ty_tfacs-uk.
    ENDLOOP.
    ENDFORM.                    " get-data
    TOP-OF-PAGE.
      FORMAT COLOR 5 ON.
      WRITE :/10 'COUNTRY',
              20 'YEARS',
              35 'MON01',
              45 'MON02',
              55 'MON03',
              65 'MON04',
              75 'MON05',
              85 'MON06',
              95 'MON07',
              105 'MON08',
              115 'MON09',
              125 'MON10',
              135 'MON11',
              145 'MON12',
              170 'total wdays'.
      FORMAT COLOR OFF.
      WRITE :/ SY-ULINE.
    *&      Form  display-data
          text
    -->  p1        text
    <--  p2        text
    FORM display-data .
      LOOP AT ty_tfacs.
        WRITE :/10 ty_tfacs-ident,
                20 ty_tfacs-jahr,
                30 ty_tfacs-total1,
                40 ty_tfacs-total2,
                50 ty_tfacs-total3,
                60 ty_tfacs-total4,
                70 ty_tfacs-total5,
                80 ty_tfacs-total6,
                90 ty_tfacs-total7,
               100 ty_tfacs-total8,
               110 ty_tfacs-total9,
               120 ty_tfacs-total10,
               130 ty_tfacs-total11,
               140 ty_tfacs-total12,
               150 ty_tfacs-uk.
      ENDLOOP.
    ENDFORM.                    " display-data
    *&      form  get_string
          text
         -->p_0250   text
         -->p_0251   text
         -->p_0252   text
    form get_string  using    p_0250   " month
                              p_0251   " string
                              p_0252.  " total
    p_0250 = p_0251.  " move month to string
    TRANSLATE p_0250 USING '0 ' . " translate
    CONDENSE p_0250  NO-GAPS.     " condense
    p_0252 = STRLEN( p_0250 ).    " pass length of string to total
    ENDFORM.                    " get_string
    ***&      Form  write1-data
          text
         -->P_0306   text
         -->P_0307   text
         -->P_0308   text
         -->P_0309   text
         -->P_0310   text
         -->P_0311   text
         -->P_0312   text
         -->P_0313   text
         -->P_0314   text
         -->P_0315   text
         -->P_0316   text
         -->P_0317   text
         -->P_0318   text
         -->P_0319   text
         -->P_0320   text
    *form write1-data  using    p_0306
                              p_0307
                              p_0308
                              p_0309
                              p_0310
                              p_0311
                              p_0312
                              p_0313
                              p_0314
                              p_0315
                              p_0316
                              p_0317
                              p_0318
                              p_0319
                              p_0320.
    *WRITE :/ p_0306,
            p_0307,
            p_0308 left-justified,
            p_0309 left-justified,
            p_0310 left-justified,
            p_0311 left-justified,
            p_0312 left-justified,
            p_0313 left-justified,
            p_0314 left-justified,
            p_0315 left-justified,
            p_0316 left-justified,
            p_0317 left-justified,
            p_0318 left-justified,
            p_0319 left-justified,
            p_0320 left-justified.
    *ENDFORM. " write1-data
    from this report what i am getting is year and its 12 months but my requirement is i will give date using select options and i should get the total no of  working days in b/w this date.

    Use the following code to find no of working days b/w given date. Use the correct factory_calendar_id in the function module. L_DAYS will display the required result:
    PARAMETERS: p_date1 TYPE sydatum,
               p_date2 TYPE sydatum.
    DATA: date1        LIKE scal-date,
         date2        LIKE scal-date,
         correction   LIKE scal-indicator,
         calendar     LIKE scal-fcalid,
         factorydate1  LIKE scal-facdate,
         workday1      LIKE scal-indicator,
         factorydate2  LIKE scal-facdate,
         workday2      LIKE scal-indicator,
         l_days TYPE scal-facdate.
    CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
      EXPORTING
        date                       = p_date1
        correct_option             = '+'
        factory_calendar_id        = 'US'
      IMPORTING
        date                       = date1
        factorydate                = factorydate1
        workingday_indicator       = workday1
      EXCEPTIONS
        correct_option_invalid     = 1
        date_after_range           = 2
        date_before_range          = 3
        date_invalid               = 4
        factory_calendar_not_found = 5.
    IF sy-subrc = 0.
      CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
        EXPORTING
          date                       = p_date2
          correct_option             = '+'
          factory_calendar_id        = 'US'
        IMPORTING
          date                       = date2
          factorydate                = factorydate2
          workingday_indicator       = workday2
        EXCEPTIONS
          correct_option_invalid     = 1
          date_after_range           = 2
          date_before_range          = 3
          date_invalid               = 4
          factory_calendar_not_found = 5.
      IF sy-subrc = 0.
        l_days = factorydate2 - factorydate1.
        WRITE: / l_days.
      ENDIF.
    ENDIF.

  • Working days between two date fields and Changing Factory Calendar

    Hi,
    I have to calculate working days between two date fields excluding the weekends and public holidays for Switzerland.
    I have written the routine using factory calender and its working fine except for two problems now:
    1. If any one of the date field is empty then teh rsult should be zero.
    2. And the below code is working from 1996 but my cleints wants it to work for years before 1996 as well.
    I also tried to change the Start date in SCAL for factory calendar but it says enter values between 1995 to 2020.
    I am new to ABAP. Please help me how i can achieve these for below code.
    DATA: IT_HOLIDAYS type TABLE OF ISCAL_DAY,
          IS_HOLIDAYS TYPE ISCAL_DAY.
    DATA: T_DATE TYPE SY-DATUM,
          P_DATE TYPE SY-DATUM.
    DATA : X_DATE(4) TYPE C.
    DATA: CNT TYPE I.
    REFRESH : IT_HOLIDAYS.
    CLEAR : IT_HOLIDAYS.
    T_DATE = SOURCE_FIELDS-/BIC/ZCCCHP812.
    P_DATE = SOURCE_FIELDS-/BIC/ZCCCHP810.
    CALL FUNCTION 'HOLIDAY_GET'
    EXPORTING
    HOLIDAY_CALENDAR = 'CH'
    FACTORY_CALENDAR = 'CH'
    DATE_FROM = P_DATE
    DATE_TO   = T_DATE
    TABLES
    HOLIDAYS = IT_HOLIDAYS
    EXCEPTIONS
    FACTORY_CALENDAR_NOT_FOUND = 1
    HOLIDAY_CALENDAR_NOT_FOUND = 2
    DATE_HAS_INVALID_FORMAT = 3
    DATE_INCONSISTENCY = 4
    OTHERS = 5.
    DESCRIBE TABLE IT_HOLIDAYS LINES CNT.
    X_DATE = T_DATE - P_DATE - CNT.
    RESULT = X_DATE.
    Please help
    Regards
    Zabina
    Edited by: Syed786 on Nov 2, 2011 9:15 AM

    Hi Zabina,
    Try this function module  'DURATION_DETERMINE'.
    Give the factory calendar and unit as DAY
    With regards,
    Rajesh

  • How to show no. of actual working days in Payslip in case of +ve time mgt

    Dear Experts,
    We have a requirement of showing no. of actual working days in payslip, which should be Calendar Days-(Paid+Unpaid absence). I created an w/t 1WRD for actual working days. Our paid absence w/t is 2006 and unpaid absence is 2005 copied from /845 and /846 respectively, both the absences are included in absence valuation table and working fine in that respect. But issue is i wrote a small PCR for calculating actual working days like below:
    ZWRD
         NUM=TKSOLL Set
         NUM-E 2005
         NUM-E 2006
        ADDWTE1WRD
    But still its fetching full working days i.e. calendar days 30 or 31 not deducting paid or unpaid absence for a month.
    Pls help, what else should i do.
    Regards
    Tan

    Sorry, i am unable to paste RT, but its exactly as below
    01, April, 2011
    1WRD Working days     30.00
    2006  Paid Absence       2.00                
    02, May, 2011
    1WRD Working days     31.00
    2005  Unpaid Absence   1.00                 
    regards
    Tan

  • How to get the last(latest or previous) working day

    hi,
    using sysdate we may be getting today's date and sysdate-1 will be fetching the yesterday's date. but if sysdate-1 turns to be sunday or a holiday then we need to get the previous date to that holiday date .THe list of holidays are in lt_list_holidays. The Holiday date shall be the holiday_date column. I need a query which displays the last (latest or previous) working day ..
    Please advice
    Edited by: vine on Jul 20, 2010 5:30 AM
    Edited by: vine on Jul 20, 2010 5:51 AM

    Hi,
    vine wrote:
    hi ,
    THe queery seems to be fine but in the middle if we have any holidays and the holidays are in lt_list_holidays table . the name of the holiday date is holiday_date in lt_list_holiday.Is the name of the holiday important? I'll assume not. I'll also assume you have a column d (a DATE) that is the date of the holiday.
    >
    Please adviceThat's quite a different problem from what you first posted.
    Instead of posting a question x, waiting for someone to answer it, and then saying that the problem is really y, don't you think it would be better to post question y in the first place?
    You can do something like this:
    WITH     prev_days     AS
         SELECT     TRUNC (SYSDATE) - LEVEL     AS a_date
         FROM     dual
         CONNECT BY     LEVEL <= 4     -- worst case (see below)
    SELECT     MAX (a_date)     AS previous_work_day
    FROM     prev_days
    WHERE     TO_CHAR (a_date, 'Dy', 'NLS_DATE_LANGUAGE=''ENGLISH''')
                   NOT IN ('Sat', 'Sun')
    AND     NOT EXISTS ( SELECT  1
                   FROM    lt_list_holiday
                   WHERE   d     = prev-days.a_date
    ;Where I work, holidays are never consecutive, in fact, they are always at least 7 days apart, so I can be sure that a period of 4 consectuive days will always contain at least one work day. (There may be two weekend days plus one holiday; that's the worst case.) If you can have two or more holidays in a row, or holidays spaced 3 days apart (so that one might fall on a Friday, and the other on Monday), then increase the "magic number" 4 in
         CONNECT BY     LEVEL <= 4     -- worst caseto something appropriate. If you put it too high (say 10), no serious harm is done.

  • Working days formula and Crystal 7 - is it possible?

    Post Author: Tim F
    CA Forum: Formula
    Hi folks,
    Really hope someone can help, I'm struggling with writing a report that needs to show the difference between two dates in working days. I've found the same formula posted here several times but cannot get it to return a logical value in my report. I'm wondering if that might be because I'm using an older version of Crystal? The formula in question is this one:
    //Main formulaWhileReadingRecords;Local DateVar Start := ({PPV_COMPLAINTSEH.DTRECD});   Local DateVar End := ({PPV_COMPLAINTSEH.ACTCMPLTD}); Local NumberVar Weeks; Local NumberVar Days; Local Numbervar Hol;DateVar Array Holidays;
    Weeks:= (Truncate (End - dayofWeek(End) + 1 - (Start - dayofWeek(Start) + 1)) /7 ) * 5;Days := DayOfWeek(End) - DayOfWeek(Start) + 1 + (if DayOfWeek(Start) = 1 then -1 else 0)  + (if DayOfWeek(End) = 7 then -1 else 0);  
    Local NumberVar i;For i := 1 to Count (Holidays)do (if DayOfWeek ( Holidays&#91;i&#93; ) in 2 to 6 and      Holidays&#91;i&#93; in start to end then Hol:=Hol+1 );
    Has anyone come across an alternative way of doing this, or have any ideas why this formula is not working in my report? Any advice would be much appreciated,
    Regards,
    Tim

    Post Author: Charliy
    CA Forum: Formula
    You set up a Running Total.  Drag the filed you want Summed, Select Sum as the operation if that is not the default.
    Just below that you weill see Radio Buttons that say For Every Record, On Change of Group, On Change of Field, Use a Formula, etc - click the one that says Use a Formula.  The Blue Bos to its right will turn Red, click on it, this is where you put your formula: NOT(DATEPART('w',{table.date}) IN &#91;6,7&#93;)
    Save that, then just decide if you want it reset on a Change of Group, or Never (Grand Total).  Give it a name and put it on your report.

  • Sales order schedule date is a (working) day before Scheduled ship date

    In MRP/MPS planning, the forecast consumption is occuring for all sales orders at a date (sales order schedule date) which is always a working day before the Scheduled Ship Date (SSD). What is the logic?
    Time fences are not used.
    E.g. Sales order is scheduled to ship (SSD) on 30th Nov, in forecast set > Forecast items > Consumptiion > Detail, the sales order schedule date is a day before SSD.

    Hi,
    This is a complex issue; best solution is by using APO/GATP.
    If not, then in ERP only, the second best is:
    1) Work with assembly processing in SO, meaning that a production/planned order is automatically created in the customer order during order creation.
    2) Then, after the order is created it is scheduled, and the delivery date proposal is based on that.
    3) Now you can check in the order that there are no capacity overloads, and all capacity required to produce on the proposed date is available. If yes, you're done. If not, it gets a bit complex, since you actualy need to switch to capacity planning, do capacity leveling and dispatch (PP), and the you get a new feasible schedule proposal based on that.
    APO/GATP could do all that automatically!
    Regards,
    Mario

  • Add number of working days

    I have to subtract a number of 'working days' of a date field in my message mapping.
    I wrote a user defined function. I used cal.add(Calendar.DATE, -3); on the instance cal of the class Calendar. It subtracts 3 days, but I have to subtract 3 'working days'.
    Has anyone a suggestion how to achieve this?
    Kind regards
    Frank

    Frank,
        Since you said that there is FM available in R/3 DATE_CHECK_WORKINGDAY. I would suggest you to do RFC Lookup and get the response if it not working day, then subtract 1 from the current day, and again do lookup to check whether its working day or not. Finally if you get the response as Working day, then subtract 3 from the day(not from the current date, instead the subtracted date , in my previous step).
    But  it will not solve your issue. The above I said is an approach. Because, consider the below example.
    Current day is Saturday, you r doing RFC lookup and getting response as not-working day. Hence on subtracting 1 you will get Friday, now again you are doing RFC look up , this time you will get response as working day , immediately you will subtract 3 from friday, Finally you will get the result as tuesday!!!!
    Do you think its correct? Yah sometimes, because while subtracting 3 from friday we have to make sure that thursday & wednesday must not be holiday. I think you got my example, If I'm wrong , please reply me back.
    Hope it clears.
    The above is an approach, its not the solution. If you look its good we have to apply logic to ahieve the result.
    Best Regards,
    raj.

  • Absence Quota to be generated on basis of Working Day

    Hi Experts,
    I have got a scenario in Time management ( negative time management, no time evaluation) where the client wants absence quota to be generated on the basis of working days of employee. I have checked the configuration for creating base entitlement V_t559E but the following options are available:
    Currently i have done the cofiguration on the basis of Accrual period, leave entitlement is 22 days in a year. Wherein entilement each month is coming to 1.83 leaves, but client wants that in case employee is come for only 5 working days in a month the leave generation should accordingly get prorated and in case of 0 working days in a month there should be no entitlement.
    Calendar year
    Accrual period
    Time evalution period
    Payroll period
    Other period
    Please help.
    Regard,
    Jyoti

    Firstly Update the Period Parameters as per ur dates this has to be done manually T549Q
    later generate the Pay Roll Periods useing this Period Paramter
    and Change the evaluation Period parameter  in T559L to the Period paratmeter  which you have generated
    a lot of threads has been raised on the same issue please check

  • Schedule background job for working days

    Hi,
    I would like to schedule a background job, but only runs on working days (from Monday to Friday), I am wondering whether it is possible to run as mentioned or not?
    Kindly advise!
    Thanks!!
    br,
    hy

    hi
        F9 - > click date/time, after the at operation mode tab, there is an arrow mark, click it, in taht mention your factory calendar id (which includes public holidays and specify from which workday it should start, time), then check and come back to the main screen, check periodic job, click the periodic values tab, in that specify it as daily...will solve your requirement
    if helpful, reward
    Sathish. R

  • Weekly schedule line should pass to last working day of the week in SAg

    HI,
    In a scheduling agreement when we have weekly or monthly schedules the system displays the date in the screen as 12/2010 or 13/2010 for say a weekly schedule.
    However when the data is stored in the table the delivery date is always the first working day of the week. In this case when the week is 13/2010 the data is stored in the table as 22/03/2010.
    Is there any way to change this to the last working day of the week?
    We have some config related to define delivery intervals in IMG--> Sales and Distribution --> Sales --> Sales Documents --> Scheduling Agreements with Delivery Schedules --> Define Delivery Intervals. Will this help solve my issue? If it solves what is the procedure behind this?
    Request you to provide your inputs.
    Thank You, Lakshmikanth

    Hi,
    Seems the delivery split concept is different from this requirement. Can Delivery intervals concept help us or not? IMG--> Slaes and Distribution --> Sales --> Sales Documents --> Scheduling Agreements with Delivery Schedules --> Control EDI Inbound Processing --> Define Delivery Intervals.
    What is the procedure and assignment details for delivery intervals concept?
    Thanks, Lakshmikanth

  • 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

  • Current Workday SAP EXIT variable not aligned with correct work days

    Hello,
    I am trying to use the Current Workday variable within a report so that the data will only be refreshed when the calendar day is Monday - Friday. Users look at this report every day, but when they get the report on Monday we would like for the date to be restricted to the previous Friday, and then switch back to Monday's date when they view the report on Tuesday. In order to do this we have placed the Current Workday variable from the Calendar Date characteristic with an offset of negative 1, but it is showing Sunday's date when they look at the report on Monday.
    My questions are:
    -Does this variable use the factory calendar that can define the work days?
    -If so, which Factory calendar does it use? I have gone to the Tcode SCAL but I can see there are many different factory calendars and I have no idea which calendar this variable pertains to. I have also transferred the global settings for the factory calendar from the source system, and I see no change within the variable.
    -How can I see the program name behind this SAP Exit variable? My thinking is that I could at least look at the code to see if perhaps I can find out the factory calendar ID the variable refers to from there.
    Any help on this would be greatly appreciated! Until this is fixed I have to manually adjust this report every Monday and Tuesday morning!! Not ideal.

    Hi Kelly,
    I am not sure whether this can be done by an SAP Exit variable.
    But you may try this using a Customer exit variable by using the Function module DATE_COMPUTE_DAY.
    The function module "DATE_COMPUTE_DAY" will return the day by 1 to 7 when you input date.
    Monday : System will return value = 1
    Tuesday : System will return value = 2
    Wednesday : System will return value = 3
    Thursday : System will return value = 4
    Friday : System will return value = 5
    Saturday : System will return value = 6
    Sunday : System will return value = 7
    So input sy-datum to this FM and find the number of day. If it is Monday, the number will be 1.
    If output is 1, then offset date by -3 to that of Friday, else offset by -1 to previous day.
    Hope this helps,
    Regards,
    Hari

  • Working day to factory calendar date

    Hello Experts,
    I wish to get the factory calendar date, specific to a factory calendar, based on a working day.
    Basically, if i pass say 4, then i want to get the date for the 4th working day based on a specific factory calendar.
    Can someone throw some light on possible function module that i can use in BW ?
    Thanks

    That's what I was giving you, you give the working day and the factory calendar and you get the date, or you can use this function and you can do it the other way:
    (Unless I'm completely missing your point here...)
        CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
      EXPORTING
        CORRECT_OPTION                     = '+'
        DATE                               = G_WORKAREA3-CREATEDON
        FACTORY_CALENDAR_ID                = L_S_PLANT-FACTCAL_ID
      IMPORTING
    *   DATE                               =
       FACTORYDATE                        = L_FCDATE
      EXCEPTIONS
        CALENDAR_BUFFER_NOT_LOADABLE       = 1
        CORRECT_OPTION_INVALID             = 2
        DATE_AFTER_RANGE                   = 3
        DATE_BEFORE_RANGE                  = 4
        DATE_INVALID                       = 5
        FACTORY_CALENDAR_NOT_FOUND         = 6
        OTHERS                             = 7.
      ENDIF.

  • Work day of a calendar

    Hi all,
    I am searching for a FM which will say 3rd work day of a factory calendar or 4th work day of a factory calendar etc. I could see there are few FMs to say first work day - last work day but not the Nth work day. If we input some date and factory calendar, we should get which work day it is. For example if we give 09/02/2010 and factory calendar name it should return as 2nd workday etc. Any help will be appreciated..
    Thanks in advance.
    Moderator message: date calculation questions = FAQ, please search before posting.
    locked by: Thomas Zloch on Sep 15, 2010 4:39 PM

    hi,
    Please check with this fm DATE_CONVERT_TO_FACTORYDATE.
    Keerthi

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

Maybe you are looking for

  • How do I fix this layer

    I have a layer with a transparent swf movie on this page but when the page/browser is resized the layer does not move to stay in the same position on the page. It doesn't move at all. I want the layer with the swf to stay in the same position and mov

  • How do I import a playlist from itunes to my iphone?

    How do I import a playlist from itunes to my imphone?

  • PSA Edit Dialog - Not showing all the columns

    Hi All, I need to edit the transaction data for 2LIS_13_VDITM in PSA. when I go to display the PSA data it shows few selected fields in the initial display not all coming in the data source. In Order to get that field in Data Display,  I change the d

  • Where is the CLASSIC ROUTER SETUP SOFTWARE?

    I'm using EA4500 in an no Internet connecting wireless network. So the classic firmware and classic router setup software are the best for me. But, Where are the download links for the both two gone in EA4500 support page? the GREAT Google tell me he

  • [i][b]Import from MS Access[/b][/i]

    How can I import of the data from MS Access tables to Oracle tables?