System date to be populated in formula variable

Hi Friends,
I have a requirement, where we are checking for the no of days delayed. For this the formula is req date - system days.
I have created a fromula variable on the req date, but to populate the system date i am getting lost. Can i use 0CALDAY for this?.
Can someone please let me know how to populate the system date? i think i have to write customer exit, but my abap kills are really bad, it would be great if anyone can give me code to populate the system date.
Also i read in one of the threads, that if we use 0DAT, that populates the current system date. but when i check in the formula variable editor, i cannot see 0DAT. should i add this to the dataflow?.
Thanks in advance
Regards
BN

Hi,
System date is available as 0DAT. But if it is not activated in your system you can Create a customer exit type formula variable of dimension date. Use the following simple code:
DATA:  l_s_range TYPE rsr_s_rangesid.
DATA: system_date LIKE sy-datum.
IF I_VNAM EQ 'VARIABLE-NAME'.
IF I_STEP EQ 2.
    CLEAR : system_date .
    system_date = sy-datum.
    CLEAR l_s_range.
    l_s_range-low = system_date.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    APPEND l_s_range TO e_t_range.
ENDIF.
ENDIF.
Best Wishes,
Mayank

Similar Messages

  • Formula Variable and key date

    Hello!
    Maybe someone can help me with the following problem:
    We have an inventory cube and want to see our stock with alternative values. On 0Material exists a key figure ("price") as time-dependent attribute. This key figure displays the price of the material for different periodes (that's why attribute is time-dependent).
    In the query I created a formula variable (=> replacement path, replaced with the mentioned key figure "price") and in a formula I multiplicate stock and the formula variable. This works fine and value of key figure "price" is correctly selected according to key date of the query.
    But I need a second formula, where stock from previous year is multiplicated with "price" from previous year, so I need a possibility for a second key date relevant for a second formula variable.
    Anyone who had a similar problem? Any idea how to solve this problem - formula variables are not mandatory!
    Br
    Gunter

    Hi Kishore,
    Use the formula created by you (say Formula 1) in a new formula ( say Formula 2).
    Use If Else condition.
    Formula 2 = (Formula 1 < 0)0 + (Formula 1 >=0)Formula 1
    The above expression explained as:
    If Formula1 < 0 then
      Formula 2 = 0
    Else
      Formula 2 = Formula1.
    You can hide Formula 1 and Display only Formula 2 in your report.
    Hope this helps!

  • Problem with formula variable

    HI,
    I am facing problem with formula variable with replacement path. my requirement is system date - posting date.
    here i created 2 formula variable one is system date. second formula vaiable with replacement path is posting date. second formula vaiable not populating data. please help on that.
    regards,
    kris

    Hi,
    here is some idea.. here i have taken expample dates 1)notification creation date and 2) notification completion.
    1st:in the query designer at key figure coloumn create
    one local formula.in that local formula create formula
    variable with replacement path.in that take reference character
    notification completion.in the next tab take replace ment
    as key.in the last tab select "date".
    2nd: do the same thing for the notification creation date.
    3 rd : create 3 rd local formula and do the substraction
    for the first 2 local formulas.
    4th:create codition on the difference which u have find with
    on that condition u can create one user entry varibale.
    5th:while u defining the query put these 2 dates,i,e
    notification completion, notification creation date in the character block.
    If not system will ignore the formula variable which u created in
    above steps.
    Hope this wil help u.
    regards....KP

  • Formula Variables and their use

    I have a scenario where I have a date selection using a variable.
    I get from and to date defaulted to 1st day of the month and current date
    Next, I created a formula variable to calculate the difference between these 2 dates.
    I can't uses replacement path variable to calculate the difference becaue the dates are not part of the transaction data.
    When ever I bring formual variable into a formual it gives an error
    Terminate: Variable D1QDQC684JU76RD3FQ10GECZ9 (D1QDQC684JU76RD3FQ10GECZ9) does not exist or is incorrectly used D1QUMP50BGW24SQ9PQMZDSMD1 [A418(BRAIN)]
    This error is not in the customer exit. This error happens in the query designer design phase during syntax checks.
    Thanks for your help
    Kartik

    there was a problem in defining the variables, while u r opening your query, and if its getting terminated means, definition of the variable and its usage is wrong somewhere else.
    Here is the step by step procedure for Formula variables:
    http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html

  • Formula Variable Question

    Hi
    I have to calculate No.Of Days Open for a Case. We have Created Date and Closed Date Characteristics.
    Calculation:
    Closed Date - Created Date (If Closed Date is not #)
    else
    Current Date - Created Date.
    I have created two Formula variables on Created and Closed Dates and Used Current Date SAP Exit variable.
    Formula1: Current Date - Created Date
    Formula2: Closed Date - Created Date
    RKF1: Formula1 and Closed Date = #.
    RKF2: Formula2 and Closed Date NE #.
    No.Of Days = RKF1+RKF2
    Whenever Closed Date is blank, Formula 2 is giving "Does Not Exist" in the Output.
    I tried with NOERR, DELTA functions to get zero value in Formula2 for Closed Date = #
    But none of them worked. Surprizingly If I pull Closed Date into the Report, it is showing zeros.
    Can anyone guide where I am doing mistake?
    Best Regards,
    Sree

    HI Parth,
    I am having one issue in CKF.
    Original data:
    Compcode   Caseno.     CreatedOn    Amount
    1000         A        06/18/2011     100
    1000         B        06/19/2011      50
    1000         C        06/18/2011     150
    I have created one CKF for No.of Days Open. It is difference of Sy-datum and Created Date. I used two formula variables and used
    them in the CKF.
    Let us say today is 06/22/2011
    Report Layout:
    Caseno and CreatedOn are Free Characteristics
    Compcode  No.of Days Open   Amount
    1000          4              300
    When I bring in the Case no I am getting below result: It should show No.of Days Open as "3" for Case B. Somehow it is always
    taking maximum difference number and showing for all cases.
    Compcode   Caseno.   No.of Days Open  Amount
    1000         A           4            100
    1000         B               4          50
    1000         C               4            150
    When I bring in Createdon then only it is showing correct value for all cases. I tried with Exception Aggregation with reference to Caseno.
    CreatedOn etc but didn't get the correct result.
    Question: Could anyone identify the problem in my Query design? Thanks for your help
    Best Regards,
    Sree

  • Formula Variable

    Hi Guys,
    I have o calculate no. of days as a difference between 2 dates. I can use Formula Variable to do the same. I however cant't have both the dates in my report (in rows). Hence Formula variable doesnt work.
    Any other work around guys?
    Cheeers
    Kirk
    I promise to award points for all the helpful answers.

    hi,
    fo clarification:
    is it tht u cannot keep both the dates in rows or u cannot keep both the dates in the same query.
    if 1 dates is  in rows and another in column and if the formula variable(needs to be displayed only in columns)then u have one solution...
    to use :'Cell definition'.
    for this we need 2 structures.
    Create a structure in rows with selection date1 .
    create another structure in columns with the formula variable and date2.
    then press on define celll on the top bar of query design...and type ur formula in the intersection.
    if this is not wht u want ....
    mail me a screen shot with the description.
    id:[email protected]
    reward points if it helps.
    regards,
    Dhanya.

  • Restricting a KF qty by a formula variable!

    Hello experts,
                       I have a KF -> qty... i have created qty restricted by a date called "date of last movement". 
    I need to restrict the same KF qty by today's date.
    I have a formula variable which will produce today's date.
    how do i restrict the KF qty by this formula variable?

    Hi Nimish,
    You can restrict qty by 0CALDAY as Danny explained. But this KF will always give qty for current date then why do you need restriction by "date of last movement"?
    Bhargava

  • Formula variable with replacement path on system date

    Hi Experts,
    I got a requirement to calculate "Days without payment" in report level.
    Days without payment = System Date - Payment Date.
    (Payment date field is available in CUBE, but system date field is not available in the CUBE)
    As we know, the difference b/w 2 dates is not possible directly.It can be possible by creating 2 formula variables with replacement paths on the dates and by writing aformula on these 2 formula variables.
    But the thing is I dont have system date readily available, and I tried by using SAP Exit. But we cant create formula variable replacement path on another variable (SAP EXIT).
    Do we have any SAP variable  for formula with replacement path readily avaliable to get system date (or) any other suggession.
    Please suggest me.
    Thanks,
    Sai Chand.S

    Hi Arminder,
    Thanks for your valuable answer.
    I tried doing the same previously.As u said we can get system date by creating customer exit variable.
    But the thing is to find difference b/w 2 dates, we cant do it directly, we need to create 2 formula variables with replacement path.
    1) Var1 = Formula variable with replacement path on system date(custoer exit variable).
    2) Var2 = Formula variable with replacement path on paymanet date.
    Number of days = var1 - var2.
    But as in 1st point, we cant create formula variable with replacement path on another variable, as system date is already a variable of type customer exit.
    We can create replacement paths only on characteristics.
    Please suggest me .
    Thanks,
    Sai Chand.S

  • How to create formula variable on system date.

    i want to calculate inventory age as on today. i have create formula variable on inventory creation date. i want to create <b>formula variable on system date.</b>

    simply create a formula variable and set the processing to "by user exit"
    in the user exit assign sy-datum to the variable

  • SAP Bex: How to calculate formula variable, without dragging corresponding date in the row

    Hi Experts,
    In my requirement, we should not do any changes in the BW system. I need to create a Bex query on the existing Info-set, KPI need to be calculated from the date objects.
    e.g
    Delivery date - Order date - which has been done with the formula variable in the bex, I'm getting exact value. the  problem is if I'm not dragging the Delivery date or order date in the Bex ROW, its not populating value. I'm expecting consolidated value for a month.
    It has an impact in the BOBJ system. since i'm not getting consolidated value, the number of data which is coming in BOBJ system is very huge. Hence doing calculating in the bobj will affect performance.
    Regards
    Vijaykumar

    Hi,
    i think your calculating the value form Delivery date - Order date.
    if you drag the Delivery date - Order date object to rows it will give values.
    Thanks,
    Phani.

  • Date formula variable in BEx output

    Dear All,
    In Bex , I made a formula variable F_CURDATE and used it in formula. I fill it with current date
    l_s_range-low = sy-datum.
    My value in BEx comes 201,40,604. This is 04 Jun 2014.
    Why isn't it coming in date format. I then, used data function [date]'process value as date. The output shows value X.
    How can I show  date in date format in BEx?
    Regards,
    cleo

    Hi Cleo,
    The bit l_s_range-low = sy-datum must be coming from the customer exit code, right?
    And should this code not be used for populating a cust exit variable? How do you populate sy-datum to a formula variable in the query? Pls correct me if i m missing something in your question.
    However if it is a formula variable on 0CALDAY, there are standard SAP variables giving current date.
    Can you not use them in your query as per your requirement?
    Regards,
    Srilakshmi B

  • Current date should be populated when executing the hierachy variable.

    Hi bw Pro's
    I have a customer hi-erachy.For that hierachy i created a variable.
    The variable name is hieraachy date.
    the variable will be executed with  user entry/default value.
    the characteristic i used for thata variable is date.
    Now the requirement is the date should be populated with current date when ever i executed the variable automatically
    I thk i need to develop customer exit for this. I am not so comfort with coding.
    can anybody will help me on this issue. suggest me with logic or any further idea.
    any help is appreciated .
    Thanks,
    suri

    Hi Jasprit,
    Below is the erro when i added the code and i restrict the customer exit variable.
    ERRORS:
    INCORRECT FORMAT WITH KEY DATE FOR ELEMENT "43Z6K6807CL51WZ025Q1GPHER"(VALUE "&&" IS INVALID).
    Below is the diagnosis for the error.
    You are using a key date specification in the query. This can be either in the query key date directly or in the key date for a selection or presentation hierarchy. the element, in which this error was found, is called "43Z6KGHDHHJ5VYWJU8UEVBRRK". The invalid value is called "&&".
    System response
    The problem is reported with the check.
    Procedure
    Check the incorrect format in the specified element and correct it.
    Technical name (UID) of the element: "43Z6KGHDHHJ5VYWJU8UEVBRRK".
    I am checking the UID in rsa1> transprot connection>query element-->variable.But system is not showing any UID. Any idead on the above issue.
    Can you please help me in this.
    thanks
    suri

  • Date formula variable with replacement path.

    Hi ,
    I have date formula variable with replacement path.
    Variable pop up with date format yyyymmdd. but i want dd.mm.yyyy.
    I have checked my user profile setting and it is dd.mm.yyyy.
    Can u please suggest it .
    Thanks
    Pramod

    Thanks for the rely , but basically i need a variable only for selection.
    thats why i have created formula variable processing my cutomer exit.
    But i think customre exit variable comes with text format .
    any1 has an idea for the same.
    Thanks
    Babu

  • Date Difference between to date formula variable

    Hi Expert,
                    I have create two formula variable one for Document Date and another one for Goods reciept date
    and through formula variable I am subtracting these two formula variable and getting the no. of days between
    document date and GR date.
    This Shows me the correct value for one document date because i am filtering my query according to document
    date,
    while i am giving the date range for document date is shows me incorrect result. bucause document date formula
    variable contains only one date.
    Eg. i am giving the document date range like 01.02.2010 - 28.02.2010.
          In document date formula variable it contains only 01.02..2010 and GR date formula variable it contain correct
    value, thats why the date difference is incorrect because those PO which has PO date like 12.02.2010 for that Doc
    formula variable bring the same date like 01.02.2010.
    Please tell me the solution
    Thanks and Regards
    Lalit Kumar

    Hi Expert,
                     Actually i have created two formula variable on for PO date and another for GR date
    and i've restrict the query through PO date.
    while i am taking the single PO date in Selection parameter it showing me correct difference
    eg: Selection Parameter for PO: 01.01.2010
    But while i am taking the date interval for PO date
    eg: 01.01.2010-30.01.2010
    PO No: XXXXX123 , Doc date: 01.01.2010 GR date: 7.01.2010 then date difference is : 6
    PO No: XXXXX432, Doc date: 03.01.2010 GR date: 8.01.2010 then date difference is : 7 but it is 5
    Thanks and Regards
    Lalit Kumar

  • How to assign current date/time to a formula variable in Query Designer

    How do I assign the current date to a formula variable in Query Designer? I need to use current data in a calculation and just need the date the report was run.
    Thanks

    Hi Philip,
    There is an SAP formula variable to supply the current date in a formula. I think it is 0F_ADAY...install it from business content if you cannot see it in the query designer (formula box, under formula variables) and try using it.
    Hope this helps...

