Variable for Query

Hai Gurus,
I have a report which gives all the requisitions with differrent status in the report based on Req. start date.
In addition to this i got a requirement in the same report where user can enter date interval..
Based on the user date interval it should populate the req's in the report only with Status ="OPEN".
My question is can we restrict this status in the Customer Exit.
If possible how can we achieve that..
Please let me know if you need any further details..
Thanks & Regards,
VJ

Hi,
If I got you correctly, you have a report which gives PRs based on user entered Required start date. Now in the same query, you would like to put condition based on status as well.
You can achieve this in 3 ways.
1) After executing the query, you can filter the results of query by status 'Open'. This would have to be done after each time the report is executed. This approach wil not need any exits/ transport requests.
2) Create a characteristic variable on status characteristic. Make the type of this variable as 'Default/ User entry'. Select the option for 'Ready for input' and the variable should be 'Select-option'. You can give default values so that this values are populated when query is executed and pop-up comes up for user to give selection.
If you have status like 'Open', 'In progress', 'Completed', 'Terminated', then in default values section, you can give value like this
'Completed' to 'Terminated'
This would cover all the status. And if query is executed wth this value, PRs would come for all the status.
If you want the query to be executed for only 'Open' status, refresh the query, again th pop-up would come. Now, you can remove the default values and only give 'Open'. This time it would only give PRs with open status or given date range.
3) You can do 2nd step but by creating it of customer exit type. Have 'Ready for input' selected. And in customer exit, fill the variable under i_step =1 for all the statuses. therefore, when query is execute, it would come with same default values and you may change them based on your need.

