Excluding Weekend dates from existing query

I have the following query that returns the average of the total sum between start and end date of a status.
How do I take out the weekend dates so it doesn't include saturday and sunday.?
SELECT TRUNC(AVG( SUM ( (DECODE (status, 'Estimator Notified' ");
,cc.end_date,NULL) - DECODE (cc.status, 'Estimator Notified',cc.start_date,NULL)))),1)
FROM cc_request_status cc
group by cc.request_id

The above solution actually generates each date in a range and tests it for a Saturday or Sunday date. A more efficient solution calculates the weekend days directly by using the following facts:
1) For each whole week in the range the number of weekends days is 2.
2) For the partial week, a function can be made based on the ending day and the number of partial days to calculate the number of weekend days.
The following code uses the above two facts to calculate the number of days in a range excluding weekends:
SELECT NUM_DAYS - (WEEKS*2) -
       CASE WHEN REMAINDER = 0 THEN 0
            WHEN END_DOW = 7 THEN 1
            ELSE
                CASE
                    WHEN END_DOW > REMAINDER THEN 0
                    WHEN END_DOW = REMAINDER THEN 1
                    ELSE 2
                END
       END BUS_DAYS
FROM
    SELECT END_DOW, NUM_DAYS, FLOOR(NUM_DAYS/7) WEEKS, MOD(NUM_DAYS,7) REMAINDER
    FROM
        SELECT (TO_NUMBER(TO_CHAR(END_DATE, 'J')) -
                TO_NUMBER(TO_CHAR(START_DATE, 'J'))) + 1 NUM_DAYS,
               TO_NUMBER(TO_CHAR(END_DATE,  'D')) END_DOW
        FROM
          SELECT TO_DATE('05/05/2007','MM/DD/YYYY') START_DATE,
                 TO_DATE('05/14/2007','MM/DD/YYYY') END_DATE
          FROM DUAL
);You can collapse some of the inline views down, I expanded them to show each step.
JR

