To find whether it is working day or not

Hi,
Could you provide me some logic on below:
From the Order Date, the next 10th day i want to find out whether it is holiday or working day.
if order date = Sysdate , then i need to know whether following 10th day is holiday or working day.
DB:10g
Thanks.

Hi Jaysree,
just execute this code ,, this will do .
REPORT ZEX4 .
PARAMETERS: fname  LIKE rlgrap-filename .
DATA: len TYPE i,
      T  TYPE I VALUE 0,
      inp(20) TYPE C,
      inp1(20) type c,
      inp2(20) type c,
      inp3(20) type c.
DATA :gv_char.
RANGES : gv_charsel FOR gv_char,
         gv_charsel1 FOR gv_char,
         gv_charsel2 FOR gv_char.
START-OF-SELECTION.
  gv_charsel-sign = 'I'.
  gv_charsel-option = 'BT'.
  gv_charsel-low = '0'.
  gv_charsel-high = '9'.
  APPEND gv_charsel.
  gv_charsel1-sign = 'I'.
  gv_charsel1-option = 'BT'.
  gv_charsel1-low = 'a'.
  gv_charsel1-high = 'z'.
  APPEND gv_charsel1.
  gv_charsel2-sign = 'I'.
  gv_charsel2-option = 'BT'.
  gv_charsel2-low = 'A'.
  gv_charsel2-high = 'Z'.
  APPEND gv_charsel2.
  CONDENSE fname.
  len = strlen( fname ).
WRITE:/ len.
  DO len TIMES.
  MOVE FNAME+T(1) TO GV_CHAR.
    IF gv_char IN gv_charsel.
      MOVE fnameT(1) TO inpT(1).
    elseif gv_char in   gv_charsel1. "or gv_charsel2.
      MOVE fnameT(1) TO inp1T(1).
    elseif gv_char in gv_charsel2.
      MOVE fnameT(1) TO inp2T(1).
    else.
    move fnameT(1) TO inp3T(1).
    ENDIF.
    T = T + 1.
  ENDDO.
CONDENSE INP.
CONDENSE INP1.
CONDENSE INP2.
CONDENSE INP3.
write:/ 'Numbers  :', inp.
write:/ 'Lowercase :', inp1.
write:/ 'Uppercase :', inp2.
Write:/ 'Special Characters :', inp3.
regards,
VIjay.
kindly close the thread if ur query is over .

