Factory Calendar for an employee

Dear All ,
We have 6 factory calendars namely A1 and A2... . I want to know for given employee number which factory calendar is applicable . Is there any function module which will give me this information .

Hi
try this code...
code
DATA : ret_date LIKE scal-date,
fac_date LIKE scal-facdate,
workday LIKE scal-indicator,
temp_date LIKE scal-facdate,
date LIKE sy-datum.
date = sy-datum. "sample dates
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
correct_option = '+'
date = date
factory_calendar_id = 'VC' "Your factory calender code
IMPORTING
date = ret_date
factorydate = fac_date
workingday_indicator = workday
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.
WRITE :/ workday. "holiday returns '+' indicator. working day returns space.
[/code]
Reward if useful
Regards

Similar Messages

  • Scheduling does not take the factory calendar for counting the workdays

    I am scheduling my jobs in CPS 8 and I have imported my Factory calenders also. When using Factory calendars for scheduling the jobs for the 6th working day of every month, Its does not count the Saturday as a working day, where as the calendar I am using has Working day on Saturday.
    Why is it so? And is there a way to solve this ?
    Please suggest. Any help is appreciated.

    Hi All,
    I have used this same logic for scheduling jobs scheduling for the nth work days of every month.
    But I have a job, where it is required to be scheduled on the 5th workday of a month and it is submitted once in every 6 months.
    When I schedule it for every month, it works fine. But when I use a submit frame to submit it for once in every 6 months, it does not work.
    Can anyone suggest how to do it ? I used a embedded window to check it also, which didn't work.
    BR
    Madhu

  • Factory Calendar for only May thru October months

    Hi Team,
    Our Client is requesting to set up the Factory Calendar for Maintenance Plans to be called only for May thru October months. November thru April there should not be any Plans being called.
    Please help us with setps to customize the Factory Calendar such that Plans could be called only for May thru October months.
    Thanks for your time in advance
    Regards,
    Sindhu

    Thanks Jurgen. I was able to set up the Factory Calendar. I have set up the 'Special Rule' in the Factory Calendar and specified the work days only from May 1st to Oct 31st. Please let me know in case of any changes required in this Factory Calendar set up.
    Thanks and Regards,
    Sindhu

  • Multiple Holiday Calendars for an employee

    Hi
    We have a requirement, where an employee works for various clients in a month/year. Whenever he moves to a new client, that client holiday calendar should replace the existing for that period only.
    Eg: Client XYZ has holiday calendar1, calendar 2, calendar 3 in location 1, location 2 location 3 respectively...
    If employee is in location 4 with calendar 4, Supports the client XYZ location 1 his calender 4 should be replaced by calendar 1 for that employee.
    Regards,
    SB

    In this case employee is not physically moving to a different location, from the same location1 he can support client 2 or client.  and moreover Clients and client locations cannot be a part of Enterprise structure.
    In my opinion, this is not a simple scenerio, it certainly needs some development

  • Dinamic Credit limits must use factory calendar (for exclude holidays)

    Dear collegues!
    If somebody know how to custom S066 info-structure (dinamic credit limits) for working only with working days.
    Example of business-process.
    Customer want to enter order today for day after tomorrow i.e. on Monday for Wednesdays etc...
    But on Friday it must be for Monday.
    So we want to made dinamic credit check for horison 2 days...But on friday to monday should be 3 days...
    Is anybody have any idea?
    Thans a lot!
    Olga

    hello, friend.
    sorry for the late reply.  i believe you can come up with your own sales calendar by going IMG > Net Weaver > General Settings > Maintain calendar (t-code SCAL).  define your calendar and assign this to your sales organization.
    regards.

  • ABAP HR- table for factory calender id at employee level..

    Hi,
    i have a requirement in which i need to retrieve Factory calender ID against holiday calender ID at employee level.
    I am able to retrieve Holiday calender ID for an employee.
    Now i need a table to where i can get factory calender for an employee against holiday calender Id.
    Appreciate your help!
    Regards
    Aleria

    Hi Aleria 
    Pass the holiday calendar retrieved to the table TFACD to get the Factory Calendar.
    Regards
    Bala

  • Which factory calendar is valid for a certain user

    Hi all,
    is there a way to get the factory calendar for a certain user.
    E.g. if the user works in Germany, I want the german factory calendar, and if he lives in India, I want the Indian calendar.
    Regards,
    Daniel

    OY05 - Maintain the SAP Factory Calendar
    SAP Factory Calendar allows companies to key in their own factory work days.  Individual SAP application such as MRP will take into consideration these individual factory customizing.
    For alternate Saturday, you set Saturday as a normal working day and key in all the off-days in the Special rules button.
    In your abap program, you can calculate whether a particular day is a non-working day, with reference to the Factory Calendar.
    ABAP Program to check for holidays using the factory calendar
    include zday .
    substitute tdate = 'yyyymmdd'.
    tholiday_found   = 'X'   -> Holiday
    TABLES THOCS.
    DATA: BEGIN OF INT_THOCS OCCURS 100,
          THOCS LIKE THOCS.
    DATA: END OF INT_THOCS.
    DATA: TDAY(1),
          TDATE LIKE SY-DATUM,
          THOLIDAY_ATTRIBUTES,
          THOLIDAY_FOUND(1).
    FORM HOLIDAY.
    CALL FUNCTION 'HOLIDAY_CHECK_AND_GET_INFO'
         EXPORTING
              DATE                         = TDATE
              HOLIDAY_CALENDAR_ID          = 'XX'
            WITH_HOLIDAY_ATTRIBUTES      = ' '
         IMPORTING
              HOLIDAY_FOUND                = THOLIDAY_FOUND
         TABLES
              HOLIDAY_ATTRIBUTES           = INT_THOCS
         EXCEPTIONS
              CALENDAR_BUFFER_NOT_LOADABLE = 1
              DATE_AFTER_RANGE             = 2
              DATE_BEFORE_RANGE            = 3
              DATE_INVALID                 = 4
              HOLIDAY_CALENDAR_ID_MISSING  = 5
              HOLIDAY_CALENDAR_NOT_FOUND   = 6
              OTHERS                       = 7.
    CALL FUNCTION 'DATE_COMPUTE_DAY'
         EXPORTING
              DATE    = TDATE
         IMPORTING
              DAY     = TDAY
         EXCEPTIONS
              OTHERS  = 1.
    For checking.
    *if tholiday_found = 'X'.
      write: /1 'Holiday ', tdate.
    *else.
      write: /1 'Not Holiday ', tdate.
    *endif.
    *case sy-subrc.
      when 0.       write: /1 tdate, tday.
      when others.  write: /1 'Unknown day ', tdate.
    *endcase.
    ENDFORM.

  • ABAP HR- calculation of workind days (excluding weekend) for an employee

    Hi,
    I need to get number of working days between two dates excluding weekends for an employee. Please let me know below questions in this regard:
    1. I have to use Factory calender or holiday calender for this purpose?
    2. Will FM RKE_SELECT_FACTDAYS_FOR_PERIOD solve this purpose ?
    Regards,
    Aleria

    Hi Aleria,
    Use the FM DAY_ATTRIBUTES_GET in this FM pass the holiday and factory calendar of the employee along with the period. In the output structure if free day is set then it is SAT/SUN and if holiday is set then it is Public holiday marked in the calendar.
    Regards
    Bala

  • Factory Calender for New Product

    Dear Experts,
    Pls guide me through this, there is one plant running 5 days a week for product A and there is an other product B should actually start for other two days on the same week, and after two months i have to incorporate product B along with A simultaneously, which results both the products getting manufactured through out the week.
    How do i set factory calendar for this requirement.
    Thanks in advance.
    Arun.

    Hello Arun
    I suggest you to use time-phased planning with a periodic lot sizing procedure (e.g. PK) and define a different planning calendar for each material. The planning calendar can be created on transaction MD25.
    For the first calendar, you should defined the 5 days where product A will be produced and assign it to material A. The second planning calendar will be created for the 2 days where product B is produced and assigned to material B.
    When this is not necessary anymore, simply remove the periodic lot sizing procedure.
    Check this document for a detailed guide to set up time-phased planning:
    Time-Phased Planning in SAP
    BR
    Caetano

  • Date is outside the factory calendar range

    I am trying to run a BW query. When I click on the calnedar icon field. It gives this error.
    Error: Date is outside the factory calendar range
    Msg No. FK884
    What could be the problem in the query? Has anybody had the similar problem before? I tried to search in SAP notes and could not find anything close to this.
    I will  Appreciate your help. Thanks a lot.
    Abhi

    Hi Abhijit,
    We got the same error message in 2010.
    1) Check in transaction SCAL that the Factory Calendar ID 01 (i.e. German) is valid to 2009. This explains the error message.
    2) Found SAP Note 1136142 about the configuration of default factory calendar ID of F4 Help and hierarchy for Time-characteristics in BI 7.0.
    SAP Note Solution:
    The key figure attribute obtains its value from the default work calendar as it is maintained in transaction RSRHIERARCHYVIRT (General Settings -> Default Factory Cal. ID).
    This setting is valid across the entire system and does not permit any variable selection of the factory calendar for each query.
    Furthermore, a value for 0NUMWDAY is calculated only for the period in which the default factory calendar is valid.
    3) Check in transaction SCAL that the Factory Calendar ID of our location is valid to 2050.
    The problem is solved after changed the Default Factory Cal. ID from 01 to the ID of our location in transaction RSRHIERARCHYVIRT.
    Regards,
    Ricky

  • BEx variables: Date is outside Factory Calendar Image

    Good day
    A user received the following message when selecting the inpiut help for a date variable for a CRM query:
    " Date is outside Factory Calendar Image"
    I have checked tcode SCAL and noticed that the factory calendar for South Africa = 1996 to 2010. I checked the CRM source and their factory calendar is the same. In the mean time I have transferred the global settings for SAP DNI (parts) into BW and the factory calendar setting for South Africa now shows 1996 to 2015.
    Problem is that the CRM query still shows the same error message.
    Question:
    1) Should factory calendar settings for all SAP sources (Modules i.e. CRM...) be imported into BW, or is there another setting that I must check?
    Thanks in advance.
    Cj

    This is what I have done:
    Whe have the following R/3 modules (source systems in BW)
    SAP DNI
    SAP dFM
    SAP CRM
    SAP SRM
    etc.
    (Tcode = SCAL, selected 'factory calendar', selected 'rebuild tables')
    Firstly I have transferred the global settings for SAP CRM (as the BEX query is from CRM). Their factory date was 2012. This did not solve the problem.
    secondly, I did SAP DNI, their factory date = 2015, this also did not solve the problem.
    I then transferred the global settings for SAP dFM, our main reporting module, their factory date = 2020. The problem was solved.
    Seems as if only ONE of the modules depicts the factory calendar date for BEX.
    I have rested this again and only SAP dFM global settings rectified the BEx display problem.
    Hope this helps?

  • Problem with OSS note 1529649 - Factory calendar expires 2010

    Hi Experts,
    I found a OSS note that is telling that calendar validity ends in 2010.
    For the moment in my system factory calendar for all my sites is valid till 2020.
    My question is that doesn't matter what date i have now in the system the validity will finish?
    What i should do!!!
    Thanks a lot for your help.

    Dear
    If the factory calender and holady calendar which is assinged in FC , both have same validity , then there should not be any problem .
    For  consistency , you can go down to OP03-Slecet HC-Change Mode -Keep the valaidty along with all the public holday calander validity till 2011 or 2012 .Similarly , do the same in Factory calander  .
    But re-assing the Calander to Plant once again in OP03 -Plant Assingent tab  or re-assing at WC ( CR02-Capacity tab -Standard Avalaable Capacity )  also if you have similar kind of canalder also .
    Hope this helps
    Regards
    JH
    Edited by: Jiaul Haque on Dec 10, 2010 10:56 AM

  • Switching Factory Calendars

    Hello,
    I have recently discovered that we are using the wrong factory calendar for both SD and PM.  The wrong one may have been used to generate the scheduled work hours in HR too.  We have 2 different custom calendars that need to be used - neither is currently used.  One was designed for our 24/7 treatment plant operations.  The other was for designed for HR, SD, and equipment with maintenance that is on a typical M-F, excluding holidays.  Our current configuration is that all equipment is in one plant.
    Would there be any issues switching the calenders in SPRO for SD and PM?  After reading many other forum posts, I understand that only one calendar may be assigned to a plant.  Is there any problems with using a different calendar in the maintenance plans than the plant calendar?
    Any help or advice would be appreciated.
    Thanks.

    Hi YM,
    The calendar would be assigned to the plant in Logistics and in SD for the sales organization.  With only one calendar to be able to be used, we would be selecting the one with the M-F, excluding holidays.  Ironically, PS already uses the correct calendar.
    Based on your reply, it would be best to just use one calendar and not allow the maintenance plans to use a different one.
    When the plant and sales organization calendars are changed via SPRO, will this create any problems other than having to change the current maintenance plans to use the new calendar?
    Thanks.

  • Function Module to Calculate Factory Calendar

    Hi,
        We are Working generating a report for discrete Manufacturing. We need a actual days worked from the factory calendar for our MIS Reports based tat.
        Help us in find a Function Module for it.
    Regards
    Naga

    *&      Form  BILLING_DAY_IS_WORKING_DAY
          Using the date passed in next_date, verify that the date is
    a working day in the factory calendar the user specifies.  This form
    calls the standard ABAP function for determining if a date is a
    "working day".  The function first determines if the day of the week
    corresponding to the calendar date entered is a billing day.  Then
    it checks to see if the calendar date is a holiday.  If either are
    true the date_no_workingday flag is passed back as "X" and this
    routine passes back "X" to the calling routine in the parameter
    p_billing_flag.
    FORM CURRENT_DAY_IS_WORKING_DAY USING    P_NEXT_DATE TYPE D
                                    CHANGING P_NOT_BILLING_DAY TYPE C.
      CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
           EXPORTING
                DATE                       = P_NEXT_DATE
                FACTORY_CALENDAR_ID        = FACTCALD
                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.
      CASE SY-SUBRC.
        WHEN '0'.
          CLEAR P_NOT_BILLING_DAY.
        WHEN '4'.
          IF SY-DATUM > CURRENT_BDATE.
            P_NOT_BILLING_DAY = SPACE.
          ELSE.
            P_NOT_BILLING_DAY = 'X'.
          ENDIF.
        WHEN OTHERS.
          CONCATENATE: 'Error Accessing Calendar with ID: ' FACTCALD
          INTO ZZMSG_TAB2.
          APPEND ZZMSG_TAB2.
          CLEAR  ZZMSG_TAB2.
          V_LEVEL = 'E'.
          PERFORM F_ERROR_MESSAGE.
          MESSAGE E305 WITH FACTCALD.
      ENDCASE.
    ENDFORM.                               " BILLING_DAY_IS_WORKING_DAY
    *&      Form  BILLING_DAY_IS_WORKING_DAY
          Using the date passed in next_date, verify that the date is
    a working day in the factory calendar the user specifies.  This form
    calls the standard ABAP function for determining if a date is a
    "working day".  The function first determines if the day of the week
    corresponding to the calendar date entered is a billing day.  Then
    it checks to see if the calendar date is a holiday.  If either are
    true the date_no_workingday flag is passed back as "X" and this
    routine passes back "X" to the calling routine in the parameter
    p_billing_flag.
    FORM BILLING_DAY_IS_WORKING_DAY USING    P_NEXT_DATE TYPE D
                                    CHANGING P_NOT_BILLING_DAY TYPE C.
      CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
           EXPORTING
                DATE                       = P_NEXT_DATE
                FACTORY_CALENDAR_ID        = FACTCALD
                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.
      CASE SY-SUBRC.
        WHEN '0'.
          CLEAR P_NOT_BILLING_DAY.
        WHEN '4'.
          P_NOT_BILLING_DAY = 'X'.
        WHEN OTHERS.
          CONCATENATE: 'Error Accessing Calendar with ID: ' FACTCALD
          INTO ZZMSG_TAB2.
          APPEND ZZMSG_TAB2.
          CLEAR  ZZMSG_TAB2.
          V_LEVEL = 'E'.
          PERFORM F_ERROR_MESSAGE.
          MESSAGE E305 WITH FACTCALD.
      ENDCASE.
    ENDFORM.                               " BILLING_DAY_IS_WORKING_DAY
    Reward if useful

  • Reg factory calendar

    Dear Gurus,
                        Here in our client place they have assigned the factory calendar for 5 days a week..since they are working 6 days a week, I need to change it. Kindly suggest me how to change the calendar for 6 days a week. Thank you.

    Hi,
    Go to SCAL
    Select Factory calendar,
    Select Factory Calendar ID relevant to you / your client
    tick mark as per the requirement.
    Hope this should be useful.
    Regards,
    Suresh

Maybe you are looking for

  • Problem about space management of archived log files

    Dear friends, I have a problem about space management of archived log files. my database is Oracle 10g release 1 running in archivelog mode. I use OEM(web based) to config all the backup and recovery settings. I config "Flash Recovery Area" to do bac

  • Motion 5: Setting constant speed on position change

    Hi there, Can anyone shed some light on how to get rid of the smooth movement setting when moving an object from A to B. Motion appears to accelerate and decelerate the object to make it look smoother. However, I want to set an object to move at the

  • Import WB_RT_GET_JOB_METRICS procedure into OWB

    How do I import this procedure WB_RT_GET_JOB_METRICS into my mapping.

  • Color Tweening using Drawing API

    Hi, I have a function that draws a shape. The color value can be passed in as a parameter. I have called this function quite a few times. All of the objects start off the same color. I want to know how to randomly make each one switch color immediate

  • Why cant i switch my apple tv to 1080p

    I have an HD tv that supports 1080p however I have the apple tv model mc572ll/a