How to deduct working days according to factory calender

Hi All,
      I have one date and and I want to calculate the exact date before 'N' working days according to the factory calender.
e.g. Suppose the date is 13.07.2010 and N = 10 then generally we would get date as 03.07.2010.
        But my requirement is that, it should give me the exact date 10 working days back according to the   
        factory calender. i.e. 28.06.2010 .
        Could anybody suggest me a FM or an alternate soln for the same.
Thanks in anticipation.
Ubhaka

Hi Ubhaka,
have a look at FM
BUSINESS_DATE_CREATE
you enter the following:
- a date (DATUM_EIN), from which you start
- the number of business days (GESCHAEFTSTAGE)
- the calendar ID (KALENDER)
- the direction (RICHTUNG): "-" for subtracting ode "+" for adding the business day based on the calendar
I suggest you make a copy of the FM and adapt it for your needs.
Regards,
Peter

Similar Messages

  • How to get working Date based on factory Calendar and current date

    Hi All,
    I want to deletermine a date which is Invoice date + 3 working days excluding SAT, SUN and holidays. For e.g, if Invoice date is 18th Sept, 2009, then my desired date should 23rd Sept, 2009.
    I do have factory calendar ID but i dont know the proper function module.
    Can some one please help me...

    Hi,
    check this code,
    DATA:
    w_date   TYPE dats,
    w_date1  LIKE scal-date,               " dats
    w_date2  LIKE scal-date,
    i_factid LIKE tkevs-fcalid VALUE 'IN', " IN for India
    it_dats  TYPE TABLE OF rke_dat,
    wa_dats  LIKE LINE OF it_dats,
    w_lines  TYPE i.
    CALL FUNCTION 'CALCULATE_DATE'
      EXPORTING
        days        = '0'
        months      = '1'
        start_date  = sy-datum             " for example '20090918'
      IMPORTING
        result_date = w_date.              " 1 month added '20091018'
    w_date1 = sy-datum.
    w_date2 = w_date.
    CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
      EXPORTING
        i_datab  = w_date1
        i_datbi  = w_date2
        i_factid = i_factid
      TABLES
        eth_dats = it_dats.                " number of working days between two dates
    READ TABLE it_dats INDEX 4 INTO wa_dats.
    WRITE :
      / wa_dats-periodat.                  " new date '20090923'
    Hope this will be helpfull...
    Regards
    Adil

  • Pass working day to get 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?
    Thanks

    I want to pass sy-datum to get factory date and then check if this factory date is the 4th busiess day for that month based on a specific calendar.
    Or if i can pass in 4th bus day for a month (just pass 4) based on a specific factory calendar (just pass calendar id), then i would want the factory date, which i want to compare against sy-datum in my subsequent logic.
    I am trying to trigger a data load stating if factory date for this month = 4th business day, then run load, else dont. And this in BW.
    I dont have the FM that you mentioned above, in BW and is available only in R/3

  • Get the number of working days based on factory calendr for a range of mont

    Dear all,
    We are using BI7.00 . In one of our reports we have the following requirement.
    The range of months will be given in the selection screen for example 01.2008 to 11.2008, when the query is executed, i want system to calculate the number of working days for each month of the year (for what values provided in the selection field ) and display the same. i.e., as mentioned below.
    Month                         days.
    01.2008                        22
    02.2008                        18
    03.2008                        25  etc., Kinldy provide steps for adopting the same. If it can be adopted only through customer exit also provide the code and parameters that has to be used.
    Regards,
    M.M

    hi,
    Try the following logic to find out the no.of working days in a month based on your calendar.
    parameters : mny(6).    " input format should be  yyyymm
    data : d1 like sy-datum,
           d2 like sy-datum,
           d3 like sy-datum,
           v_nds type i.
    concatenate  mny '01' into d1.
    CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
      EXPORTING
        DAY_IN            = d1
      IMPORTING
        LAST_DAY_OF_MONTH = d2
      EXCEPTIONS
        DAY_IN_NOT_VALID  = 1
        OTHERS            = 2.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    do 30 times.
      CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
        EXPORTING
          CORRECT_OPTION      = '+'
          DATE                = d1
          FACTORY_CALENDAR_ID = ' A'    " your factory calendar ID
        IMPORTING
          DATE                = d3.
      if d1 = d3.
        d1 = d1 + 1.
        v_nds = v_nds + 1.
      else.
        d1 = d3.
      endif.
      if d3 ge d2.
        exit.
      endif.
    enddo.
    write : 'No of working days ', v_nds.
    hope it helps...
    regards,
    raju

  • Urgent ***  Is No. of Planned delivery days depends on FACTORY CALENDER DAY

    Hi ,
    I question for all .  Is No. of Planned delivery days calculated on <b>FACTORY CALENDER DAY or  normal difference between PO delivery and GR date .</b>
    Please let me know ,its urgent.
    Regards ,
    Amarnath Reddy.<b></b>

    Hi,
    Planned delivery period is CALENDAR days NOT Work days.
    It does not use the factory calendar and you should not even TRY to make it do so.
    Steve B

  • How to judge working day.

    Hi friends,
    How to check the date which is the working date or not? Is there FM or codes for that?Thank you.
    Best regards,Gavin

    Hi,
    Use this Function Module: DATE_COMPUTE_DAY
    This takes I/P as the date and returns o/p as the Day count in the week.
    Also check this FM: DATE_TO_DAY which gives the Day of the Entered.
    Hope this Helps.
    Reward if useful.
    Regards
    Vinayak

  • Factory calender issue -reg.

    During maintenance off we need to change the factory calender to holidays for production shut down purpose .
    At the same time warehouse will work through which billing and other things happen.
    if i set the days as holidays in factory calender ware hose is not able to bill during these days .
    if i am setting as working days production planning is getting effected.
    we can not use two different calenders as we can assign only one calender to a plant
    what shall we do?
    waiting for positive reply
    regards
    madhu.

    Hi,
    The non working days and working days in the factory calender can be overrided
    in the shift sequence .
    steps to follow :
    1 Go to Workcenters Scheduling tab page.
    2.Click Capacties Header.
    3. Go to intervals and shifts .
    4. Edit --> insert --> insert interval
       Enter maintenance off date and in the workdays coloumn
       three options are available.
       option 1 : working days according to factory calender
       option 2 : Non working days( overrides factory
                  calender)
       option 3 : working days (overrides factory calender)
    This means for your problem you need to enter the option2
    ie though you have specified in factory calender as working day, for all these workcenters the system will
    plan in such a way as holiday on the specified date.
    Other areas won't get affected.
    Regards,
    nandha

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

  • Factory Calendar to prevent delivery on a non-working day

    Hi Guys,
    You may have already come across this problem and hence requesting your inputs on the same.
    I'm able to create a delivery for a sales order on a week-end even though they happen to be 'non-working days' in my Factory Calendar. I have gone through the search forum and the 2 things that most of them said was to attach the Factory Calendar (having Sat and Sun as non-working days) to the Plant and Shipping Point, which I have already done, inspite of which I'm able to create a delivery for a schedule line date which falls on a non-working day.
    My business scenario requires that even though a Sales Order may be created on a non-working day, the delivery should only be possible on the next working day, even if stock is available on those non-working days.
    Your thoughts/suggestions/ideas would be useful.
    Regards,
    Shripad

    Hi Shripad,
    In Customer Master, General Data , We have  Unloading Points  Option. There we can opt for the delivery to the cutomer.
    Then we can stop delivery for that day.
    Award points if it adds information.
    Thanks
    Mohan

  • [CRM to BI] Servcie Order duration in working days (local calendar)

    Hi all,
    We need to analyze in BI reporting service orders and duration of open orders in working days according to local calendar
    How to send data from CRM to BI?
    Standard extractors 0CRM_SRV_PROCESS_H / 0CRM_SRV_PROCESS_I send information about date of order ceration, order completion, status, etc
    How to do it according to standards?
    Do I need to set up custom Duration Type (SPRO - Date Management), add it to the Service Order document type and expand standard extractor of service orders?
    Or probably it is better to calculate working days in BI according to date of order creation?
    Thanks!

    Hi,
        check this link Equipment Downtime
    I believe u may have to recalculate the breakdown hrs using some FM in user exit QQMA0014 QM/PM/SM: Checks before saving a notification

  • 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

  • Use of "Rounding work days" in shipping point?

    Hi, Could someone please explain to me how the "rounding work days" in shipping point is used for ATP purpose (within R/3 itself)?
    Let's assume that the Delivery date is coming up as 18th Nov, 2011 08:00:00 hrs in schedule line, and the rounding work days is maintained as 0.2 days. Assume that the route has 1 day for transport, and this route time is relevant as per shipping point configuration.
    What would be the value of GI date/time that I should expect for the schedule line?
    Do I simply convert 0.2 days to hrs in 00:00:00 format, and subtract this time for delivery date to arrive at GI date, or could any other master data come into picture for GI date calculation?
    I am currently seeing GI on 17th Nov, 2011 00:00:00 hrs, and not able to understand this value of GI time.
    PS: Calendar for route is a custom calendar with working time from 00:00 to 24:00 hrs on all weekdays (monday to friday), and no working hrs are maintained at the shipping point.

    Hi,
    If the current date is 03.11.2011.
    you have maintained rounding work days 2 days. days specifyied in route is 1day.
    then if you raise an order for current date.system will propose schedule lines after 3 days it means 07.11.2011.
    Thank you,

  • CALCULATE THE NEXT WORKING DATE ACCORDING TO THE CALENDAR

    Hello,
    Could somebody tell me the name of any function module or abap class to determine the next working day according to calendar. I need add (let say) 30 days to the date but only working days (I dont take into acount sunday, easter etc.)
    Thanks in Advance
    Adam

    try function BKK_ADD_WORKINGDAY
    or WDKAL_DATE_ADD_FKDAYS
    Cheers
    Thomas

  • Get Previous Working Day

    Do you know any function module which will give me the previous working day only by ignoring saturdays and sundays and it should NOT consider holidays.
    Example:
    Monday's Date should give me previous friday's date.
    Friday's Date should give me previous thrusday's date

    Hello Ramesh,
    I assume you have your factory calendar ID with you:
    DATA:
        L_V_PREDT        TYPE DATUM, "Next Day.
      L_V_PREDT = SY-DATUM - 1.
    * Get the next Working Day as per Factory Calendar
      CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
        EXPORTING
          CORRECT_OPTION               = '-' " -VE  to get the previous date
          DATE                         = L_V_PREDT
          FACTORY_CALENDAR_ID          = 'HY' "--> Give your factory cal. ID here
        IMPORTING
          DATE                         = V_PREWD
        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.
      IF SY-SUBRC <> 0.
    *  Do Nothing
      ENDIF.
    If you want to use the FM: BKK_GET_PRIOR_WORKDAY, still then you have to use the operation:
    L_V_PREDT = SY-DATUM - 1.
    And pass L_V_PREDT to the FM. You can test with 23.03.2009 date & check )
    Hope this helps.
    BR,
    Suhas
    Edited by: Suhas Saha on Mar 19, 2009 4:56 PM

  • Work days & timeout

    Hi,
    anyone kwown how to manage work days in notification timeout ?
    There is a way to avoid that notification timeout was calculated in days like saturday or sunday and holidays ?
    Thank you in advice.
    Cosimo

    Patch 116568-99 is available:Hmm, I thought that's the last patch I put on - I'm pretty sure that's what I ran....
    There are some autoreply fixes in there.
    Also, "autoreply" is different from "vacation reply".
    Autoreply will reply each time a message comes in.
    . "vacation reply" will pay attention to the timeout
    you set. Perhaps the user is simply setting the
    wrong option?So, are you saying that when someone checks the "enable automatic vacation reply" in the webclient (messenger express not UWC), that does not write the maildeliveryoption=autoreply? I thought that attribute had to be there for the vacation message to work?

Maybe you are looking for

  • SQL in XML file

    hallo all. i want to give value of groups.id instead of id from groups table. pls, could anybody help me with it. SELECT * FROM MEMBERS WHERE ID = (SELECT MEMBER_ID FROM MID WHERE GROUP_ID = (SELECT ID FROM GROUPS)); the group.id comes from here, fro

  • Cant find expose and spaces in system preferences

    I cant seem ti find "expose and spaces" in system preferences.  Can anybody help please?

  • Physical Inventory/cycle Counting procedure in Inventory Management

    Hi everyone i have been posting some of my queries here on SDN but i never got any reply from anyone I had another question, Can anyone tell me what is the configuration steps for Physical Inventory/Cycle counting in IM, What are the IMG config invol

  • Convert PC Pagemaker docs to Mac Pagemaker docs?

    I've recently switched to iMac from PC and need to convert documents/booklets created in PC Pagemaker 7.0 to Mac Pagemaker 7.0. Possible? My docs are already labeled with .pmd; now what

  • User has no profile in this organization. Contact your system administrator

    Hi, I have been attempting to install and have AM 7.2 working properly with the J2EE Policy Agent for V9 of Sun's App Server. I have followed mostly the default values during setup. I believe I have the installed properly. In order to verify that eve