Similar Messages

  • Can we create range variable for Query Key Date

    Hello Gurus,
    Can we create a range variable for Query Key Date ? when I tried to give a range of values for Query Key Date, I am unable to find Range Values option. I found only Single Values.
    so, Please let me know if we can use Range variables for Query Key Date ??
    Thanks in advance,
    Regards,
    Aarthi

    Hi Aarthi,
    This is relevant for the time dependant master data that is being pulled in thw query. Like if you are using a nav attr in the query and this nav attr is time dependant, then which record (from the char master data) is to be pulled into the report, depends upon the key date that you specify.
    The default key date value is the date on which the query is executed, that is <Today>.
    Hope this helps...

  • CF Set form.variable for query and Next/Previous pages error

    I have a CF form with a select that posts to a CF "action" page.
    On the action page I: CFSET ItemNumber=#form.ItemNumber#
    I CFOUTPUT the 'ItemNumber' into the CFQUERY (which is an Inner Join dependant on the '#ItemNumber#')...
    All of the above works just fine and displays the database fields in color alternating rows, per the rest of the code.
    Here's the problem:
    I'm displaying 40 rows on a page per "Next and Previous" code. (CFPARAM name="start" default="1" and CFPARAM name="disp" default="40" along with the rest of the NextN code in the header and body). This does display 40 rows on the page and puts a link at the bottom of the page "Next 40 Rows", etc.
    Note: I'm only querying the database once and using the query (query name="data") to populate the table rows And the NextN code (CFOUTPUT name="data") And (CFIF start + disp GREATER THAN data.RecordCount, etc)...
    The problem happens when you click the "Next 40 Rows" link to display the 2nd page of rows. Since (I'm assuming) this NextN code is 're-reading' the same page from top to bottom, an error is thrown when the code tries to read the CFSET ItemNumber=#form.ItemNumber# at the top of the page.
    With the #form.ItemNumber# on this action page Originally coming from the previous posting of the form to this action page, when the "Next 40 Rows" link is clicked and the NextN code re-reads this action page - the CFSET ItemNumber (#form.ItemNumber) is not getting populated and throws the error...
    I hope I've not made this sound confusing.
    I can get the NextN code to work when I'm just querying the database without "flying in" a form variable. But when I CFSET a variable (#form.ItemNumber#) that is inserted into the query, the second page of the NextN throws an error and doesn't display.
    I would include the page code here but it would be fairly lengthy and, as well, the NextN code is a 'standard' CF code -- I've narrowed the problem down to the above "Element is undefined" (when the page tries to reload from the "Next 40 Rows" link) and am hoping there's a simple fix or another way to display the records in Next and Previous pages.
    Thanks to anyone in advance for shedding light on this.
    - e

    Thank you for the reply, Owain.
    Yes - The Next/Previous at the bottom of the page are hyperlinks.
    <a href="ThisPage.cfm?start=#Evaluate("start + disp")#">
    The following is at the top of the page (and is the variable from the form that I CFOUTPUT in the query):
    <cfparam name="ItemNumberDropdown01" default="">
    <cfset ItemNumber = #form.ItemNumberDropdown01#>
    The error report showed that the "Next Page" hyperlink was reading an undefined variable... although when the "action page" first opens from the form posting to it, it populates the CFSET just fine (per the cfparam and cfset above)... As you mention, the hyperlink clearing the form scope is what causes the error in trying to display the next set of records...
    The form page and the 'action page' are both secure pages with an application page setting the session, etc. Am I at risk in using an URL scope?
    Where would this URL scope be put? (The href is shown above - would the URL scope go in this? - How would this be written?)
    The CFPARAM and CFSET would still exist at the top of the 'action page' and still throw an error wouldn't it or would this be replaced with something else to read the form.variable for this 'first' action page to be displayed?
    Thanks again for the 'education' on this...
    - ed

  • Variable for Query without changing Datamodel

    Hello Experts,
    I need in the Query a variable, which should have inpact on the processing in the user-exit. This variable should no be used directly for constraining data.
    It is an Yes/No variable. And I don't have in my multicube any characteristic which have Yes/No in their domain.
    In such situation I have always added to Multiprovider and Cube an new characteristic and created an variable for this characteristic.
    But I don't like this solution, because this changes in the datamodel are in really not important for the datamodel. It only an work around for getting the possibility of adding a variable.
    Does someone know an better idea for adding variables to query, without changing datamodel like this.
    Thanks
    Wojciech

    Hi Bhanu,
    Not really - I don't want to change Cubes.
    Thanks
    Wojciech

  • Variable For Query Key Date

    Hi All,
    I am using time dependent master data, i want to count number of employees on particular key date for diffferent Orgunits. So i created variable in the query properties for dynamic date selection .I also have other variable - Calendar month.
    If the user enters particular  Calendar Day (21.03.2008), then the report should show the total number of employees for that particular day.
    If the user chooses Cal Year/month  then the report should show the total number of employees for that time frame (12.2007-12.2008).
    When i enter Cal Year/month and execute the system not allowing to execute the report. It says Calender Day is mandatory.
    How can i bypass the calenderday when i choose calyear/month.
    Variable for Key date :
    Char - Calender Day
    Mandatory
    Ready for Input
    Regards
    A.Vasister

    Hi,
    For this work you have to create another 2 variable.
    1. Make your both user entry variables as optional.
    2. Create another 2 variables processing type as user exit.
    3. In the CMOD program, identify which variable contains data.
       - If the user entered month, then in the user exit of Calender day's from date should be
         first day of the month parameter and to    date should be the last date of the month parameter.
       - If the user entered date, then pass corresponding month&year value of the date to calmonth variable.
    Let me know the position.
    Vivek

  • Parsing List  in URL Variable for Query

    Hi, I am sending a url variable as in the following example:
    http://mypage.com/lookup.cfm?var=1001,1002,1003
    I then need to query a database given the string
    "1001,1002,1003" in #URL.VAR# to find all records that contain
    those RecID numbers in my table. Has anyone done this before, and
    if so what is the best way to accomplish this?
    Thanks!

    i tried using the following code, but keep getting an error:
    <cfif listLen(url.var) neq 0>
    <cfquery name="lookup" datasource="#application.dsn#">
    select *
    from INVENTORY_CATEGORIES
    where
    <cfloop list="#url.var#" index="i">
    <cfif isNumeric(i)>
    CATEGORY_ID= <cfqueryparam cfsqltype="cf_sql_integer"
    value="#i#">
    and
    </cfif>
    1=1
    </cfloop>
    </cfquery>
    <cfelse>
    <cfset LOOKUP.recordcount=0>
    </cfif>
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td> </td>
    <td> </td>
    </tr>
    <cfoutput query="lookup">
    <tr>
    <td> </td>
    <td>#row_id#</td>
    </tr>
    </cfoutput>
    </table>
    The error I am getting is:
    Error Diagnostic Information
    ODBC Error Code = 37000 (Syntax error or access violation)
    [Microsoft][ODBC Microsoft Access Driver] Invalid use of '.',
    '!', or '()'. in query expression 'CATEGORY_ID= Pa_RaM000 and 1=1
    CATEGORY_ID= Pa_RaM001 and 1=1'.
    The error occurred while processing an element with a general
    identifier of (CFQUERY), occupying document position (2:1) to
    (2:54).
    Date/Time: 07/24/06 09:50:54
    Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
    SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
    Remote Address: 127.0.0.1
    Query String: var=2042,2045
    Any ideas? Also, please keep in mind that the variables I
    will send across th eurl may also have letters. For example,
    var=m1001,1002,p30014. Thanks!

  • Use Yesterday as variable for Query Filter

    Post Author: rrburton
    CA Forum: WebIntelligence Reporting
    I want to have a query filter that refers to the previous day.  In regular SQL I would use something like "= trunc(sysdate)-1".  I don't see any option for doing it this way in web intelligence, the closest it comes is selecting object and then assigning the Beginning of Last Week item from the System Date table.  What am I missing?

    Post Author: rrburton
    CA Forum: WebIntelligence Reporting
    Nevermind - I figured it out just now.  It isn't very intuitive.  In the Objects and Variables dialog in the SystemDate table there are a bunch of items like 1 day, 2 days, etc. and you select one of those and then in the code it looks like:
    WHERE   PKG_NTD_CONV.TO_ORCL_DATE(TROUBLE_TICKET_ARCHIVE.CREATE_DATE)  =  ( sysdate )-1
    It should say something like 1 day ago, 2 days ago, etc.

  • Mandatory variables for Query in APD

    Hi,
    I have embedded a query in APD. The query has some mandatory variables. These mandatory variables give an error in APD.
    Error Message: This entry type OP_FPER(mandatory variable) requires you to enter a value
    I can give a variant for the query but I want the user to enter the values for the mandatory variables in the selection screen when the APD is executed.
    My question is,
    1) Is it possible to have a mandatory variable in the query if it is used in APD? If so, then what should I do?

    Hi Anita,
    no, unfortunately APD can not process a variable input screen. All variables need to be filled via query variant, hence the Analysis Process is not dynamic concerning variables.
    Cheers
    Thomas

  • List variables for query

    Hi!
    How can i list every query variables created in my BI system?
    I would like to see all variables created in BI querys.
    Thank´s!

    Tables -  RSZGLOBV and RSZELTTXT
    Edited by: Srinivas on Jul 22, 2010 10:00 PM

  • Using Text Variable for Query Description

    hi all,
    I am currently trying to include this text variable in the query properties of the query.
    This text variable should be able to grab the 0CALMONTH as filter to be included into the query properties. but currrently  cannot grab the particular information from the query properties.

    Hi
    If I got your Question properly , You are trying to use Replacement Path Variable .. If it is so
    /people/kamaljeet.kharbanda/blog/2006/12/28/bex-characteristic-variable-with-replacement-path
    http://www.sd-solutions.com/documents/SDS_BW_Replacement%20Path%20Variables.html
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/009819ab-c96e-2910-bbb2-c85f7bdec04a
    Hope it helps

  • How to use one Bex Variable for two purposes in one query?

    Hi,
    I want to prompt for a UOM in a query. Then I want to use that one UOM variable to do 2 tasks in the query:
    1. Perform a UOM conversion on one restricted key figure (no filtering)
    2. Filter in a second restricted key figure (no conversion)
    How would I use a variable (or two?) to do this? I do not want to have 2 UOM prompts.
    Thanks!
    Gregg

    Oh, it all seems so easy now!  Hindsight 20-20...
    Solution was to create a new input ready variable for Unit.
    1. Restrict the key figures which need restricting using new variable
    2. For conversions, in BI backend us T-code RSUOM and create new conversion type associated with new variable. Then for each key figure needing conversion, set the conversion parameter to use the new conversion type.
    Between both 1 & 2 above, the same variable is used & thus prompted only once.
    Solution works perfectly.... as it should. Hope this helps someone else!

  • Variable Screen for query view is hidden

    Hi All,
       I caome across an old query in BW 3.5 which is haiving some mandatory variables. There is a query view for the same query but when i am executing the query view i didn't got any variable screen and its running for some predefined value. How one can hide the variable screen for query view.
       How can i achieve the same for a BI 7 query view.  Please guide.
    Regards:
    Jitendra

    Hi Rakesh,
        What you said is right but my concern is that next time when i open the query view variable screen shouldn't appear ie should run with previously stored variable values. I am working with BI 7 query view. Please guide.
    Regards:
    Jitendra

  • How to define variable for value range in Bex Query?

    Hi
    How to define variable for Keyfig. value range on runtime like characteristic in Bex Query?
    Example: On runtime user select one of the following condition:
    1)User want to those records where amount is greater than $1000
    2)User want to those records where amount is greater than $1000 and less than $5000
    3)User want to those records where amount is greater than and equal to $1000

    Hi ,
    Need to Use exceptions & conditions for this scenario's  & need to create variable for exceptions based on condtions.
    Below document provides steps how to make selections at run time for a kfg.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60b33a28-dca2-2d10-f3b2-d2096b460b1e?QuickLink=index&overridelayout=true&48842368468641
    Regards,
    Seshu.P

  • Variable for calender month in BEX Query

    Hi all ,
    I am new to BI .
    Can any one please guide on how to create a month year variable that I can get calculated from a date..
    For Example
    if billing date is 01.02.2009 then my variable should have 02.2009 in Query   .
    Regards,
    Shashank

    Hi Shashank,
        You can achieve this by creating a customer exit variable for calendar month.
    Function module :
    READ TABLE i_t_var_range WITH KEY vnam = 'Date variable name ' INTO loc_var_range.
       IF sy-subrc = 0.
        year = loc_var_range-low(4).
        month = loc_var_range-low+4(2).
         CLEAR l_s_range.
         l_s_range-sign = 'I'.
         l_s_range-opt  = 'EQ'.
         CONCATENATE year month INTO l_s_range-low.
         APPEND l_s_range TO e_t_range.
       ENDIF.
    Hope this will help you. Let me know if you have any questions.
    Regards
    Suvarna

  • Query variables for 0CALDAY

    Hello gurus,
       I´m trying to create a query variable that shows the last calendar day(infoobject 0CALDAY) in the previous year, current year, next year. I´m not finding these variables in Business Content. Does anybody know any variable for this? If I gonna need to create a user exit for this, where should I put the result of the ABAP program?
    Thanks,
    David.

    Hello David!
    Yes, you must create user-exit variable for this.
    Go to transaction CMOD and find or create project with RSR00001 enhancement ("BI: Enhancements for Global Variables in Reporting"). After that edit ZXRSRU01 include in function EXIT_SAPLRRS0_001.
    Add to ZXRSRU01 code for you user-exit variable. For example:
        WHEN 'ZB_DATE_LASTMINUS1'.
          LOOP AT i_t_var_range INTO wa_range WHERE vnam = 'ZB_FISCYEAR_M1S'.
          ENDLOOP.
          n4 = wa_range-low.
          n4 = n4 - 1.
          CONCATENATE n4 '1231' into l_s_range-low.
          APPEND l_s_range TO e_t_range.
    in example ZB_FISCYEAR_M1S - variable for manual input on 0fiscyear characteristic.
    ZB_DATE_LASTMINUS1 - user-exit variable. calculate last day for input year - 1.
    Anton.