Maybe you are looking for

  • Error trying to use multiple lines from a PO in a Goods Receipt PO

    I get the following error when I try to add 2 lines from a PO to a single Goods Receipt PO (code below): -5002 One of the base documents has already been closed  [PDN1.BaseEntry][line: 1] I can create the Goods Receipt PO if I use 1 line or lines fro

  • Enhancing 2LIS_02_SCL

    Hi SDN, I have enhanced 2LIS_02_SCL with EKKO-AEDAT field. Steps I have done: 1. Since EKKO is a base table for 2LIS_02_SCL  extractor, I have added AEDAT as is directly(with out ZZ  append to the field) to the MC02M_1SCL communication structure as a

  • Dynamic select list as APEX plug-in custom attribute?

    I'm developing a region plug-in in APEX 4.0.1. I wanted to make one of the custom attributes a select list where the options offered were the current application list templates (queried from the <tt>apex_application_temp_list</tt> view: the rendered

  • A  FI document has been archived can it be reversed through FB08

    A  FI document has been archived can it be reversed through FB08. I am not talking of Unarchiving.

  • Iphone is disabled and asking for passcode.

    My sister-in-law received a new iPhone 3GS from a co-worker who already had one. She gave it to me. It has never been activated or anything. The message on the screen says, "iPhone is disabled. Try again in 22,168,144 minutes".... WHAT? It will only