Similar Messages

  • Excluding Weekend dates from Select

    Hi all,
    I have a select statement that returns the average number of days a job stays at a particular status. What I want to do is to exclude weekend dates from the calculation. I am using oracle 10..
    My select statement looks like this when I look for status that is on New by taking the difference of the end_date and start_date that are not null. However this include the weekend dates as well so how do I exclude weekend dates from the computation.
    SELECT
    AVG ( SUM ( ( DECODE (STATUS, 'New', end_date, NULL ) -
    DECODE ( STATUS, 'New', start_date, NULL ) ) ) )
    FROM TBL
    on a table that is defined as
    CREATE TBL (varchar STATUS, DATE start_date, DATE end_date)
    Thank you

    Lucky for us, TO_DATE takes a 3rd parameter. My Test:
    ALTER SESSION SET NLS_DATE_LANGUAGE = 'DUTCH'
    ALTER SESSION SET NLS_TERRITORY = 'THE NETHERLANDS'
    WITH yourtable AS
       SELECT TO_DATE('01-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('02-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('03-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('04-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('05-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('06-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('07-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('08-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('09-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('10-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('11-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('12-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('13-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('14-04-2007','dd-mm-yyyy')  col_1 FROM dual
    SELECT TO_CHAR(col_1, 'D') D
         , TO_CHAR(col_1, 'DD-MM') thedate
    FROM yourtable
    WITH yourtable AS
       SELECT TO_DATE('01-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('02-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('03-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('04-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('05-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('06-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('07-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('08-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('09-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('10-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('11-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('12-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('13-04-2007','dd-mm-yyyy')  col_1 FROM dual UNION ALL
       SELECT TO_DATE('14-04-2007','dd-mm-yyyy')  col_1 FROM dual
    SELECT TO_CHAR(col_1, 'Dy', 'NLS_DATE_LANGUAGE=ENGLISH') x
         , TO_CHAR(col_1, 'DD-MM') y
    FROM yourtable
    WHERE TO_CHAR(col_1, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH') NOT IN ('SAT','SUN')
    /My run:
    SQL> @orafaq
    Session altered.
    Session altered.
    D THEDA
    7 01-04
    1 02-04
    2 03-04
    3 04-04
    4 05-04
    5 06-04
    6 07-04
    7 08-04
    1 09-04
    2 10-04
    3 11-04
    D THEDA
    4 12-04
    5 13-04
    6 14-04
    14 rows selected.
    X   Y
    Mon 02-04
    Tue 03-04
    Wed 04-04
    Thu 05-04
    Fri 06-04
    Mon 09-04
    Tue 10-04
    Wed 11-04
    Thu 12-04
    Fri 13-04
    10 rows selected.

  • How to exclude the data from the query ?

    Hi all,
    I got the following sql script :-
    SELECT OS.SL_DT, OS.sl_item_code, OS.SL_REF, (OS.sl_val_1) recp,B.CGCV_VALUE_1
    FROM OS_STK_LEDGER OS, ( SELECT cgcv_item_code, CGCV_STK_QTY_BU, CGCV_COST_1, CGCV_VALUE_1
                             FROM OS_COST_GROUP_CURR_VAL
                             WHERE CGCV_COST_GROUP_CODE = 'ACOSG'
                             AND CGCV_GRADE_CODE_1 = 'G1' ) B
    WHERE OS.sl_dt <= TO_DATE('31/05/2012', 'dd/mm/yyyy')
    AND OS.sl_rcvd_issd = 'R'
    AND (OS.sl_txn_code = 'SGRN' OR OS.sl_txn_code = 'PGRN' OR OS.SL_TXN_CODE = 'SAOP' )
    --AND (os.SL_REF LIKE 'CRE%' OR os.SL_REF LIKE 'UT%' OR os.SL_REF LIKE 'MAR%' OR os.SL_REF IS NULL )
    AND B.CGCV_ITEM_CODE(+) = OS.SL_ITEM_CODE
    AND OS.SL_COST_GROUP_CODE(+) = 'ACOSG'
    AND sl_grade_code_1 = 'G1'
    order by sl_item_code, sl_dt
    The following output will be :-
    Date_______Item__Code________V1___V2
    01/01/2012_AAA___CRE1005____100___200
    02/02/2012_AAA___ABC1005_____50____200
    02/03/2012_AAA___CRE1005_____90____200
    01/03/2012_BBB___ABC1005_____50____1000
    04/04/2012_BBB___ABC1005_____12____1000
    From the output, when group by item & code, I am actual needs only Code with CRE1005, but for item : AAA group, I cannot delete code of ABC1005 because it consists of code with CRE%. For item : BBB, where Code not like CRE% then the two records actually I don't need to select in my SQL.
    Can anyone help me to think about ways of solving this issue ?
    Thanks.
    Lim

    with t
    as
    select to_date('01/01/2012', 'mm/dd/yyyy') dt, 'AAA' item, 'CRE1005' code, 100 v1, 200 v2 from dual
    union all
    select to_date('02/02/2012', 'mm/dd/yyyy') dt, 'AAA' item, 'ABC1005' code, 50  v1, 200 v2 from dual
    union all
    select to_date('02/03/2012', 'mm/dd/yyyy') dt, 'AAA' item, 'CRE1005' code, 90  v1, 200 v2 from dual
    union all
    select to_date('01/03/2012', 'mm/dd/yyyy') dt, 'BBB' item, 'ABC1005' code, 50  v1, 1000 v2 from dual
    union all
    select to_date('04/04/2012', 'mm/dd/yyyy') dt, 'BBB' item, 'ABC1005' code, 12  v1, 1000 v2 from dual
    -- Output sample ends.
    -- Original select begins
    select t1.dt, t1.item, t1.code, v1, sum_v1, v2
    from t t1,
            select item, code, sum(v1) sum_v1
            from t
            group by item, code
            ) t2
    where t1.item =t2.item
        and t1.code = t2.code;
    DT       ITEM CODE            V1     SUM_V1         V2
    01.01.RR AAA  CRE1005        100        190        200
    02.02.RR AAA  ABC1005         50         50        200
    03.02.RR AAA  CRE1005         90        190        200
    03.01.RR BBB  ABC1005         50         62       1000
    04.04.RR BBB  ABC1005         12         62       1000
    5 rows selected.
    with t
    as
    select to_date('01/01/2012', 'mm/dd/yyyy') dt, 'AAA' item, 'CRE1005' code, 100 v1, 200 v2 from dual
    union all
    select to_date('02/02/2012', 'mm/dd/yyyy') dt, 'AAA' item, 'ABC1005' code, 50  v1, 200 v2 from dual
    union all
    select to_date('02/03/2012', 'mm/dd/yyyy') dt, 'AAA' item, 'CRE1005' code, 90  v1, 200 v2 from dual
    union all
    select to_date('01/03/2012', 'mm/dd/yyyy') dt, 'BBB' item, 'ABC1005' code, 50  v1, 1000 v2 from dual
    union all
    select to_date('04/04/2012', 'mm/dd/yyyy') dt, 'BBB' item, 'ABC1005' code, 12  v1, 1000 v2 from dual
    -- Output sample ends.
    -- Original select begins
    select t1.dt, t1.item, t1.code, v1, sum_v1, v2
    from t t1,
            select item, code, sum(v1) sum_v1
            from t a
            where exists
                    select 1
                    from t b
                    where code like 'CRE%'
                        and a.item = b.item
            group by item, code
            ) t2
    where t1.item =t2.item
        and t1.code = t2.code;
    DT       ITEM CODE            V1     SUM_V1         V2
    01.01.RR AAA  CRE1005        100        190        200
    02.02.RR AAA  ABC1005         50         50        200
    03.02.RR AAA  CRE1005         90        190        200
    3 rows selected.

  • Transfer Data from a Query to DSO

    Hello,
    I have an APD to transfer data from a query to a 'Direct update DSO'. The execution of this APD times out since the volume of query data is very high.
    Is there an alternate way of transfering data from a query to DSO?
    Please suggest.
    Thanks!

    One way would be to extract the data from the existing cube using a function module that would mimic the query level filters and restrictions. That data can be populated into the new cube.
    I wud suggest u take the data from a non-aggregated layer (say a DSO below the cube).
    Also, check for the possibility of running the APD in multiple runs by using some kind of selection that would sum up to give u the whole data required.
    Can u confirm if ur query itself is getting timed out?
    -PA1

  • Bapi to get data from BW query

    Hi,
    Does anyone familiar with bapi function to get data from BW query .???
    I'm trying to use  RS_VC_GET_QUERY_VIEW_DATA_FLAT  but i get only the SUM rows of the query
    and not the details rows (drill down).
    i want to export the data of BW query to table and i need all the query data.
    if someone have an example or documention its will be great.
    Thanks.

    Hi,
    Does anyone familiar with bapi function to get data from BW query .???
    I'm trying to use  RS_VC_GET_QUERY_VIEW_DATA_FLAT  but i get only the SUM rows of the query
    and not the details rows (drill down).
    i want to export the data of BW query to table and i need all the query data.
    if someone have an example or documention its will be great.
    Thanks.

  • How to exclude weekends & holidays from a date range

    Hi Friends,
    How can I exclude weekends & other holidays (which are specific to that country only) from a given range of date (if any weenends or holiday falls in that range)?
    Please supply some sample code if possible.
    Thanks in advance.

    Enayats_screen wrote:
    Hi
    I have found the relevant code for your help. May be this will solve your purpose. Please visit the below link
    http://www.simplyshareit.net/itemDetails.jsf?q=532&
    Thanks.Whew! Thank the gods you saved the OP from having to actually think or learn or clearly communicate his problem!

  • No data from BW-Query in BO-tools

    Hello all
    On a newly installed BO XI 3.1 with the SAP integration kit I cannot get data from my existing BW queries.
    For example, if I start Xcelsius and add my BW-system as connection I can get the structure of the query (headings) but no data is displayed, neither in the connection's preview tab nor in the web preview.
    The same happens if I create a QaaWS on this BW-query - I see the query headings, but not the actual data.
    The query shows data if I open it directly in my web browser and it's a really simple one: no variables, no extras, only a few columns and rows.
    I use SAP BW 7.01 SP6, XI 3.1 12.3.3 and XCelsius 2008 5.3.4
    In SAP BW my user has SAP_ALL as well as BOE Admin & Content producer roles.
    I'm relatively new to BO products so I have no idea where to start looking for the cause. Please help!
    BR
    Kanan

    Hi
    After I found the document "Using Xcelsius 2008 with SAP NetWeaver BW" (http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10ad2489-8956-2d10-f8ab-ed4cce2766da?quicklink=index&overridelayout=true) and followed the steps it works.
    It seems as if the error was not in the system but in front of it - a typical case of RTFM, although the manuals are not always easy to find.
    sorry & thanks.
    BR
    Kanan

  • Confused - How to Calculate Number of Days Between Dates but Exclude Weekend Dates If There Hasn't Been a Weekend Update

    Hello -
    I've been tearing my hair out over this problem i'm trying to solve, probably just been staring at it too long which is making it worse -
    I have a series of open support tickets which are supposed to be updated on a daily basis, the problem is that they aren't always being updated daily.  So, the business wants to know the number of days from when a ticket was last updated and today's
    date.  I have this basic calculation and it's working fine, however now the business wants to exclude weekends from the calculation.  The other problem is that some reps DO go in on weekends and update their tickets, so sometimes there will be updates
    made on weekend dates.
    To give an example -
    Today's date is 2014-02-10 (Monday).  A ticket was last updated last Thursday, 2014-01-30.  The difference between the two dates is 11, so it's been 11 days since the ticket was last updated.  Now, if I exclude Saturdays and Sundays, then
    it's actually been 7 days since the ticket was last updated.  I'm not sure how to do this in T-SQL.
    Now, to further complicate the problem, sometimes a ticket IS updated on a Saturday or Sunday.  So, if a ticket was updated on 2014-02-02 (Sunday), then it should be counted.  Again i'm not sure how to do this. 
    What gets me is that this is probably fairly simple and i've just been staring at it too long.  In the meantime, can someone offer some guidance?
    Thanks!!

    I've adapted this from a function on my blog. you will need to add set the YourTicketTable to where ever your tickets are stored.
    CREATE
    FUNCTION [dbo].[CalcWorkDaysBetween](@StartDate
    As DateTime,@EndDate
    AS DateTime)
    RETURNS
    INT AS
    BEGIN
    SET @EndDate
    =DATEADD(DAY,1,@EndDate)
    DECLARE @Count
    AS Int= 0
    DECLARE @Date
    As Date=@StartDate
    WHILE @Date
    < @EndDate
    BEGIN
    IF (DATEPART(WEEKDAY,@Date)IN(1,7)
    OR (SELECT
    Count(*)
    FROM YourTicketTable WHERE TicketDate=@Date)=1)
    BEGIN
    SELECT @Count = @Count
    + 1
    END
    SELECT @Date=DATEADD(Day,
    1,@Date)
    END
    RETURN
    DATEDIFF(DAY,@StartDate,@EndDate)- @Count
    END
    Regards,

  • Can i transfer data from existing apple ID to my  new apple ID?

    i currently have a Ipad 2 registered under an Apple ID ( with my son 's email address),
    bought a new Ipad Air,  would like to set up the new iPad Air  under a new Apple ID ( my email address)
    how can i transfer the data from Ipad 2 ( from existing Apple ID with my son's email address )  t  new Apple ID that I will set up based on my
    own email address
    ectogo

    This is why it is important to have backups of your media and other important files.
    The Windows computer will not be able to read the files on the iPod because of the formating (at least that is my understanding).
    The iPod will need to be formated to work with Windows.  The only way to do this is to wipe the device.
    If you do not have a backup, do you know someone else with a Mac?  What you might be able to do is copy your music from the iPod to their Mac or a USB drive via their Mac.  Then you may be able to simply copy that music from the USB drive to your windows computer.  Do not take my word on this... I am only speculating about possibilities.  I do not own a Mac and have never used one, so not entirely sure this would work.

  • Need to return data from a query in different ways - Please help

    We are using 10g R2
    I have a proc as follows that has a query with over 100 values in the select clause:
    proc one( input param1, input_param2,.... output_cursor )
    as
    begin
    open cursor for
    select ...about 100 values with most of them being calculated
    from table1, view 1, table2, table 3, view 2 ...
    where ....
    and table1.col1 = input param1
    and table1.col2 = input param 2
    and view1.col5 = input param5...
    end;
    I need to return the data that comes from the above query in different formats, columns for a report would be different from columns for screen A and different for screen B. I need only certain columns for a report and different set of columns for another screen. I have wrapper procs that get different input params. From the wrapper procs I intend to call the above proc but would like only selected values.
    How can I accomplish this? Since my main goal is to select different columns for each wrapper I was thinking of insert the data from the above proc into global temp table and selecting whatever columns and order I want from the wrappers.
    What do you think? Any other solutions?
    Thanks
    Edited by: user565033 on Jan 21, 2013 7:50 PM

    You need to clearly separate roles and responsibilities. The PL/SQL code that creates and supplies a cursor handle is server code tasked to supply data. The code that makes the call for server data, is responsible for formatting and rendering that data.
    Thus moving data formatting into the server code needs to be question. Simple example. Cursor does not return invoice date as a date - but formats it into a string using TO_CHAR().
    This works for client1 - as that is the date format expected. However, client2 has different International settings and specifies a different date format. Invoice date, formatted into a string by the server, now renders in the wrong format on client2.
    Server code should not be concerned with rendering and formatting of data send to a client.
    As for the idea to use a global temp table is ..., well to put it nicely, it smells. Badly.
    The single most expensive operation on a database platform is I/O. And now you want to read server data and write it to temporary storage, and the read data from temporary storage to return to the client? What on earth for!? Why purposefully increase the size of the I/O workload? Why decrease performance and undermine scalability?
    Provide a proper abstraction interface to the client. Enable it to specify (as simplistically as possible) what it wants ito data. There are a number of ways to design and implement this in PL/SQL. Simplistic example:
    SQL> create or replace package Employees as
      2 
      3          EMP_FULL_DETAILS        constant integer := 1;
      4          EMP_BASIC_DETAILS       constant integer := 2;
      5 
      6          procedure GetEmpByID(
      7                  cur out sys_refcursor,
      8                  empID in emp.empno%type,
      9                  template in integer default EMP_BASIC_DETAILS
    10          );
    11 
    12          procedure GetEmpByName(
    13                  cur out sys_refcursor,
    14                  empName in emp.ename%type,
    15                  template in integer default EMP_BASIC_DETAILS
    16          );
    17  end;
    18  /
    Package created.
    SQL>
    SQL> create or replace package body Employees as
      2 
      3  type TArray is table of varchar2(32767);
      4 
      5  TemplateList       constant TArray :=
      6          new TArray(
      7                  'EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO ',
      8                  'EMPNO, ENAME, JOB '
      9          );
    10 
    11  procedure GetEmpByID(
    12          cur out sys_refcursor,
    13          empID in emp.empno%type,
    14          template in integer default EMP_BASIC_DETAILS
    15  ) is
    16          sqlSelect       varchar2(32767);
    17  begin
    18          sqlSelect :=
    19                  'select '||TemplateList(template)||
    20                  'from emp where empno = :empID';
    21 
    22          open cur for sqlSelect using empID;
    23  end;
    24 
    25  procedure GetEmpByName(
    26          cur out sys_refcursor,
    27          empName in emp.ename%type,
    28          template in integer default EMP_BASIC_DETAILS
    29  ) is
    30          sqlSelect       varchar2(32767);
    31  begin
    32          sqlSelect :=
    33                  'select '||TemplateList(template)||
    34                  'from emp where ename like :empName';
    35          open cur for sqlSelect using empName;
    36  end;
    37 
    38 
    39  end;
    40  /
    Package body created.
    SQL>
    SQL> var c refcursor
    SQL>
    SQL> exec Employees.GetEmpByID( :c, 7499 );
    PL/SQL procedure successfully completed.
    SQL> print c
         EMPNO ENAME      JOB
          7499 ALLEN      SALESMAN
    SQL>
    SQL> exec Employees.GetEmpByName( :c, 'A%', Employees.EMP_FULL_DETAILS );
    PL/SQL procedure successfully completed.
    SQL> print c
         EMPNO ENAME      JOB               MGR HIREDATE                   SAL       COMM     DEPTNO
          7499 ALLEN      SALESMAN         7698 1981/02/20 00:00:00       1600        300         30
          7876 ADAMS      CLERK            7788 1987/05/23 00:00:00       1100                    20
    SQL>

  • Facing prolem  in Dashboard 4.1, while fetching data from Bex Query

    Hi Exports,
    I am facing an error message  " Failed to (de-)serialise data. (Xsl 000004)"  while fetching data in Dashboard from Bex Query.
    The query is getting connect. while drag n drop some dimensions and measures then going for Refesh or Run Query, geting this error.
    The same query is working fine with other comp like webi n crystal.
    Anybody having solution for this please let me know. I am stuck somewhere.
    Thank You

    Hi,
    Check the data in the infoProvider.Reduce the  Bex query Characteristics & Key figure fields.Try to identify due to which characteristsic adding in Bex Query ,are you facing the issue.Check that characteristic data in the infoProvider.
    Regards,
    Venkat

  • Building a table with data from a query

    Hello group,
    Is it possible to build a table with the output from a query. We would like to build queries on precalculated data, and want to use other queries for the precalculation.
    Regards, Léon Hoeneveld

    Hi Léon,
    use transaction RSANWB.
    It should be available from 3.0.
    regards
    Siggi
    Message was edited by: Siegfried Szameitat

  • How to upload the data from existing ods to new cube?

    Hi all,
    There is an existing ods and reports are been created for that ods. My task is to create a cube and pull out the data from the ods to cube.
    I have created a cube with update rule. And i want to know to how to load all the data from the existing ods to the newly created cube.
    thanxs
    haritha

    Hi haritha,
    If you've already created the update-rules, try to create cube, than make a mapping between ODS & Cube.
    If done,
    1. Right-Click on ODS, find the menu update data to data target.
    2. Choose for Init.
    If you wanna make it update data to cube automatically, then you must setup the setting in ODS.
    1. double-click on it.
    2. In setting, you'll see the option for "automatically update data to data target".
    3. Choose for it.
    Hopefully it can help you a lot.
    Regards,
    Niel.
    thanks for any points you choose to assign.

  • How to exclude weekends/holidays from BPEL Wait activity?

    I can configure the duration of a Wait activity using duration expressions, or specifying some time in the future. However, I have a use case where the Wait should only consider weekdays which are not holidays. Something akin to tying the Wait activity to a business calendar. Don't really need the sophistication of a business calendar, but at least would like to be able to only include weekdays and not weekends. I read somewhere that BPEL uses Quartz to implement the Wait activity.
    http://enterpriseglue.com/index.php?option=com_content&task=view&id=37&Itemid=44
    However, I can't find a way to configure the Wait for anything other than standard durations. Seems like Quartz does support the notion of business calendars. Here is a sample.
    http://www.quartz-scheduler.org/docs/cookbook/FifthWorkingDayTrigger.html
    If anybody has found a way to exclude weekends from the Wait activity in BPEL, or has some idea how it might be done, please share.

    Hi Harrie:
    Not sure I understand what you did. Suppose, for example, that I am setting the Wait duration to P5D. But I want to wait 5 business days instead of 5 calendar days. Do you first calculate what the end-time would be and then set the Wait expiration instead of the duration? In other words, waiting UNTIL a particular time, instead of waiting FOR a specified duration? Is this how you are doing it?
    Tks.

  • Get data from bw query to r/3

    Hi,
    There is a query defined in BW with some variables. The current process is user is executing the query with necessary variables and the query result output is saving as csv file and this file is used in r3 to update the data in r3.
    Now we have to make this process automate. We have to get the query result data from BW to R3.
    We have a constraint of not using the Open hub method in BW.
    Is there any function module or any standard program to get the query result data from BW to r3.
    Any help is highly appreicated.

    able to resolve the issue..
    creating trusting RFC connection solved the problem

Maybe you are looking for