Maybe you are looking for

  • World travel adapter kit with MacBook

    I have just bought a travel adapter kit to use with my MacBook Pro (UK). I believe that my MacBook does have a MagSafe power connection, which the product details seem to suggest are compatible with the adapter kit. However, whilst it is obvious to m

  • Help on opening memory access door on new 24" iMac- screw is really tight !

    Trying to open the memory access door on my new 24" Intel iMac. It's the one with only one screw. Manual says to use a #2 Phillips but it looks like the assembler used a heavy duty high power screwdriver when it was built. Any tips on how to get the

  • How do I connect speakers to ipod

    Recently purchased Harmon Kardon Soundsticks I second hand, and an ipod dock. Both have a USB port how do I connect the two together? I am female and not very good with electrical goods!!!!   Windows XP  

  • Solaris 10 - x86 - migrating from Linux - question?

    Hi, We have a C++ application that uses libpcap to read packets as they arrive on the interface. We are trying to set up a more secure environment on Solaris 10 x86 by having this application run inside of a Solaris Container. The application runs pr

  • Single Query suddenly goes slow until database restart or query change

    Hello all, Configuration I'm using is Oracle 10g EE 10.1.0.4.0 on Windows 2003 Server I have performance issue with one single query. The query is called using dbExpress from Delphi application. Since a month, almost every week this query starts goin