Variable Required For Date Difference In Ac Create Date

Respected All;
I am stuck in a variable for couple of weeks.
Please help me to get the difference in dates coming under the Ac Create Date Column for respective Request Id's.
I want the result in the Delay Column (Variable Required for the result of delay).
For eg:-
A
B
C
D
E
F
G
Request Id
Ac Create Date
Act Role Proper Name
Delay Simplified(Variable Required
Result In Delay
Act Activity Name
1
000000000560492
7/9/2014
Debt Recovery - Archive
=Ac Create Date C2 - Ac Create Date C1
5
Resolved
2
7/14/2014
Call Centre - Back Office
=Ac Create Date C3 - Ac Create Date C2
1
Forward
3
7/15/2014
OWN Shop - AL Rayyan
=Ac Create Date C4 - Ac Create Date C3
7
Resolved
4
7/22/2014
Call Centre - Back Office
= Ac Create Date C5 - Ac Create Date C4
0
Customer Feedback
5
7/22/2014
Call Centre - Back Office
"NA"
NA
Closed FC
6
000000000561010
7/1/2014
Call Centre - Back Office
=Ac Create Date C7 - Ac Create Date C6
1
Forward
7
7/2/2014
FOLLOW UP TEAM
=Ac Create Date C8 - Ac Create Date C7
0
Resolved
8
7/2/2014
Call Centre - Back Office
=Ac Create Date C9 - Ac Create Date C8
1
Forward
9
7/3/2014
R_RO
=Ac Create Date C10 - Ac Create Date C9
12
Return - Wrong Assignment
10
7/15/2014
Call Centre - Back Office
=Ac Create Date C11 - Ac Create Date C10
1
Forward
11
7/16/2014
IT CRM & Provisioning
=Ac Create Date C12 - Ac Create Date C11
0
Reassignment
12
7/16/2014
IT CRM & Provisioning
=Ac Create Date C13 - Ac Create Date C12
1
Follow Up
13
7/17/2014
IT CRM & Provisioning
=Ac Create Date C14 - Ac Create Date C13
0
Reassignment
14
7/17/2014
IT_Comptel
=Ac Create Date C15 - Ac Create Date C14
3
Resolved
15
7/20/2014
Call Centre - Back Office
=Ac Create Date C16 - Ac Create Date C15
0
Recategorization
16
7/20/2014
Fiber Call Center-Back Office
=Ac Create Date C17 - Ac Create Date C16
0
Forward
17
7/20/2014
IT CRM & Provisioning
=Ac Create Date C18 - Ac Create Date C17
1
Resolved
18
7/21/2014
Fiber Call Center-Back Office
=Ac Create Date C19 - Ac Create Date C18
0
Resolved
19
7/21/2014
Fiber Call Center-Back Office
=Ac Create Date C20 - Ac Create Date C19
0
Customer Feedback
20
7/21/2014
Fiber Call Center-Back Office
"NA"
NA
Closed
I have used Delay =DaysBetween([Ac Create Date];Previous([Ac Create Date]))
but however I'm not getting the results required..
Can someone please help me out with the variable.. For better understanding of the question kindly copy paste the table in excel and check it out, but please please help me out !!!
Thanks In Advance

Hi Fahad,
Try Below-
Create variable-
V_NextDate=If RelativeValue([Request Id];([Request Id];[Ac Create Date];[Act Activity Name];[Act Role Proper Name]);1)=[Request Id] Then ToDate((RelativeValue([Ac Create Date];([Request Id];[Ac Create Date];[Act Activity Name];[Act Role Proper Name]);1));"MM/dd/yyyy")
In Delays column put below
=If IsNull(DaysBetween([Ac Create Date];[V_NextDate])) Then "NA" Else DaysBetween([Ac Create Date];[V_NextDate])
See sceenshot

Similar Messages

  • Variable offset for date - a year ago

    I have this sales report with the following columns:
    1. Current Day Sales
    2. Month to Date Sales (this Year)
    3. Month to Date Sales (last Year)
    I'm using a range variable for 0CALDAY for column 2 (Month to Date Sales this year).  i'm having problem with column 3.  how is it possible such that the date is automatically assigned to last year's values?  using offset would mean -365, however, this may not work during leap years?
    please help

    Hi,
    Refer the 'Examples for using Variables' in 'Bex Query designer' of sap help..
    Examples for Offset Variables
    You want to use a query to carry out a comparison of two years.
    Year Comparison
    You want to compare the costs of a year of your choice with the costs of the previous year.
           1.      In the Query Designer, create a new structure and add a new Selection for each year that you require.
           2.      Only use one key figure (for example revenue) in this example query. Add this key figure to the filter or add it to the selection.
           3.      Use a characteristic value variable for the characteristic Calendar Year (0CALYEAR):
    Select the characteristic value variables for Calendar Year and, from the context menu (right mouse click), choose New Variables. The Variables Wizard appears.
    If you always want to reference to the current year automatically, use the SAP Exit variable 0CALYEAR (or as appropriate for another time characteristic).
           4.      Move the defined characteristic value variable into the selection.
           5.      Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
                                a.      Select the characteristic value variable and from the context menu, choose Enter Variable Offsets.
                                b.      Enter –1 as the offset and choose OK.
           6.      Choose OK.
           7.      Enter a description.
    Example: Use the name of the key figure, for example, revenue, for the name and use a text variable for the name of the calendar year. See Using Text Variables.
    When creating a new text variable, enter Replacement Path as the processing type, and choose calendar year 0CALYEAR as the characteristic with display as key.
           8.      Create a second selection with the same characteristic value variable and do not set an offset here.
    Also use a text variable in the description in this case.
           9.      Move the required characteristic into the rows.
       10.      Save the query.
    After execution, the query should appear as follows:
    Variable screen entry: 2002 (or no entry when using the SAP Exit Variable).
    Year Comparison
    A characteristic
    Revenue 2001
    Revenue 2002
    Value 1
    100.000
      90.000
    Value 2
    200.000
    180.000
    Value 3
    300.000
    400.000
    Comparison with Cumulative Previous Year Period
    For example: You want to compare the periods 1-8 of a particular year with the same periods for the previous year.
           1.      Create a new structure in the Query Designer and add a new Selection.
           2.      Move a key figure, for example, Revenue, into the selection.
           3.      Use a characteristic value variable for the characteristic Fiscal Year/Period (0FISCPER):
    Select the characteristic value variables for Fiscal Year/Period and from the context menu, choose New Variable. The Variables Wizard appears.
    Use the SAP Exit variable Current Fiscal Year/Period (0FPER) if you always want to reference to the current year.  If you set the variable as entry-ready in the Variable Editor, after executing the query, the variable screen then appears with which you can change the default values were necessary.
           4.      Move the characteristic value variable, such as OFPER, into the selection.
           5.      Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
           6.      Under Selection, choose Value Area and choose the tab page Variables.
           7.      Add the characteristic value variable, for example 0FPER, to the selection once again for the second value of the interval.
           8.      Select the characteristic value variable and from the context menu, choose Enter Variable Offsets.
                                a.      As an offset, enter -3 as the from value and 0 as the to value. Choose OK.
                                b.      Choose OK.
           9.      Enter a description, such as Revenue for current year.
       10.      Choose OK.
       11.      Select the selection and from the context menu, choose Copy and then Paste.
       12.      Now select the second selection and from the context menu, choose Edit.
       13.      Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
       14.      Select the characteristic value variable again and from the context menu (the right hand button), choose Enter Variable Offsets.
                                a.      As an offset, enter -15 as the from value and -12 as the to value. Choose OK.
                                b.      Choose OK.
       15.      Enter a description, for example Revenue for previous year.
    Also use a text variable in the description in this case.
       16.      Choose OK.
       17.      Move the required characteristic into the rows.
       18.      Save the query.
    After execution, the query should appear as follows:
    Variable screen entry: 01. 2002 to 08. 2002
    Comparison with Cumulative Previous Year Period
    A characteristic
    Revenue 01. – 08. 2001
    Revenue 01. – 08. 2002
    Value 1
    100.000
      90.000
    Value 2
    200.000
    180.000
    Value 3
    300.000
    400.000
    Two text variables replaced with characteristic values were used for the descriptions here. One is filled with the from-value for the column with an offset of 0 and a length of 3, the other filled with the to-value with an offset of 0 and a length of 7. You can find additional information under Example for Variable Replacement.
    Comparison of Cumulated Values for Two Years
    You may want to compare the cumulated values up to the current period of the current year with those of the previous year.
    For this example, use the variable 0FPER (current fiscal year period) and the variable 0P_FPER (your chosen fiscal year period). You use these two variables to set the interval limits.
           1.      In the Query Designer, create a structure with two selections:
    ¡        1. selection: Cumulative Amount for current year
    ¡        2. selection: Cumulative amount for previous year
           2.      With the first selection (cumulative amount for current year) , move the time characteristic 0FISCPER into the selection and select it.
           3.      Choose Restrict from the context menu (right mouse click).
           4.      Choose Value Area between as the selection and go to the tab page Variables.
           5.      Double click to choose the variable 0P_FPER as the from value and variable 0FPER as the to value. The result is an interval from the chosen period to the current period.
           6.      Define the second selection (cumulative amount for previous year) and proceed as for the first selection.
    ¡        Add the variable 0P_FPER as the from value and variable 0FPER as the to value here.
    ¡        Set an offset of –12 for both the from and the to values:
    Select the interval and from the context menu (right click), choose Enter Variable Offsets. Enter –12 for each.
    The result is an interval that has been moved 12 periods ahead.
           7.      Add the key figures and additional characteristics for the query.
    After executing the query, you get a variable screen for the variable 0P_FPER. You need to enter the start period in the current fiscal year.
    You can also suppress this entry by deactivating the indicator Entry-ready in the Variable Editor for the variable 0P_FPER and entering a default value (for example, 001.2001 for 2001). You only have to change this value once per year.
    You have now defined a query that compares the cumulative values for two years.
    The variables with SAP Exit delivered by SAP have the following behaviors:
    Variable 0FPER (current fiscal year period): Displays the values of the current fiscal year period.
    Variable 0P_FPER (any fiscal year period): Displays the values of any fiscal year period. You can set the fiscal year period in the variable screen when executing the query in any way you require.
    Variable 0FYTCFP (fiscal year up to current fiscal year period): Displays the values of the first period up to the current period of the current fiscal year.
    Variable 0FYTLFP (fiscal year up to previous fiscal year period): Displays the values of the first period up to the previous period (current period –1).
    You need to use the variables 0FPER and 0P_FPER in the above example for the comparison of cumulative values for two years.  When using the variables 0FYTCFP and 0FYTLFP, only values for one month are displayed for year transitions with an offset of –12.
    Regards,
    Prema

  • Complex requirement for Date/Time Period related - Please help!!

    Hi,
    This is a complex requirement by my client.
    There is a Patients table with the patient's eligbility for the insurance, on monthly wise. I have to find the Inactive patients and also when they are Inactive in the past as well as as of now. 
    Few points about the table and logic:
    1.Data is from Jan 2012 and it is on monthly basis. For Eg: if he enrolls on Jan 2012 and he is active till last month(Jan 31,2015), then From Jan 2012 to Jan 2015, one record per each month is available.  ie total of 37 records for him. If he is Inactive
    for a period then that period record will  be missing.
    2.I need to consider from the day they enrolled to till Jan 31st,2015, to find out whether they are Inactive for any months between their enrolled date to till Jan 31st,2015.
    3. In the below image, PatientID 1000 - No issue with him. he enroled on Aug 2014 and has records till Jan 2015 - No issues. He will not be counted for Inacive members.
    4.patientID 1001 - He is active till now as he hsa records till Jan 2015. But he was Inactive from 2014-06-06 to till  2014-06-30. So,he has to be counted as 'less than 1 month Inactive member for 2014'
    5.PatientID 1002 - He is active till now as he haa records till Jan 2015. But he was Inactive from 2014-09-01 to till  2014-09-30. So,he has to be counted as ' 1 month Inactive member for 2014'
    6.PatientID 1003 - He was Inactive for 09th &10th months for 2014. and also he has record only till Dec 2014. So,he has to be counted as '2 month Inactive member for 2014' and '1 month Inactive for 2015'
    7.PatientID 1004 - He is active from jan 2012 to Apr 2012 only. So,he has to be counted as '8 month Inactive member for 2012','12 month Inactive member for 2013','12 month Inactive member for 2014'  and '1 month Inactive for 2015'
    Please help me to find this as this is very complex for me - Finally they want a table like the second image below
    In the table X=0 means Count of all Members who are NOT inactive ).
    Thanks much in advance for your valuable inputs!

    Create something like a calendar table with a column with dates from enough years that will cover your patient history. For example dates from Jan 1, 2012 to some future date like Dec 31, 2020. Then it will be an OUTER join with this calendar table and get
    DISTINCT months when the patient was inactive.
    The calendar table can have just Month and Year too instead of dates. But usually dates can be useful in many other scenarios too.
    An example -
    create table patient (id int, effective_date date, end_date date)
    create table calendar (id int identity, calendar_date date)
    insert into patient (id, effective_date, end_date) values
    (1000, '1/1/2014', '1/31/2014'), -- patient 1
    (1000, '2/1/2014', '2/28/2014'),
    (1000, '3/1/2014', '3/31/2014'),
    (1001, '1/1/2014', '1/31/2014') -- patient 2
    declare @date date = '1/1/2014'
    while @date <= '12/31/2014' -- 1 year
    begin
    insert into calendar (calendar_date)
    values(@date)
    set @date = DATEADD(dd, 1, @date)
    end
    select distinct p.id as patient, MONTH(c.calendar_date) AllMonths, YEAR(calendar_date) Allyears
    from patient as p right outer join calendar as c
    on c.calendar_date between p.effective_date and p.end_date
    ;with
    AllMonthYears as (select MONTH(calendar_date) Months, YEAR(calendar_date) Years from calendar)
    , AllPatients as (select distinct id as PatientId from patient)
    , AllPatientsWithMonthsYears as (select distinct * from AllMonthYears cross join AllPatients)
    select *
    from AllPatientsWithMonthsYears as apmy
    left outer join patient as p
    on apmy.Months = month(p.effective_date)
    and apmy.Years = year(p.effective_date)
    and apmy.PatientId = p.id
    order by apmy.PatientId, apmy.Years, apmy.Months

  • Coding Required for Data Load...

    Hi All,
    I am stuck up in an issue where I know the logic but unable to write a code. I have the requirement as follows :-
    I have the records in Excel as given below:-
    Fiscal Year          2004
    Key                     004
    Capitalization       A
    Norm Debts         B=0.7*A
    Rate of Interest    C
    Repayment          D=B/10
    Op. Balance         D=B/10
    Cl. Balance          E = B-D
    Total Interest        G=E+F/2*C
    The above records are the data which I am loading first time and only one record. The cube shud be populated with the data till Closing Balance becomes zero.
    So my logic will be
    First record by excel and second onwards is :-
    Fiscal Year         2004 +1 (It shud add 1 to every record till closing balance becomes zero)
    Key                    004 (Constant till Closing balance becomes Zero)
    Capitalization      A (Constant till Closing balance becomes Zero)
    Norm Debts        B (Constant till Closing balance becomes Zero)
    Rate of Interest    C (Constant till Closing balance becomes Zero)
    Repayment         D (Constant till Closing balance becomes Zero)
    Opening Balance   (Closing Balance will become Opening Balance here) = B-D
    Closing Balance     (Closing balance will now again will be debited by repayment that is B-2D)
    Total interest        = (Opening Balance + Closing Balance)/ 2 * Rate of Interest
    So next record will be opening balance = B-2D and Closing Balance will be B-3D and the record shud be automatically fetched till Closing Balance becomes zero.
    Any help will be assigned with points.
    Thanks and Regards,
    Sangini Mathur.

    Hi Sangini,
    I think in ur case u have to LOOP aginst source_package
    in the start routine only then you can get ur requirement.
    Data: w_temp1 like source_package-cl.balance.
    while w_temp1 eq 0.
    Put all your calculations here
    endwhile.
    Hope it helps
    Bhaskar
    Edited by: shanthi bhaskar on Jun 3, 2008 2:34 PM

  • Variable Code for Date

    Requirement: I have Posting Date for all Objects Now i want to create the <b>Variable “PSTVAR”</b>such that the variable will populate <b>only the entries with
    User Input Posting Date(During Report Execution) >=greater than equal to Posting Date(OPSTDATE). .</b>
    <b>Example</b> POSTING DATE = 03032007
    POSTING DATE = 01012006
    IF USER INPUT DATE = 01012007
    Then only POSTING DATE = 03032007 will show up in report
    write the code in <b>customer exit cmod in BI</b> if CAN CORRECT THE CODE WOULD BE GREAT
    Data: l_s_var_range Type rrangeexit.
    L_d_PSTDATE Type /bio/oipstdate.
    L_d_PSTDATE Type /bio/oipstdate.
    IF I_STEP=2.
    READ TABLE I_t_var_range INTO l_s_var_range WITH KEY VNAM = ‘PSTVAR’.
    If L_d_PSTDATE >= PSTVAR’
    L_d_PSTDATE=l_s_var_range-low(0)
    Please help me modify the above code with logic or with some extra line of code to solve my requirement. Appreciate all of you for help in advance
    Thanks
    Soniya Kapoor

    This can be done without any coding.
    If you are using the Web, there is a Boolean operator dropdown for each variable. Enter "1/1/2007" for the Posting Date variable value (in your example), then change the operator to ">=". (There is probably even a way to default to this.)
    If you are using Excel, enter "1/1/2007" for the Posting Date variable value, then right click and choose "Options" and ">=".
    Hope this helps...
    Bob

  • Variable required for 0DOC_DATE, same as the SAP exit variable 0P_KEYDT

    Hi Gurus,
    I am currently trying to create a query based upon the InfoProvider -  FIAP: Line Item (0FIAP_C03).
    For the Characteristic Net Due Date (0NETDUEDATE) there is a SAP exit variable called Key Due Date (0P_KEYDT).
    I need to replicate this variable for 0DOC_DATE, which is what I need to use in this query.
    I do not have any knowledge of ABAP therefore could you please advise;
    1) Whether this variable can be replicated for 0DOC_DATE so that it defaults to system date - 1 day
    2) What steps I need to take to create this variable
    3) What is the exact ABAP code that I will need to do this.
    If there is a variable that already exists for 0DOC_DATE that acts in the same way as 0P_KEYDT then please let me know.
    Thanks
    Nate

    Hello,
    1&3) goto CMOD - create e.g. ZBWVARS. Add RSR00001enhancement. Modify ZXRSRU01 include.
    You need developer key to do that.
    CASE i_vnam.
    WHEN 'ZDOC_DATE,'.
        IF i_step EQ '2'.
          CLEAR l_s_range.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          l_s_range-low = sy-datum - 1.
          APPEND l_s_range TO e_t_range.
        ENDIF.
    ENDCASE.
    2) In Query Designer create customer-exit variable ZDOC_DATE.
    BR
    Ondrej

  • How to use the same variable value for data entry and the planning sequence

    Hi,
    the scenario is the following:
    Using the WAD template a user enters cost center plan data. The cost center is selected by the chosen value for the variable "V1".
    Afterwards he shall push a button which starts a planning sequence (including saving the data and further functions). This planning sequence uses a filter that also contains the variable "V1".
    What or where has it to be defined that the planning sequence uses automatically the same value for the variable "V1" as selected for the data entry?

    You have to define in the planning function. The planning sequence is only a sequence and it read the planning functions underneath it.
    Ravi Thothadri

  • Help Required for date display & mutating trigger

    Hai all..
    I need clarification for 2 problems.
    Problem 1
    Is there a possibility to display the values with a date range.
    I mean if there is no data for a particular date within the given range. it should display some null value.
    Eg.
    table name : sample
    Sno Date1 Name desgn
    1 1-may-2004 xyz engr
    1 3-may-2004 xyz engr-1
    1 4-may-2004 xyz engr-2
    The query is
    select * from sample where date1 between '01-may-2004' and '04-may-2004'.
    The result of query will be
    Sno Date1 Name desgn
    1 1-may-2004 xyz engr
    1 3-may-2004 xyz engr-1
    1 4-may-2004 xyz engr-2
    But i need the result to be displayed as
    Sno Date1 Name desgn
    1 1-may-2004 xyz engr
    nil 2-may-2004 nil nil
    1 3-may-2004 xyz engr-1
    1 4-may-2004 xyz engr-2
    Pls let me know how to achieve this.
    Problem 2:
    While i am updating a value using a trigger.
    I am getting "mutating" error.
    Is there a possibility to avoid the mutation.
    The two triggers i am using is
    Trigger 1
    CREATE OR REPLACE TRIGGER TRIG_DURATION_UPDATED
    AFTER UPDATE ON
    TIMESHEET_DATA
    FOR EACH ROW
    DECLARE
    ID_COUNT DATE;
    A date;
    NN NUMBER;
    AA NUMBER;
    NN1 NUMBER;
    BEGIN
    b_dur :=0;
    IF UPDATING('PROGRESS') THEN
    SELECT COUNT(1) INTO AA FROM TIMESHEET_DATA_PAUSE WHERE DATA_sNO = :OLD.DATA_SNO AND EMP_ID = :OLD.EMP_ID AND
    ACNUM = :OLD.ACNUM AND DURATION IS NULL;
    IF AA > 0 THEN
    SELECT to_date(START_TIME,'DD-MON-YYYY HH:MI AM') into a FROM TIMESHEET_dATA_PAUSE WHERE
    EMP_ID = :NEW.EMP_ID AND ACNUM = :new.acnum AND DATA_SNO = :new.data_sno AND pause_TIME IS NULL
    AND DURATION IS NULL;
    select to_date(sysdate,'DD-MON-YYYY HH:MI AM') into id_count from dual;
    SELECT A - ID_COUNT INTO NN FROM DUAL;
    SELECT round(TRUNC(NN*24),2) INTO NN1 FROM DUAL;
    UPDATE TIMESHEET_dATA_PAUSE SET DURATION = NN1,PAUSE_TIME = SYSDATE WHERE
    EMP_ID = :NEW.EMP_ID AND ACNUM = :new.acnum
    AND DATA_SNO = :new.data_sno AND pause_TIME IS NULL AND DURATION IS NULL;
    END IF;
    END IF;
    END;
    Trigger 2
    CREATE OR REPLACE TRIGGER TRIG_DURATION_UPDATED_PAUSE
    AFTER UPDATE ON
    TIMESHEET_DATA_PAUSE
    FOR EACH ROW
    DECLARE
    ID_COUNT DATE;
    A_COUNT NUMBER(10);
    A date;
    NN NUMBER;
    AA NUMBER;
    NN1 NUMBER(10,2);
    BEGIN
    IF UPDATING('DURATION') THEN
    SELECT COUNT(1) INTO A_COUNT FROM TIMESHEET_DATA WHERE DATA_sNO = :new.data_sno AND EMP_ID =:new.EMP_ID
    AND ACNUM = 'ACNUM' AND DURATION IS NULL;
    IF A_COUNT >0 THEN
    SELECT NVL(SUM(DURATION),0) INTO NN1 FROM TIMESHEET_DATA_PAUSE WHERE DATA_sNO = :new.data_sno AND EMP_ID =:new.EMP_ID AND ACNUM = :NEW.ACNUM;
    UPDATE TIMESHEET_DATA SET DURATION = NN1 WHERE DATA_sNO = :new.data_sno AND EMP_ID =:new.EMP_ID AND ACNUM = :NEW.ACNUM AND DURATION IS NULL;
    END IF;
    END IF;
    EXCEPTION WHEN DUP_VAL_ON_INDEX THEN
    DBMS_OUTPUT.PUT_LINE ('CANNOT INSERT');
    END;
    Pls let me know the solutions for the two..
    Thanks in Advance
    Gaya3

    In future please start two threads when you have two questions to ask. Othewise it makes things difficult to follow and may well lead to some of your questions not getting an answer. Unlike some other sites there is no limit to the number of posts we can have :)
    To answer your first question:
    If you have Oracle9i you can do this using a PIPELINED function to act as a pivot table (in earlier versions you will have to have a table of some description - ALL_OBJECTS will do in a pinch).
    CREATE OR REPLACE TYPE t_dates AS TABLE OF DATE
    CREATE OR REPLACE FUNCTION f_dates
      (st IN DATE, cnt IN INTEGER) RETURN t_dates
      PIPELINED
    AS
      dd date;
    BEGIN
      FOR a IN 1..cnt LOOP
        SELECT  st + (a-1)
          INTO  dd
          FROM  dual;
        PIPE ROW (dd);
      END LOOP;
      RETURN;
    END f_dates;
    /So, given this data...
    SQL> select * from t57
      2  /
          COL1 COL2
             3 05-MAY-04
             4 06-MAY-04
             5 07-MAY-04
             6 12-MAY-04
             8 15-MAY-04
    5 rows selected.
    SQL>...we can run this query...
    SQL> SELECT nvl(to_char(t.col1), 'Nil'), dd.ndate
      2  FROM   t57 t
      3         , ( select column_value AS ndate from table(cast(f_dates(trunc(SYSDATE), 11) AS t_dates))) dd
      4  WHERE trunc(dd.ndate) = trunc(t.col2(+))
      5  /
    NVL(TO_CHAR(T.COL1),'NIL')               NDATE
    3                                        05-MAY-04
    4                                        06-MAY-04
    5                                        07-MAY-04
    Nil                                      08-MAY-04
    Nil                                      09-MAY-04
    Nil                                      10-MAY-04
    Nil                                      11-MAY-04
    6                                        12-MAY-04
    Nil                                      13-MAY-04
    Nil                                      14-MAY-04
    8                                        15-MAY-04
    11 rows selected.
    SQL> Obviously, you will want to tidy up the function to suit your needs.
    Cheers, APC

  • Variable binding for Date type over ODBC

    Hi I'm trying to parameterize a DATE variable over ODBC. Over JDBC I have no problem doing so in Java but on the ODBC (C-code) I had problem figuring out how to deal with the expression, *{ts '2009-02-23 09:02:10'}.* But eventually based on SQL tracing on the DB side, I found that it gets translated to to_date('2009-02-23 09:02:10', 'YYYY-MM-DD HH24:MI:SS'). So now I can attempt to parameterize. But that's the side story.
    My question is, do I gain any performance by doing the following (cut and paste from SQL trace)
    SELECT ROWID, reservation_id, job_type, job_start
    FROM reservation_job_queue
    WHERE job_start &lt;= to_date(:1, 'YYYY-MM-DD HH24:MI:SS')
    ORDER BY job_start
    as compared to the original
    SELECT ROWID, reservation_id, job_type, job_start
    FROM reservation_job_queue
    WHERE job_start &lt;= to_date('2009-02-23 09:02:10', 'YYYY-MM-DD HH24:MI:SS')
    ORDER BY job_start
    Thanks!
    Edited by: pidge66 on Feb 23, 2009 6:27 AM
    Edited by: pidge66 on Feb 23, 2009 6:30 AM

    If I understand you correctly, you want to be able to enter some arbitrary dates in the where-clause of your application.
    Thus, to use the first form with a bind variable is key for performance of your application.
    And yes, you will gain a lot of performance when using to_date(:1, 'YYYY-MM-DD HH24:MI:SS') instead of to_date('2009-02-23 09:02:10', 'YYYY-MM-DD HH24:MI:SS').
    Why not using bind variables is evil you can read best over at AskTom

  • Reg:variable creation for date

    how to create a variable with last refresh date
    after that use that object  ( <Date> is less than New
    Date). This will give you the entire data till last refresh date.

    Hi Vinay,
    You can get last refresh date using below function
    Var1=LastExecutionDate()
    Then you can apply filter [Date Object]>Var1

  • New Directory in Application server Required for data upload

    Hi,
    I need to load data in SAP application server. i will use CG3X to load the data.
    I need to create a new directory in the application server to load all my flat files. Does any one know how to create a directoty?
    Please provide list of steps and transactions used for creating this.
    Thnks

    Go to t-code FILE.
    Click on Logical file path definition and hit the New Entries button
    Enter your logical path name, say ZXXX
    Go back to FILE
    In the right window, click on the block on the left to highlight the line you just created.
    Now double-click on Assignment of physical paths to logical path
    Now click New Entries.
    Select your syntax group (this is just your O/S)
    Here you can enter your physical path.

  • BADI UserExit Required for Before transport Request is created

    Hi Friends,
    I have a problem in implementing  :
    We have two development client one for support and other for development.
    Same object can be worked together in both client simultaneously that is causing lot of synchronization problem in both client.
    Can any one suggest any BADI which i can use when creating Transport Request to check if the same object is locked in other client or not using the RFC.
    Please provide if there is any solution to implement the same.

    Hi
    Check the following BADI's
    <b>
    CTS_REQUEST_CHECK               Request checks</b>
    CTS_EXPORT_FEEDBACK           Feedback after export of a transport request
    CTS_IMPORT_FEEDBACK           Feedback after import of transport requests
    CTS_INT_REQUEST_CHCK          Internal: Request Checks
    CTS_TASKDOC_TEMPLATE        Determine template for the task documentation
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • How do I include all the necessary files required for the DAQ Assistant to create an executable file?

    I am creating an executable file to run on a computer that does not have LabVIEW installed.  The problem is that I am using the DAQ Assistant.  The VI Hierarchy is rather large, and I am not sure how to include all of the required files to eliminate the error "The full development version of LabVIEw is required to fix the errors."  Attached is an image of the VI Hierarchy.
    Solved!
    Go to Solution.
    Attachments:
    hierarchy.jpg ‏419 KB

    Yes I did create an installer.  See image installernoDAQmx.jpg  
    When this is all I do I get an error that subvi is not included, a list of about 6 subvi's.  To eliminate this error I manually add the subvi from the dependencies list to the my computer list. This allows me to add them as support files.  This eliminates the error about subvi not included, but then I get the error I spoke of earlier.
    If I include the DAQmx I get an error.  See image installererror.jpg
    Not sure what MAX refers to?
    Attachments:
    installernoDAQmx.jpg ‏259 KB
    installererror.jpg ‏103 KB
    dependencies.jpg ‏344 KB

  • R3 Table Required for data load status

    Hi all,
    I am in 3.x version so rsstatmanpart(fast table only available in bi7) wont work.
    I want the no of records added and transferred for a specific cube on a specific date.
    Thanks in advance.

    Check Tables RSMONICTAB, RSMONFACT, RSMONICDP
    Hope this helps..
    /pradeep

  • Is a third-party tool required for data extraction to non-SAP system?

    Hi,
    I want to extract data to non-SAP systems with the open hub service.
    If I choose Database tables as open hub destinations, I would like to know if a third-party tool is mandatory and if it's possible to send data directly from database tables in BW to non-SAP systems.
    Many thanks
    Ella

    you can choose a flat file on the application server and then transffer the file from the application server to other server where you want to use.
    in case you want to use the table in the open hub service. any other software that can connect to oracle db / the databasee you have and can access the data from the table.
    Regards,
    Bwer
    Assign points if helpful.

Maybe you are looking for