Dynamic Default value of variable in query

Hi,
I would like to set current date as default value (e.g. system date 'SY-DATE') for a variable on selection screen in query. How to do that?
Thanks,
Helen

Hi helen,
   Check this doc : <a href="http://sapbwneelam.blogspot.com/2007/10/how-to-create-populate-user-exit.html">How to... Create & Populate User Exit variable</a>
Hope it Helps
Srini

Similar Messages

  • Default value for variable are not within permitted value range (precalc)

    Hello BW community
    Issue:
    I have created a variable (Characteristic Value/ Manual input-default value) and use the precalculated value set (details-basic settings). In the further variable definition I could select the  precalculated value set in 'Default values', which I have defined beforehand in the broadcaster..
    The precalculated value set in the broadcaster settings is just based on a master data query on 0CUSTOMER.
    Error:
    The variable gets the error E991/R9E Errors: Default values for variable 'XXX' are not within permitted value range.
    The detail description of the error is: You defined default values for variable 'Sold-to party precalc value set for manuel input' that are not appropriate for the variable type; for example, a range is defined as a default value for a variable that only permits a single value.
    So please has someone had the same issue and found out how to solve it? It would be excelent to get good solution for this issue.
    Best regards and thanks
    Christian
    PS-1: System BW 701 / SAPKW70105
    PS-2 : there has been a SDN entry with the same topic but not resolved too.
    link: /thread/980839 [original link is broken]

    Hello,
    Thanks for your response.
    I should have mentioned that in my post. I tried this very first time. I thought that this is the place where you provide default value. But I got following exception at that time, so I thought, may be this is used for something else.
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6
    javax.faces.FacesException: javax.servlet.ServletException: OracleJSP error:
    oracle.jbo.NameClashException: JBO-25001: Object viewAllInd of type Control Binding Definition already exists.
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:415)Do I need handle something else when you put the default value?
    Thanks,
    Jai

  • How to retrieve dynamic filter value submitted from control query to .....

    How to retrieve dynamic filter value submitted from control query to broadcast query.....
    I'm trying to change the hierarchy version determined by a userexit variable in the broadcast query.
    The Hierarchy Version should be dependent on the input filter delivered by the bursting query.
    But how do I catch the dynamic filter value which has been submitted by the bursting query,
    with other words:  where does the bursting query store it's out put while sequentially starting the broadcast query value by value?
    BTW: the filter value from the bursting query appears under "dynamic filter values" in the information of the broadcast query...
    Any thoughts are welcome!
    Edited by: Heinrich Krupp on Jun 24, 2009 1:25 PM

    Further information,
    Report is used via webi only, not Xcelsius or Dashboard.
    Report is consuming BI Web Services.
    Although we can pass in prompt values to BI Services, I couldn't find if we could pass a variable or dimension object into this field. Anyone knows?

  • Prompts with dynamic default values

    I have a request from my client to modify several reports so that two date prompts will have default values populated with the first and last day of the previous month.  All of the reports are currently using custom sql so I have to be able get the dynamic default value in the extended @prompt syntax.  However, I am not able to use any of the sql functions since the functions merely appear as plain text as the default value itself. 
    I have found a few work arounds to achieve the functionality of the dynamic prompts, but I cannot get the actual default value displayed to the user to be dynamic.  Is it possible to achieve this by using only the custom sql?

    Hi Sandeep ,
    Below blog may answer your query .
    Dave&amp;#8217;s Adventures in Business Intelligence &amp;raquo; Dynamic Dates Part III: Monthly Date Ranges
    Search for And for Last Month?

  • Is it possible to display default values in input ready query.

    Hi Guys,
    Is it possible to display default values in input ready query.

    HI,
    Select the particular Variable.....in the right hand side u will find the default values tab....in that u can give the values...and save...if u run the query then it will show the default values for that Variable.selection....
    Thanks/Tarak

  • How to use default values of variables when data get varied

    Hi Expert,
    I want to use default value of variables var1.
    for eg. if variable length is 20 char and value is abc , then i want to fill var1 by default 20 ( after printing abc value remaining length i.e.17 should be taken by var1 means total length 20 should be occupy by var1.)
    plz reply
    Regards,
    Jyotsna

    Hello Jyotsna,
    I dont really understand the example you have quoted. Can you elaborate your example?
    Vikranth

  • Default value for variable

    Hello Experts,
    I have created a report which containts variable 0P_FPER ( Period/Fiscal year,single entery required). Now, the requirement is to get completed fiscal year/month(current month-1)  by default in the input box of variable entry whenever I execute the query.
    Assigning default values option is not giving me the list of variables to assign for default value.
    How can I achieve this?
    Regards,
    Nirav Shah
    Edited by: Nirav Shah on Aug 6, 2008 8:19 AM

    How to Create a u201CCustomer Exitu201D Date Variable.
    Custom date variables greatly enhance BEx Reporting.
    Letu2019s assume you have an InfoProvider with a characteristic 0CALDAY (Calendar Day) and you want to restrict results of your query to u201Ccurrent month to dateu201D.
    Scenario:
    1. Start by creating a variable for the 0CALDAY InfoObject.
    2. Assign u201CProcessing byu201D type u201CCustomer Exitu201D, u201CVariable Representsu201D to u201CIntervalu201D and u201CVariable Entryu201D to u201CMandatoryu201D. Select u201CReady for Inputu201D checkbox if you want a request window for your variable to be presented at runtime (interval values will be filled from your Customer-Exit but a user can still change them).
    3. Go to transaction CMOD to create a project for your enhancement (see ref.2). Give a name to the project (1), create (2) and save the project. Then assign an enhancement RSR00001 to your project and
    save. (In this step an error message u201CSAP enhancement RSR00001 already belongs to project NAMEu201D may appear. That means an active project with the enhancement RSR00001 already exists. If this is the case, you do not need to create your own project and may terminate this step and go to the step 4). Activate the project.
    4. Go to a transaction SE80, display a Function Group XRSR (1,2), open Function Modules (3) and double click on an EXIT_SAPLRRS0_001 (4). A source code for the EXIT_SAPLRRS0_001 function module opens. Double click on a word ZXRSRU01. You arrive to a source code for the Include ZXRSRU01.
    5. In the source code for Include ZXRSRU01 insert your code (see sample code below). If some code like DATA: L_S_RANGE TYPE RSR_S_RANGESID. u2026 u2026 u2026 u2026 u2026 u2026 ENDCASE. Already exists in the Include just insert the part of the sample code from the first comment to the last at the end of the existing code but above the ENDCASE statement. Check and Activate.
    Code Example:
    DATA: L_S_RANGE TYPE RSR_S_RANGESID.
    Current month to date variable ZCMTD example.
    WHEN 'ZCMTD'.
    you variable name
    data: ZCMTD_LOW like sy-datum.
    *defining variable for using as a starting date of the interval
    ZCMTD_LOW = sy-datum. 
    *initializing it with the current date
    ZCMTD_LOW+6(2) = '01'.
    *replacing last two symbols (day) in the current date with '01'(see ref.1)
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = ZCMTD_LOW.
    *initializing low interval limit
    L_S_RANGE-HIGH = SY-DATUM.
    *initializing high interval limit
    L_S_RANGE-SIGN = 'I'.
    *defining interval as inclusive
    L_S_RANGE-OPT = 'BT'.
    APPEND L_S_RANGE TO E_T_RANGE.
    Current month to date variable ZCMTD example end.
    ENDCASE.
    The result of this will be an interval from the first day of the current month till the current system date.
    Acknowledgements and more info:
    Thanks go to Dirk Herzog and Roberto Negro for their valuable posts on forum regarding Customer-Exit variables.
    References:
    ref.1 Processing Sections of Strings
    ref.2 Customer Exits
    ref.3 Date for Several Months topic on BW Forum

  • How to get value in variable from query in PLD / ALD

    Hi, everyone,
    I want to retrieve value from database via query in PLD/ALD variable on basic of PLD / ALD variable's content. is it possible ?

    Hi
    Try this,
    ->> Open the GRPO document.
    ->> Click the Tools on menu bar and Open the Form Setting widnow.
    ->> put the tick mark in BaseRef, BaseDoc, TrgetDoc
    i think, Base Document no field default in SAP B1.
    try to search the Base doc. Date in row level on GRPO document.
    Try to Create UDF & FMS then assign the FMS in UDF
    SELECT Distinct T1.DocDate
    FROM PDN1 T0 INNER JOIN POR1 T1
             ON T0.BaseEntry=T1.DocEntry
    WHERE
    T1.[DocNum]=$[PDN1.BaseRef]
    OR
    SELECT Distinct T1.DocDate
    FROM PDN1 T0 INNER JOIN POR1 T1
             ON T0.BaseEntry=T1.DocEntry and
                T0.BaseLine=T1.LineNum and T0.BaseType=22
    WHERE T0.[BaseType] =22
       and T1.[DocNum]=$[PDN1.BaseRef]
    IF you more details, Check the below thread.
    Re: How to store the invoice number in the head of the related delivery ?
    Regards,
    Madhan.
    Edited by: Madhan Babu C on Dec 11, 2009 6:57 AM

  • Dynamic default values in parameters

    Hello,
    anyone knows if it's possible to set dynamic values as default values for parameters in portal?
    i am specially interested in the use the date we are in to pass it to a discoverer worksheet (month or year) via single parameter form or any other porlet that could perform it.
    Many thanks.
    Regards,
    Daniel
    PS
    Is the second thread i create with this question cause i didnt receive any answer before and i am really interested in any solution or knowing that i cant perform it.

    no one have ever used a date parameter (for example, month) that need a default value, and set this default value as the month we are today?
    maybe i didnt explain my problem properly before...
    thanks for any help, i really need this because all the porlets in the portal i am creating are discoverer's reports that presented by month, year or day.
    regards,
    daniel

  • Set default value based on sql query?

    Hi,
    is it possible to set default value of an BC entity attribute by using sql expression?
    Eg. "select max(x)+1 from y where userid=?"
    Rgs
    Jernej

    Jernej,
    Yes, you can do this. Edit your entity object attribute, and in the Edit Attribute dialog select "Derived from SQL Expression". Then you can enter your expression in the Expression text box.
    Blaise

  • Dynamic default value on SREQ area

    Hi everybody,
    I would like to set default value for one field on search screen,
    however not fixed value (what I can do in field group of the area),
    but dependent on some condition.
    Where should I put my code?
    regards,
    Przemek

    Hi,
    Default values are the ones that appear when the screen loads. So what kind of condition can you check when the screen loads. Incase of any events driven out of navigation then we can set some values.
    Could you make the requirement a little more clear.
    Regards,
    Hemanth

  • Dynamic default value to dateTime filter

    Hi,
    In my report I want to show data with *"datetime>4 AM today to datetime<current datetime"*. How to set the default value of a datetime filter to 4AM of the current day?
    Thanks
    Edited by: SOADreams on Sep 22, 2011 12:43 PM

    Hi
    You could try the following:
    Create a calculated field to determine if the Hour is 4AM or greater -- use the timefunctions and set the value to 1 for fields that satisfy the criteria using If then Else
    Set the filter to Current Day and then also where the calculated field is 1
    I think this will provide you the right set of records.
    Regards
    Payal

  • XControl dynamic default value

    Hello,
    Do you know how to make a XControl give a numeric value like Tick Count (ms) ? I think that is not that obvious. Tick Count is typically a node which value changes at every moment based on external parameters.
    See the attached example. When a VI containing the XControl is "Run when opened" then the returned value is always zero, instead of Tick Count. This is related to the default value of the XControl data extracted on the Block Diagram before the Facade VI is called. Note that I need to use a XControl for other reasons, not a SubVI for instance or else.
    Does anywone know how overcome this zero systematic value (still using a XControl) ?
    Best regards
    LabView 8.6 - Windows XP SP2
    Attachments:
    XControl.TickCount.zip ‏39 KB

    MaximeR wrote:
    Hello,
    You can
    remark that when the VI was load one time and that you don't close LabVIEW, you
    can reduce the delay because the Xcontrol is already in memory. But you need to
    keep a delay due to the redrawing of the Xcontrol. When you use a lot of
    Xcontrol or a big one, it's better to preload the xcontrol before using it to
    reduce the launch time.
    Best regards.
    OK enlighten me, how to do such a thing for an executable. Why can't the owning VI wait on the XControls?
    Ton
    PS if you are  into debugging XControls contact NI Netherlands for the code on SRQ  682340
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Default values for variable in a report not possible

    Dear Experts,
    I have desinged a query which is having a variable for Fiscal Period and that is mandatory.
    Again in my key figures i have restriced  a key figure with this variable and offseted it for previous year and also few more offsettings have been done to dervive month wise trend.
    The problem is that
    I want the report to run without the variable being popup so that it will run for current month by default and then after the report is being run, i want to give a dropdown box where user can select the value.
    i tried to do it in web template initial report is runing fine but i am unable to change the values after that.
    any suggestions.
    Regards
    Neel

    Hello,
    Use a Exit variable with optional settings for user entry which can return the current month. So the user will not be prompted and you have to use the I_STEP = 1 (before user input to achieve this)
    In the Web report, use a drop down box and assing the InfoObject 0CALMONTH or as per your requirement
    Choose the affected dataprovider in the Property window of the Drop down.
    Thanks
    Chandran

  • Setting dynamic default values in a list/menu

    To save problems with inserting dates into a Mysql database, I have split the input fields on the file insert form into three drop down lists containing the day, month and year.
    In order to make it easy for users, I wish to take the current date, split it into day (dd) month (mm) and year (yyyy), and use one of these values as the default option for each of the three fields.
    In html you would use :
    <option value="2012" selected>2012</option> for the default, but this is a fixed default.
    I want it to change depending on the actual year., so that if today is 21-02-2012, (thats how we use dates in the UK)  the three fields default to 21 (dd) 02 (mm)  2012 (yyyy).
    I can re-format them into MySql date format mmddyyyy no problem later to insert them into the database
    Any ideas?
    Or is there a better way to do this?

    <option value="2012" <?php if (date('Y') == '2012') echo 'selected'; ?>>2012</option>
    The above solution works well for that item.
    I now have another one which may help others.
    I populate a drop down list with the values 1 to 12, with the default being set to 6 and insert a record.
    This represents the number of months that the record will be displayed until it is deleted.
    When I pull the record back from the database to update it, I need to show the current value of the field, which is stored in $row_eventset['event_expiry'] ready for it to be updated.
    Code as follows:
    <select name="event_expiry" size="1" tabindex="5" title="select from the list">
    <?php for ($i = 1; $i <= 12; $i++) { // loop through the months
              echo "<option value= '$i' " ;
          if ($i == $row_eventset['event_expiry']) {                               //check if this is the same as the record being edited
           echo 'selected="selected" ' ;                                                 // if so select it
                echo ">$i</option <br>";                                                  // the <br> is essential in a browser, though it works without it in live view.
    ?>
    </select>
    I hope that it saves someone some time.
    When I first tried this, it worked fine in live view. However in a browser, all the months appeared on the same line. I had to insert the <br> command to make it work properly.

Maybe you are looking for