Similar Messages

  • How to find whether remote database is up or not (connected via dblink)

    Hi,
    I am using dblink to connect Biz database from Dev database.(Biz, Dev - database names)
    Running dbms job using the dblink from the Dev database to update data on Biz database...
    Problem is dbms job should run if and only if the Biz database is up for which i created the dblink...
    1) How to make sure or implement the check to find whether the Biz is database is up or not in Pl/sql or sql...
    2) How to reschedule the dbms jobs once the database is up
    pls suggest me how to find whether the database is up or not b4 running the dbms job?
    Using- Oracle 10g

    The only way to know whether the remote database is up (and whether the network between the two databases is up and whether the remote database's listener is up and whether the password configured in the database link is correct and whether the local TNS alias is correct, etc) would be to actually run a query against the remote database over the database link. In other words, the way to figure out whether the link is up is to let the job run and catch & handle exceptions when there are problems.
    By default, a job scheduled via DBMS_JOB will automatically reschedule itself if there is an unhandled exception by geometrically backing off (it waits 1 minute after the first failure, 2 minutes after the second, 4, 8, 16, 32 minutes, etc until it's marked as broken after 16 failures). You could, of course, catch appropriate exceptions and handle them in a reasonable fashion and manually reschedule jobs at intervals that make more sense for your particular job.
    Justin

  • How to find whether an application is installed or not

    Is there any way to find whether an application is installed or not
    and the path of the installed path
    I got that with executing reg query from my java aplication but for that
    reg tool should be installed ..
    Is there any way to get without that

    You can use an <installer-desc> to invoke
    a class that asks the user where it is, and
    if they do not know, or do not have it, it can
    be installed at the time (assuming you can
    provide an installer, appropriate for their OS).

  • How to find whether the cookies are enabled or not

    Hi All,
    Please suggest me, while sending the first request only how to find whether the cookies are enabled or not.
    thanks.

    you could use a servlet, write a cookie and then try to read it, if it's read then it's enabled else not.

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

  • How to find whether the tables are needed or not?

    Friends,
    Difficult situation for me......
    OS: RHEL AS 3.0
    DB: Oracle 9i R2
    I was taking table inventory.....
    i saw many tables starting with SMP..... and EVT.....Nearly 50 tables.
    some are...
    EVT_HISTORY
    EVT_DEST_PROFILE
    EVT_CARRIER_CONFIGURATION
    SMP_USER_DETAILS
    SMP_UPDATESERVICES_CALLED_
    SMP_SERVICE_ITEM_
    SMP_SERVICE_GROUP_ITEM_
    SMP_SERVICE_GROUP_DEFN_
    SMP_SERVICE_DATA_
    SMP_LONG_TEXT_
    SMP_JOB_TASK_INSTANCE_
    SMP_JOB_LIBRARY_
    SMP_JOB_INSTANCE_
    SMP_JOB_HISTORY_
    SMP_JOB_EVENTLIST_
    SMP_JOB_
    SMP_EBU_SAVED_JOB_
    SMP_EBU_ACTIVE_JOB_
    SMP_CREDENTIALS$
    SMP_BRM_TEMP_SCRIPTS_
    SMP_BRM_SAVED_JOB_
    SMP_BRM_RC_CONNECT_STRING_
    SMP_BRM_DEFAULT_CHANNEL_
    SMP_BRM_CHANNEL_DEVICE_
    SMP_BRM_ACTIVE_JOB_
    SMP_AUTO_DISCOVERY_PARMS_
    SMP_AUTO_DISCOVERY_ITEM_
    SMP_AD_PARMS_
    SMP_AD_NODES_
    SMP_AD_DISCOVERED_NODES_
    SMP_AD_ADDRESSES_
    more.........
    Nobody knows whats the table is for....
    Actually we were working with oracle 7.3 upto 2004. On 2004 we upgraded to 9iR2. May be the DBA in that time made some mistake.... i think so....thats why all these tables are still here....
    I was not in the picture during that time.
    Now my question is how can i know whether this table is necessary or not. I asked the developers here they said they are not using these tables. But my manager is afraid to delete these tables.
    now what should i do?

    Hi,
    Yet another request to use my crystal ball.
    We had one pc which is having oracle 9i enterprise manager configured(windows 2000) only to connect the db.
    This remembers me of the Gospel of St. Luke, chapter 2, where it is stated,
    'and they found the child in the manger'.
    This resulted a Jewish theologian to remark: 'The manger? Well, so that must have been their own manger'
    So what does 'the' db mean? The Linux one? Or a separate on Win2000?
    It is quite possible to manage a Linux database using OEM on Win2000, with OMS on Win2000.
    'But our server is not having enterprise manager'. Yet another riddle. Which server? There seem to be at least two.
    1 Now if I drop these tables, will I be able to connect to our database using the windows2k pc through Enterprise Manager?
    Yes, but only in standalone mode, and you can't use OEM alerts, and jobs anymore. You would be better off using Sqldeveloper, as OEM Sql worksheet is a nightmare.
    2 That is your decision.
    3
    oemctl ping oms
    will check whether you have an Oracle Management Server running.
    You already seem to have the Enterprise Manager Repository, so you must have OMS running somewhere. (Why install the repository, if you don't use it)
    Sybrand Bakker
    Senior Oracle DBA

  • SBS 2003: Trying to find whether a mail was sent or not.

    Bit of a dispute going on in our company. We are trying to work out if an email was sent from one of our staff on a particular date. The other company has sent us a hard copy of the mail but there is no trace of the email in the user's email account (Inbox,
    Deleted Items, Sent Items) and he is saying that he did not send it.
    Also, there is no trace of the email in the catalog of the backup software either... So backups are of no use for tracing this email either. The email may have been deleted on that particular day shortly after it was sent. 
    The Recover Deleted Items options was not set up on the client, and the Exchange has only the default logging (so no SMTP logging). We need to prove that this email was sent. Is there any other option that I have overlooked? 
    Thanks. 

    Ask the other company to send you the complete email, including all headers. How they do this depends on what email software they use, most Microsoft clients will allow emails to be saved as .eml files, in Thunderbird go to View, then Message Source, then
    save the text, etc.
    While only the latest (highest) Received: entry is guaranteed, and all headers below this may be forged (and of course the complete file returned to you may be forged, it's just plain text), if the company is acting in good faith then it should be possible
    to determine from the headers whether this email originated in your server, and when, and by whom it was sent. It isn't proof, but it is evidence, it would require significant effort to forge all the headers plausibly.
    As you can see, SBS by default does not keep long-term evidence of email traffic. I've found the SMTP logs useful on many occasions, and if cleaned out once a year, they don't normally grow seriously large. If everything is logged, the message ID is included,
    though not the body of the email. It is possible to collect copies of all email, at least with SBS2003, but doing so has legal implications. I'd have thought all ISPs in the Western world collect emails, if you use them as smarthosts, but they're probably
    forbidden to even admit this, let alone provide you with any help.
    Joe

  • How to find whether the patch is applied or not in SOA?

    Dear Legends,
    I need to find a given patch(13615085) is applied or not in SOA Environment(RAC). I do not have O/s Level access, so I cannot issue Opatch lsinventory.
    I tried
    select * from dba_registry_history; - nothing is displayed.
    Thanks in Advance,
    Karthik

    To check patchs installed:
    From Opatch
    $ORACLE_HOME/Opatch> opatch lsinventory
    From sql
    select * from dba_registry_history;
    *To execute Opatch you don't need root privileges, you can also do it from oracle user
    If you don't see anything executing "select * from dba_registry_history;" You haven't any patch installed.

  • How to find whether a service is webreporting or not?

    Hi Experts,
    We are upgrading our system from 4.7 to ECC 6.0.
    The ITS services in the system needs to be changed so that it can run with integrated ITS. But as webreporting is not supported by integrated ITS I would like to know whether an ITS service is webreporting or not.
    How can I know that a service is webreporting or not?
    Thanks & Regards,
    Soumya.

    same as explained in the following link
    Flow logic of ITS
    where check parameter value of  'sapxgwfc' for ~XGATEWAY for all webrfcs

  • PCR - RPTIME00 - TM00 - how to find of exceeding of the working day

    Hello,
    I'm new in RPTIME00 I need to write a PCR - schema ZM00 (TM00) that find of exceeding of the working day and generate wage type 1506 for cluster B2?
    For example employee works:
    MO: DWS=06:00-14:00
    TU: DWS=06:00-14:00 but TI2011=04:00-14:00
    The point is that I must generate wage type only for time par 04:00-06:00 without generate of WT for overtime (M)
    I though that I need generate WT from PCR with ADDZLS1506 for example... but in this case I need to find exceeding of the working day
    Any ideas?
    I tried with this:
    APD1      *   ****           HRS=D0061
    APD1      *   ****           HRS?S
    APD1      *   ****  >        GCY APD2
    APD2      *   ****           OUTWPTIMER
    APD2      *   ****  1        HRS=SNTB  
    APD2      *   ****  1        HRS?PBEG
    APD2      *   ****  1 >      HRS=PNUM  
    APD2      *   ****  1 >      HRS?CTEPOL
    APD2      *   ****  1 > >    HRS=PNUM                    
    APD2      *   ****  1 > >    HRS?0
    APD2      *   ****  1 > > >  ADDZLS1506
    APD2      *   ****  1 > > >  COLOP*
    Thanks a lof for help.
    BR,
    M
    Edited by: mn-sdf on Jul 6, 2011 10:59 AM
    Edited by: mn-sdf on Jul 6, 2011 11:20 AM

    Thanks for answer but I don't need generate overtime beyond the planned working hours in the end of month. I have WT in PY for additional pay for "exceeding of the working day" (this is not overtime but ... salary supplement? My english is not good enough, sorry).
    I don't need approval for overtime (via 2007 and GOT...) which give me "M" pair type for this case (WT1506). I don't need them. Opposite this I need to find:
    previous day was free or not?
    when was a free day, I don't have to generate 1506
    when is a working day, I have to generate 1506
    My PCR generate WT1506 correctly but on every day where I have start hour (2011) before start working time from DWS.
    Maybe the point is how to find the previous day was free or not?
    Do you know how to do it?
    Thanks a lot!
    BR,
    MN
    Edited by: mn-sdf on Jul 6, 2011 12:41 PM

  • Find working day

    Hello,
    I am using SAP Netweaver 7.0. Is there any functional module which can tel whether the given date is working day or not based on the Factory calendar id?
    I can pass date and factory cal id as input the FM.
    I tried the FM -  DATE_CHECK_WORKINGDAY, but it doesn't exist.
    If there is no functional module for this, then pls guide how to Implement this logic.
    Regards..
    Balaji

    Hi Balaji,
    Function module DATE_CONVERT_TO_FACTORYDATE can be used to check if a particular day is holiday.
    REgards
    KP

  • How to schdule my job on 16th working day of the every month?

    hi frnz
    I have a big task in my end, i have created one  package ,i want to execute that every month of 16th working day i want to run my job with schdule,how should i schdule my job using
    SQL AGENT IN SQL SERVER
    Can some one please help me out .......
    Thanks

    To add to Visakh's response, another method is to add the T-SQL script as the first job step to identify non-run days and raise an error when the job is not to be run.  Set this first job step on failure action to "Quit the job reporting success".
    Personally, I would use a full calendar table with an indicator of whether a given date is a working day or not.  I thing you will find such a table useful beyond this scheduling requirement.  For example:
    CREATE TABLE dbo.Calendar(
    CalendarDate date NOT NULL
    CONSTRAINT PK_Calendar PRIMARY KEY CLUSTERED
    ,CalendarYear int NOT NULL
    ,CalendarMonth int NOT NULL
    ,CalendarDay int NOT NULL
    ,BusinessDay bit NOT NULL
    See
    http://weblogs.sqlteam.com/dang/archive/2010/07/19/calendar-table-and-datetime-functions.aspx for an example of a more extensive calendar table along with a script to load US holidays.  The code below shows one method to use it for your scheduling
    requirement:
    DECLARE @RunDay bit = 0;
    WITH this_month_business_days AS (
    SELECT
    CalendarDate
    ,ROW_NUMBER() OVER(ORDER BY CalendarDate) AS BusinessDayNumber
    FROM dbo.Calendar AS c
    WHERE
    CalendarYear = DATEPART(year, GETDATE())
    AND CalendarMonth = DATEPART(month, GETDATE())
    AND BusinessDay = 1)
    SELECT @RunDay = 1
    FROM this_month_business_days
    WHERE
    BusinessDayNumber = 16
    AND CalendarDate = CAST(GETDATE() AS date);
    IF @RunDay = 0
    BEGIN
    RAISERROR ('Today is not a run day', 16, 0)
    END;
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

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

  • Calculation of no. of working days (per Factory Cal) between 2 date chars

    This question could be considered to be in continuation of a previous post called "Working days of month with factory calendar"
    I have two date Characteristics: say Date1 and Date2. I need to find the number of working days between them based on the factory calendar.
    (And yes we have already defined the default factory calendar in IMG under 'General Reporting settings' ).
    The previous post proposed the following:
    1) Convert date1 into factorydate (standard functionmodule)
    2) Convert date2 into factorydate (standard functionmodule)
    Perform date1 - date2 to get number of working days.
    I agree that there is a std function module to convert cal date to factory date called: 'DATE_CONVERT_TO_FACTORYDATE'
    But what are the steps for calling the conversion? Should I create a new Formula variable of 'Customer Exit type' give it a name and define the Function module in CMOD? But then how do I attach the formula variable to the date characteristic. Note that my infoobjects are Chars so I cannot do date1- date2 in the query as is possible with keyfigures!
    Please help! (my version is BW 3.0)
    Thanks
    Naresh

    Hi,
    For the above scenario when you need to calculate date 1 - date 2. we can't build a new formulae or calculated KF directly because those are the chars.
    So we need make chars to act as KF through Formulae with replacement path.
    create a formulae variable on those 2 Date chars with Processing type as replaccement then those 2 Dates can be avilable to build a formulae as ur requirement.
    Let me know if you need any more information.
    Thanks,
    Raju

  • Add 12 working days to a date

    I have a date, let's say 01.01.2007, and I want to postpone the date by 12 working days.
    "working days" in my case shall mean only monday to friday, not saturday and sunday, and I do not case about public holidays.
    Is there are function module or something like this to do this calculation?

    check this below link
    Factory Calendar
    u can also have a look into these links
    Getting a date based on factory calendar
    Function module to get the no.of working days between START and END dat
    I want to find the No.of working days between the two dates
    i think it is useful for u
    SANTOSH..

Maybe you are looking for

  • Date related question

    I am trying to get the events from this (date,month,year) to this (date,month,year) but unable to write sql statement My tables: SQL> desc event Name Null? Type E_ID NOT NULL NUMBER(14) EVENT VARCHAR2(3110) SQL> desc event_time Name Null? Type E_ID N

  • No accounting document for 561E via MB1C and MIGO

    Dear All We are in MTO Scenario. we are trying to post initial stock against sales order through MB1C VIA 561E movement. the material document is not having an accounting document. Please help out. I've checked all setting as follows: 1.) [OMJJ] for 

  • HTML or PHP visibility div tag problem in IE

    Hi, I have a PHP search function on a travel site a programmer did for me. When you look at it in FF and Safari, it looks fine. But in IE, there is a big blank space where the calendar function goes. He has the div tag set to visibility:hidden. Any i

  • Why am I getting black boxes and lines in Facebook chat area?

    I just installed the latest version of Firefox as well as the latest version of my graphics card drivers, and Adobe Flash Player. When I open Facebook, I get black boxes and lines all over the left side of the screen where my chat contacts are. I am

  • Amount coming in a different format

    Hello Gurus, In my db table, have an amount field which is filled with values say 10.00, 100.00 and 1000.00. The type is curr 15 decimals 2. When i display that in a ALV, the amount is comin in a different format. It adds 2 zeroes to it. Say the corr