Getting sysdate in a variable

hi,
how can i get the current sysdate in a repository variable so that i can use that variable in answers and filter my data according to that..
Thanks

copter,
that should be pretty easy.
If back end database is Oracle use SELECT SYSDATE FROM DUAL in your initilization block and populate the result to a variable (repository).
If back end datavbase is SQL Server use SELECT GETDATE() in your initilization block and populate the result to a variable (repository).
or google for repository variables, you will find tons of info.
mark answers promptly
J
-bifacts
http://www.obinotes.com

Similar Messages

  • Stupid question: getting sysdate into repository variable (11g)

    Hi, I'm having a complete brain fade and can't figure out how to select current sysdate into a dynamic repository variable. I've done the following:
    1. Created init block
    2. Set data source to the connection pool from one of my Oracle databases
    3. Set the default database string to "select trunc(sysdate) from dual"
    4. Created a dynamic variable STP_TODAY with default initializer of DATE '1900-01-01'
    5. Check in and save the RPD
    When I go into answers, I can see the variable, but it's always getting the 1900-01-01 date. Obviously I'm doing something dumb - can someone help?
    Thanks!
    Scott

    This is related to presentation server Cache.
    Bypass the Presentation server Cache with the following steps:
    1. In Answers go to Advanced tab and select the "Bypass Oracle BI Presentation Services Cache" box for the report.
    2. At the lower end of the page, you have a box name "prefix", add the below text in it,
    "SET VARIABLE DISABLE_CACHE_HIT=1;"
    3. Save the report.
    Check now, this hopefully should help..
    Regards,
    Kiran

  • Trying to get sysdate- 2yrs and sysdate+2yrs value into variable

    Hi,
    iam Trying to get sysdate- 2yrs and sysdate+2yrs value into variable.But facing the following issue. Please help me out .
    Error :
    p_start_date := select add_months(max(sysdate), -24) from dual;
    ERROR at line 6:
    ORA-06550: line 6, column 25:
    PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
    ( - + case mod new not null <an identifier>
    <a double-quoted delimited-identifier> <a bind variable>
    continue avg count current exists max min prior sql stddev
    sum variance execute forall merge time timestamp interval
    date <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    <an alternatively-quoted string literal with character set specification>
    <an alternat
    ORA-06550: line 7, column 3:
    PLS-00103: Encountered the symbol "P_END_DATE"
    Code
    declare
    p_start_date date;
    p_end_date date;
    begin
    select add_months(max(sysdate),-24) into p_start_date from dual;
    dbms_output.put_line('p_start_date' |p_start_date);
    dbms_output.put_line('p_end_date' | p_end_date);
    end;

    Hi, try:
    SQL> declare
      2 
      3  p_start_date date;
      4  p_end_date date;
      5 
      6  begin
      7 
      8  select add_months(sysdate,-24) into p_start_date from dual;
      9  select add_months(sysdate, 24) into p_end_date from dual;
    10 
    11  dbms_output.put_line('p_start_date: ' ||to_char(p_start_date, 'dd-mm-yyyy hh24:mi:ss'));
    12  dbms_output.put_line('p_end_date: '   ||to_char(p_end_date, 'dd-mm-yyyy hh24:mi:ss'));
    13  end;
    14  /
    p_start_date: 14-04-2007 17:41:34
    p_end_date: 14-04-2011 17:41:34
    PL/SQL procedure successfully completed.

  • Not getting values in the variable

    Hi experts,
    in  this program  
    i want VBPA-vbeln = xblnr....but there is a data length error. so I ahve declare one variavble of length 10. & i am moving this xblnr to this variable but not getting value in that variable that i am moving..& give me the possible solutions...
    when '0FI_AR_4'.
             data: t_DTFIAR_3 like DTFIAR_3 occurs 0 WITH HEADER LINE.
              data: BEGIN OF t_DTFIAR_3 occurs 0.
                      include structure DTFIAR_3.
              data:        xblnr1(10).
              data: END OF t_DTFIAR_3.
              data : BEGIN OF t_partner occurs 0,
                         VBELN like vbpa-VBELN,
                         parvw like vbpa-PARVW,
                         kunnr like vbpa-kunnr,
                     END OF t_partner.
            data : xblnr1(10).
    t_DTFIAR_3[] = C_T_DATA[].
      move t_DTFIAR_3-xblnr to t_DTFIAR_3-xblnr.
                select VBELN PARVW kunnr
                       into table t_patner
                       from vbpa
                       FOR ALL ENTRIES IN t_DTFIAR_3
                       where VBELN = t_DTFIAR_3-xblnr.
    SORT t_partner BY VBELN PARVW.
              loop at t_DTFIAR_3.
                 loop at t_partner where VBELN = t_DTFIAR_3-xblnr1.
                       if t_partner-PARVW = 'ZA'.
                           t_DTFIAR_3-YPARVW1 = t_partner-PARVW.
                           t_DTFIAR_3-YPART1 = t_partner-kuNNR.
                       elseif t_partner-PARVW = 'ZR'.
                           t_DTFIAR_3-YPARVW2 = t_partner-PARVW.
                           t_DTFIAR_3-YPART2 = t_partner-kuNNR.
                       ELSEif t_partner-PARVW = 'ZE'.
                           t_DTFIAR_3-YPARVW3 = t_partner-PARVW.
                           t_DTFIAR_3-YPART3 = t_partner-kuNNR.
                       ELSEif t_partner-PARVW = 'ZS'.
                           t_DTFIAR_3-YPARVW4 = t_partner-PARVW.
                           t_DTFIAR_3-YPART4 = t_partner-kuNNR.
                       ENDIF.
                       MODIFY t_DTFIAR_3.
                endloop.
              ENDLOOP.
              C_T_DATA[] = t_DTFIAR_3[] .
    Thanks in advance

    HI,
    While moving use the WRITE TO option.
    WRITE VBPA-vbeln TO xblnr.
    Regards
    Sudheer

  • Getting a bad bind variable error while compiling a custom form in R12

    Hi,
    I am getting a bad bind variable error while compiling a custom form.
    I tried setting the forms_path variable and I am still getting the error. Can anyone please suggest what can be done?
    DECLARE
    BEGIN
    IF :parameter.p_line_ship_to = 'T'
    THEN
    IF :SYSTEM.cursor_item = 'LINE.SHIP_TO'
    THEN
    :parameter.lov_num_param1 := :line.ship_to_customer_id;
    oe_lines.ship_to ('WHEN-VALIDATE-ITEM');
    :parameter.lov_num_param1 := :line.ship_to_customer_id;
    END IF;
    :parameter.p_line_ship_to := 'F';
    END IF;
    END;
    I am getting this error:
    Bad bind variable 'parameter.p_line_ship_to'

    The Parameter is not defined in the form.. But, this form is already been compiled and deployed.. I have to make some changes to the form and tried to compile it, when i am getting this error. Is it possible that the parameter would be defined in some other form or can this error be due to some other reasons?
    Thanks in Advance.

  • How to get data type of variable in program..

    Hi ABAP Guru.
    I need to know how to get data type of variable or any structure field.. because I got short dump when use command REPLACE ALL OCCURANCE ... with variable/structure field that has data type I or P, I think it should be used with data type CHAR only, So I need to check the data type first.
    Please give me your advice
    Thank you all.
    Nattapash C.

    data : v_value type i,
             v_char(10) type c.
    v_value = 10.
    move v_value to v_char.
    REPLACE ALL OCCURRENCES of '#' from v_char....
    Best regards,
    Prashant

  • How to get file count in variable?

    dear all,
    how to get file count in variable?
    regards
    Naseer

    Hi Nazeer ,
    It wont take much time .. so simple :- )
    Create one os comand step
    ( for unix) Use
    wc -l filename.txt > someoutputfile.txt
    Now the number of lines in your file will be there in the output file ( someoutputfile.txt )
    Step2 :-
    Now use Cezar's logic to fetch the variable value ( file count ) from the output file .. ( select value for a variable from a file )
    This will not take eeven a second to finish the job.
    Regards,
    Rathish A M

  • Getting error after putting variable in select statement

    Hi All,
    Kindly help me with Pl/sql code
    here i'm trying to put variable in select statement ....
    I successfully put the Yr and Mnth ..but getting error for loop variable "i"
    Here i'm getting error that too because of " i" only-->TRIM(UPPER(TO_CHAR(TO_DATE(i||'-'||Mnth||'-'||Yr,'dd-Mon-YYYY'),'DAY')))
    Please find the full code below.
    Declare
    Yr number not null:=2010;
    Mnth varchar2(20) not null:='Jun';
    v_val number:=0;
    begin
    for i in 1..2 loop
    case i
    SELECT count(*) into v_val
    FROM DUAL
    WHERE TRIM(UPPER(TO_CHAR(TO_DATE(i||'-'||Mnth||'-'||Yr,'dd-Mon-YYYY'),'DAY')))
    in (UPPER('Monday'),UPPER('Tuesday'),UPPER('WEDNESDAY'),UPPER('THURSDAY'),UPPER('friday'))
    end case;
    end loop;
    end;

    Declare
      Yr number not null:=2010;
      Mnth varchar2(20) not null:='Jun';
      v_val number:=0;
    begin
      for i in 1..2 loop
      SELECT count(*) into v_val
      FROM DUAL
      WHERE TRIM(UPPER(TO_CHAR(TO_DATE(i||'-'||Mnth||'-'||Yr,'dd-Mon-YYYY'),'DAY')))
      in (UPPER('Monday'),UPPER('Tuesday'),UPPER('WEDNESDAY'),UPPER('THURSDAY'),UPPER('friday'));
    end loop;
    end;

  • Is it possible to get the value of variable through answers page ?

    Hi all,
    I had Dynamic variable ETLRundate . I want use this variable in Answers page to see the out put ?
    Is it possible to get the value of variable through answers page ?if so how I can use ?

    Hi
    Use the link below and download the documentation
    http://www.oracle.com/technology/documentation/bi_ee.html
    I think you will find what you are looking for in the Answers, Delivers, and Interactive Dashboards User Guide, but in short the syntax to display a variable value is as follows:
    As shown above the syntax for using a presentation variable is:
    @{variablename}{defaultvalue}
    For Session variables use:
    @{biServer.variables['NQ_SESSION.variablename']}
    For repository variables use:
    @{biServer.variables['variablename']}
    Rgds
    Ed

  • Getting the value of variable indirectly

    Hi all,
    I want to get a value of variable which is contained in another variable
    for example :-
    data  lc_table1 type string value 'ZTABLE'.
         CONCATENATE 'lc_table'  '1'  INTO lv_tablename.
         lv_estructura ?= cl_abap_typedescr=>describe_by_name( lv_tablename ).
          lt_ls_components = lv_estructura->components.
    In the above value of lv_tablename = lc_table1.
    i want to get a value of lc_table1 , that is ZTABLE ,,can any one please help me to get this
    thanks
    Avinash DM

    Hi Avinash,
    If I have understood your requirement correctly, you need to pass the value of lc_table1 to cl_abap_typedescr=>describe_by_name.
    You can do it like this:
    data  lc_table1 type string value 'ZTABLE'.
    FIELD-SYMBOLS: <fs> TYPE any.
    CONCATENATE 'lc_table'  '1'  INTO lv_tablename.
    ASSIGN (lv_tablename) to <fs>.
    r_descr ?= cl_abap_typedescr=>describe_by_name( <fs> )
    Please let me know if this helps.
    Thanks & Regards,
    Surmeet

  • Get all the local variables

    Hi,
       I found several API calls to get/set the local variables, if i know the name of the variable. However, if i want to get the list of variables from locals, parameters etc., how should i be able to get this from "ThisContext".
    Thanks,
    Regards,
    Aparna

    Hi,
    This example may help
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=BCB5C685D37F104AE034080020E74861&p_...
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Creating Variable with Replacement Path to get value from ANOTHER Variable

    Hi all,
        Is anyone has created the Variable with Replacement Path to get the value from another User Entry Variable, PLEASE ? 
    First created the User Entry Variable (ZV_X) and it accepts the date range like '01/01/2009 - 01/31/2009'. Next created the Characteristic variable (ZV_Y) of Replacement Path for which source variable will be ZV_X and we should get the 'FROM Date' (01/01/2009) from the selection (ZV_X) into it (ZV_Y).
    While creating the Characteristic variable (ZV_Y) of Replacement Path, I didn't find my newly created ZV_X variable in the list of available variables under 'Variable' header in 'Replacement Path' tab and it is causing the error 'Source to replace variable ZV_Y is not defined'. How could I create the Characteristic variable of Replacement Path for my requirement, PLEASE ?
    The following is from help.sap..com:
    Replace with Characteristic Value
    Text and formula variables with the processing type Replacement Path can be replaced with a corresponding characteristic value. In the variable editor, on the General tab page, you specify under Reference Characteristic the characteristic that is to be referenced by the replacement. On the Replacement Path tab page, you can choose whether the variable is replaced with the From or the To Value and with the Key or the Name of the characteristic value. You can also specify the Offset Start and Offset Length for the output.
    Replace with Variable
    Characteristic value variables, hierarchy variables, text variables, and formula variables with the Replacement Path processing type can take their values from a different variable.
    The following prerequisites need to be fulfilled:
    Variable
    ●      The variable must not be input-ready
    ●      The variable must represent a single value
    Source Variable
    ●      The source variable must not be a hierarchy node variable
    ●      The source variable must be input-ready
    ●      The source variable must be available in the query
    ●      The source variable must represent a single value or an interval
    In the variable editor, on the Replacement Path tab page, you specify the source variable from which the value is to be determined. The value is either determined from the key, the external attribute of the key, the description, or the attribute value. You can specify an Offset Start and an Offset Length for the output here. The variable is replaced on the variable screen upon each data release.
    Thanks,
    Venkat.

    Hi Eve,
    It is possible to connect the 2 queries using a Replacement Path characteristic variable. You would need to create the variable on the char whose values you want to pass from Q1 to Q2. The variable will be of type replacement path and you will need to enter the name of Q1 from which it will get the values. Make sure that you include this char in the query definition of Q1 and Q2. In Q2 you will restrict the characteristic using this variable. DO not use this variable (replacement path) in Q1.
    In your query properties check if you have turned on the checkmark for Release for OLE DB for OLAP (3rd tab). If the check mark is there, then remove it.
    We are using the scenario in a couple of places, and it works very well.
    Hope this helps...

  • Not able to get the data from variables contained in more than 1 mxml file

    I have got 5 Bindable Public integer variables in total in 5 mxml files (Pages). Each variable is assigned it's value in a Public function in each of the mxml files.
    What I need to do is add up the values of the 5 variables. The way I approached this was to create a public function add5Variable in my main mxml file (Page1) as shown below.
    [Bindable]
    public var varTotal:int = 0;
    public  
    varTotal = (variableP1 +
    Page2.variableP2 + Page3.variableP3 + Page4.variableP4 + Page5.variableP5);
    return(varTotal);
    I have got a TextInput field on Page5 where I display the varTotal. The function add5Variable is called when moving from Page to Page.
    The results I am getting is that the varTotal will always be the value of variableP1. When I tried some debugging in Flex Builder it showed me that the other 4 variables had a value of 0.
    Why is this the case and do you have any suggestions on how I can get the correct total for varTotal?
    Thanks
    function add5Variable():int {

    The code below looks correct. Is that the expected behavior of your app?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
    <![CDATA[
    public var ValueP2:Number = 0;
    private var grossValue:Number = 0;
    private var totalValue:Number = 0;
    private var finalTotalP2:int = 0;
    public function test():void {
    if (Number(TextInput2.text) == 1 || Number(TextInput2.text) == 2)
    ValueP2 = 1;
    totalValue = grossValue + ValueP2;
    else if (Number(TextInput2.text) == 3 || Number(TextInput2.text) == 4) {
    ValueP2 = 5;
    totalValue = grossValue + ValueP2;
    else if (Number(TextInput2.text) == 5 || Number(TextInput2.text) == 6) {
    ValueP2 = 9;
    totalValue = grossValue + ValueP2;
    trace("totalValue "+totalValue);
    finalValueP2(totalValue);
    public function finalValueP2(tVP2:int):int {
    var tallyP2:int = 0;
    if (tVP2 < 3)tallyP2 = 1;
    if (tVP2 >= 3 && tVP2 <5)tallyP2 = 2;
    if (tVP2 >= 5 && tVP2 <10)tallyP2 = 3;
    finalTotalP2 = tallyP2 * 7;
    trace("finalTotalP2 " +finalTotalP2);
    return(finalTotalP2);
    ]]>
    </mx:Script>
    <mx:TextInput id="TextInput2" enter="test()"/>
    </mx:Application>

  • How to get New Window without Variable Entry screen from one Web Template?

    Hi Experts,
    I've a WebTemplate contains 2 Graphs. Each graph have one Zoom Button. My requirement is, When I click the Zoom button that corresponding Grpah should display in a New Window. I've finished all the above requirements.
    Since, I have One Mandatory field, I'm always getting the Variable Screen in a New Window while I clik the Zoom Button.
    I need to avoid this "Rerun" feature in New Window.
    Kindly suggest me how to achieve this..
    Full points will be given.
    Thanks
    Jay Jay

    Hi Thanks.
    Even I'm also trying for the same scenario only.
    Actually I have 2 Web Templates.
    In First Template I have 2 Charts and 2 Zoom buttons for each.
    While I running the 1 Template, i give an Value in the  Variable screen of First Web Template.
    If I click a Zoom button of 1st Chart, It should open a New window with the Second Web Template. And Second Web Template should automatically take a First Template's Variable screen Values.
    (Since, U have an Mandatory field in Second Template u were not faced this requirment.)
    Even I tried with "TRANSFER_STATE". It is not taking the First Variable Screen's input values.
    Kindly help me in this issue.
    Thanks in advance.

  • Getting all the members (variables, methods AND method bodies) of a java source file

    For a project I want to programmatically get access to the members of java source file (member variables, methods etc) as well as to the source code of those members. My question is what is the best method for this? So far I have found the following methods:
    Use AST's provided by the Java Source API and Java Tree API, as discussed in the following posts:
    http://today.java.net/pub/a/today/2008/04/10/source-code-analysis-using-java-6-compiler-apis.html
    http://weblogs.java.net/blog/timboudreau/archive/2008/02/see_java_code_t.html
    http://netbeans.dzone.com/announcements/new-class-visualization-module
    This has the disadvantage that the classes actually have to be compilable. When I look at the Netbeans Navigator view however, it provides me with a nicely formatted UI list, regardless of the "compilable" state of the class.
    Thus I started looking at how to do this... The answer appears to be through the use of tools such as JavaCC: https://javacc.dev.java.net/
    ANTLR: http://www.antlr.org/
    which are lexers and parsers of source code. However, since the Navigator panel already does this, couldn't I use part of this code to get me the list of variables and methods in a source file? Does the Navigator API help in this regard?
    Another route seems to be through tools such as
    BeautyJ: http://beautyj.berlios.de/
    which run on top of JavaCC if I am correct, and which has the ability to provide a clean view on your java code (or an XML view). However, BeautyJ does not seem to be too actively developed, and is only j2se1.4 compatible.
    I hope someone can shed a light on the best way to go about what I want to achieve. Somebody already doing this?
    (I crossposted on the Netbeans forums too, hope this is OK...)

    I'm currently developing a LaTeX editor(MDI) and I do the same thing, but I don't know what exactly do you need.

Maybe you are looking for