Check working day for user according to factory calander

Hi ,
i wan to check" for given user whether date entered is first working day of week for the user or not based on factory calendar of the country of the company of the user".
How can this be done if any of you have any idea?
your help will be highly appriciated.

Hi,
DATA:
   L_SCAL_WEEK LIKE SCAL-WEEK,
   L_DATE_LOW LIKE SY-DATUM,
   L_DATE_HIGH LIKE SY-DATUM.
*--- Find start date for current week
Find current week
CALL FUNCTION 'DATE_GET_WEEK'
  EXPORTING
    DATE         = SY-DATUM
  IMPORTING
    WEEK         = L_SCAL_WEEK
  EXCEPTIONS
    DATE_INVALID = 1
    OTHERS       = 2.
IF SY-SUBRC <> 0.
  EXIT.
ENDIF.
Start date current week
CALL FUNCTION 'WEEK_GET_FIRST_DAY'
  EXPORTING
    WEEK         = L_SCAL_WEEK
  IMPORTING
    DATE         = L_DATE_LOW
  EXCEPTIONS
    WEEK_INVALID = 1
    OTHERS       = 2.
IF SY-SUBRC <> 0.
  EXIT.
ENDIF.
WRITE : / L_DATE_LOW. " first working day of current week

Similar Messages

  • Any report to check vacation rule for users?

    any report to check vacation rule for users?

    Hello Anand,
    there is no report but you may use the production order info system with list "components" and create a layout contaning the issued quantity and/or the final issue indicator. With a correct sorting, the list should show all orders with non-issued components at the top.
    Regards, Andreas

  • 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

  • Need working days for all months in a given year

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

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

  • Working day for a Holiday Calendar

    Hi, experts.
    I'm looking for a FM that returns me the next working day based on a Holiday Calendar (SCAL).
    It should have the same functionality as Factory Calendar FM FIMA_DAY_CONVERT_TO_WORKINGDAY.
    Can you help me out?
    Thanks in advance,
    Flavia

    Use this function module & make sure you pass the plant details, as factory calendar mostly depeneds on the Plant.
    Below is just an example to get the plant depending on Requisition & pass it to the function module.
    Createdate --> will be the current date.
    SELECT SINGLE t~fabkl
           INTO lv_fabkl
           FROM ( t001w AS t
             INNER JOIN eban AS e ON ewerks = twerks )
           WHERE banfn = reqnumber.
    CALL FUNCTION 'FKK_ADD_WORKINGDAY'
      EXPORTING
        i_date            = createdate
        i_days            = days
        I_CALENDAR1       = lv_fabkl
      I_CALENDAR2       =
    IMPORTING
       E_DATE            = workingday.
      E_RETURN          =

  • Get Nexr working day for the given calendar id

    Hello,
    My requirenment is I have a  date.If that date falls on friday then I have to get the next working day date i.e.Monday for the given Calender iD

    DATA:wk_dat TYPE scal-indicator.
    PARAMETERS:pa_dat TYPE sy-datum.
    CALL FUNCTION 'DATE_COMPUTE_DAY'
      EXPORTING
        date = pa_dat
      IMPORTING
        day  = wk_dat.
    CHECK wk_dat = 5.
    pa_dat = pa_dat + 3.
    WRITE pa_dat.
    here if u want to get the next working day
    Use FM DATE_CHECK_WORKINGDAY after the check statement.
    add the date until u find a working day.

  • Work around for User ID 32 character limitation in CCX Agent?

    Are there any kind of creative work arounds for getting past the ridiculous 32 character limit when logging into the CCX Agent?
    We are moving toward using the User Principal Name (UPN) in CUCM LDAP which means that the domain is now tacked onto the end of their existing User IDs.  We are doing this so that users from multiple domains can authenticate to various Cisco tools and apps.  It works very well, except when firing up the Agent!
    I've already been playing around with UPN suffixes, and while I can get them to show up in CUCM (and subsequently), I can't seem to get them to authenticate.
    I shouldn't even have to get this creative, just remove the 32 character limit, Cisco!
    We are running CCX 8.5 and CUCM 8.6

    Hi ,
    I am not aware about any such workarounds.
    After referring to the below guide,
    http://www.cisco.com/en/US/docs/voice_ip_comm/cust_contact/contact_center/crs/express_8_5/configuration/guide/uccx851ag.pdf
    On page 78, it is mentioned as,
    Caution : When logging into Cisco Agent Desktop, agents use the Unified CM user ID and password. While the Unified CM limits agent IDs to 128 alphanumeric characters, the Unified CCX limits agent IDs to 31 alphanumeric characters. Be sure to abide by the 31 character-limit when configuring agents in Unified CM.
    I am sure even if it works by some workarounds also, you may see some issues specially from the CAD\CSD\CDA side, which Cisco will not support it quoting the same above reason.
    Hope it helps,
    Anand
    Please Rate helpful posts !!

  • User and his factory calander

    Hi,
    I am a ABAP developer
    I need to calculate first working day of week for user. To do  that i need to know "factory calendar of the country of the company of the user"
    In which SAP tables this link is maintained?
    Your help will be highly appriciated.
    Regards
    Anurag

    Anurag
    Do you want to find first working day of week for user means?
    Do You want to find the first working day of the an employee based on his personnel number ????
    If so you need to go to his PWS there you can find.
    PWS is available in the IT0007
    Best Regards

  • User and his factory calander relation ship

    Hi,
    I need to calculate first working day of week for user. To do  that i need to know "factory calendar of the country of the company of the user"
    In which SAP tables this link is maintained?
    Your help will be highly appriciated.
    Regards
    Anurag

    Hi,
    Do like:
    Call the calendar maintenance transaction in one of the following two ways:
    - In the implementation guide for Global Settings choose  Maintain calendar Execute
    - Call the transaction SCAL in the OK-Code field.
    Choose the option "Holiday calendar" or "Factory calendar".
    Choose Display.
    You receive a list of all holiday or factory calendars which exist in the system, with descriptive text and ID.
    Choose a calendar.
    Call the function Display. definition, to get the definition of the chosen calendar.
    Call the function Display calendar, to get a calendar overview. In the factory calendars overview screen you can choose a year and display a calendar page for the chosen year with the function Display year.
    Regards,
    Renjith Michael.

  • Work Flow for User Status

    Hi All,
    Is it possible to send the mail at company mail id to different users as per the different user status in the notification thru the work flow?
    regards
    sunil

    Hi
    TCODE : OIM1
    Assign agents and activate event linking
    So... Check out this link [Work Flow|http://help.sap.com/saphelp_47x200/helpdata/en/b0/df293581dc1f79e10000009b38f889/frameset.htm]
    - Pithan

  • Check text field for user name and password

    Guys,
    Please help me. I have this simple problem...
    I want to check if the text field for username and password has value with no POSTBACK.
    I got to check that it is null there will be a text that will appear on the page 'Null not allowed'... Can you guide me here.

    Crosspost: http://forum.java.sun.com/thread.jspa?threadID=5227035&tstart=0
    Please don't crosspost, your query has been replied to in the thread linked to above; continue there.

  • 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

  • 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

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

  • Leave for non working day

    Hi,
    We have a project called as capita for whom our employees are sheeting on their office, and their holiday calendar and our holiday calendar is different some of our employee who are in capita they applied leave on 10th sep which was a holiday in Mastek but it was a working day for capita .
    Neither we can make a new holiday calendar for capita nor can we frame a new absence type, because by doing this there are some possibility of violating our hr policy.
    So kindly suggest us the best possibility.
    We are patch level 58

    Hello sir,
    When entering absences the counts the planned working time which is included between begin and end of the absence. On off-days or public holidays the sum of working hours always is zero. 
    From a business point of view it does not make much sense to record an absence for an employee on a day on which he/she  does not have to work.
    Unfortunately you cannot override this. If you need to record an absence on a day off you will have to create a substitution record so that day is now a working day.
    The following information might be helpful:
    After a change in a holiday calendar the work schedules have to be regenerated. The warning message you described on the first page comes out of a check against the work schedule. In IMG you can find Personal Time Management -> Work Schedules -> Work Schedule Rules and Work Schedules -> Generate Work Schedules Manually Here the work schedules have to be generated after any change in the holiday calendar.

Maybe you are looking for

  • URgent !!!!!!!!! How do i add information to server.xml of tomcat

    Hi , I want to add the conext information to my server.xml of tomcat for my hibernate configuration..... the conext information is as follows .... <Context path="/quickstart" docBase="quickstart"> <Resource name="jdbc/quickstart" scope="Shareable" ty

  • Re: "Very Slow Internet On OSX 10.5.5"

    Hello all, I am creating my own thread in response to ones like rogerjth's July 2008, the subject of which was "Slow Browsing with safari 3.1.2 - Any issues to watch out for?" and Roippeli's from Sep. 21, 2008, the subject of which was "Very Slow Int

  • SAP connected fax machine issue

    Hi All , Need to know where the fax machine settings are made . Issue is  one automatic cover page is coming with To address as SAP while sending fax . Need to know where we can disable that. Thanks & Regards , Sabu.

  • How do you restore Lightbeam data

    How do you restore the .json file that Lightbeam saves when the "Save Data" button is selected? The Firefox browser (ver. 33) has become slow and I want to disable the blocked sites temporarily to see if that could be the problem. Thanks!

  • Why won't a Rented movie will not restart?

    Rented a movie through iTunes  I stopped it and now it will not restart