Query Variables

Hi folks,
I'm trying to create the field names on the fly, rather than
have multiple if statements, so I can check if their defined, and
add them to a list. Can anyone tell me if this is possible?
<CFquery name="get" datasource="itsupport"
username="#dsn_username#" password="#dsn_password#">
SELECT * FROM jl_av_items where abbreviation = '#id#';
</cfquery>
<cfoutput>
<cfloop from="1" to="5" index="i">
<cfset option = "option" & i>
<!--- output field value here --->
<cfif isdefined("get.#option#">
#get.option#
</cfif>
</cfloop>
</cfoutput>

You could probably do it with a combination of the
GetColumnNames() query method and a simple query loop:
<cfset arrColumnNames = get.GetColumnNames()>
<cfoutput query="get">
<cfset sValueList = "">
<cfloop from="1" to="#arrayLen(arrColumnNames)#"
index="iCol">
<cfif FindNoCase("option", arrColumnNames[iCol])>
<cfset sValueList = ListAppend(sValueList,
Evaluate(arrColumnNames[iCol]))>
</cfif>
</cfloop>
</cfoutput>

Similar Messages

  • Text lines in the BW query variables screen

    Hi gurus.
    The bw users ask me to display some text lines in the BW query variables prompt.
    The text lines are saved in a custom table.
    The only idea that I've got is to use customer exit text variables and fill them in CMOD when I_step = 1.
    I don't like this solution (I should have more the 10 text lines and so I have to mantain more than 10 Text variables) but I can't find any other solution.
    Any new idea or solution?
    Is there in Bex enviroment a functionality (that I don't know) for doing somenthing like this ?
    Thanks fo any help.
    S.

    Hi,
    to resolve it you should create all the prompts in the BW query. You are using a query with 2 parameters and then a dynamic list of values. the dynamic list of values can only work after you entered the other values.
    Ingo

  • BW Query variable default value put in Crystal report variable question

    Why BW Query variable default value put in Crystal report variable for BO InfoView to open crystal report.
    I using Analyzer to open bw query,variables had default value ,but crystal report can't had variable default value ,and can't search variable  value.
    pho:
    [http://file.itpub.net/f/e38876ad4f6efb7e73980488e7d71f8d/4ae940e9/day_091029/20091029_2b04da1232144feba180OrB23SNvXtoT.gif/p/1.gif]
    [http://file.itpub.net/f/d93ddfe61e0eaf80429726c61f1a02ff/4ae940e9/day_091029/20091029_3211ffe04bf0302fbab5FRKnbwmH80p7.gif/p/BW_QUERY_Crystal.gif]
    Edited by: flying on Oct 29, 2009 8:20 AM

    I Know what to do .
    but Crystal report date variable value are Garbage characters "###".
    PHO:
    [http://file.itpub.net/f/39a8510104476707ae21c945db93ecba/4ae97949/day_091029/20091029_32dcbb7e7d99141483aesJ9KBJHXN0Kj.gif/p/2.gif]

  • BW Authorizations - Query variable with processing mode as "customer exit"

    Hi,
    Iam new to BW authorizations and have not yet worked on customer exit before. I was going through the documentation at various sites but I could not get the end to end description on how the query process( when using a variable for an InfoObject) works in case of customer exit.
    Let's assume that I am using  a query variable with processing mode as "customer exit" and at the exit I  write some code to extract user's authorizations from a z table. if this is the case, then when an end user runs a query,how will the the system know what value needs to be filled in the variable for the requesting user. Are the user details  also sent to the code along with the query variable? If so how. If I mis-understood the process then forgive me and let me know the correct process.

    Hi!
    welcome to SDN!
    customer exit variables need programing by user. so if you create a customer exit variable, you got to right a program which extracts values into this variable. we can do what ever we want in program, SAP will not deal anything ´with customer exits.
    with regards
    ashwin
    PS n:  Assigning point to the helpful answers is the way of saying thanks in SDN.  you can assign points by clicking on the appropriate radio button displayed next to the answers for your question. yellow for 2, green for 6 points(2)and blue for 10 points and to close the question and marked as problem solved. closing the threads which has a solution will help the members to deal with open issues with out wasting time on problems which has a solution and also to the people who encounter the same porblem in future. This is just to give you information as you are a new user.

  • How to track query variable input in FM

    Hi All,
    There are a MultiCube1 and a Query1 based on it.
    There is Virtual Infoprovider1 based on Query1.
    And finaly there is a Query2 based on Virtual Provider1.
    How to check inputed variables of Query2 in FM for Virtual Provider1.

    Hi,
    there is no way to read query variables in the is_protected method, since data slice run time and query run time are separated.
    Of course you can do the 'usual' trick by implementing an exit variable, export some variable values to memory and read it in the is_protected method.
    But is_overlapping is the correct method to read the used selection (of a query of planning function filter) to do some initializing work. This method is called when a function is processed or a query will be opened. Is_protetecd is called on a record basis, i.e. maybe very often.
    Regards,
    Gregor

  • Query rule using query variables

    Hi All,
    I am working on a query rule in SharePoint 2013. I am trying to build a query text using query variables to provide profile based results to the users. The query text which I am using in the query builder is of the following format:
    {SearchBoxQuery} CombinedLanguage:{User.PreferredContentLanguage}
    but its not taking the user.preferredcontentlanguage value. Has any one worked on similar type of query rules using query variables? Please share your suggestions.
    Thanks !!

    Hi,
    As I understand, you cannot get the user.preferredcontentlanguage value.
    1. Make sure you have set the value of query variable {user.preferredcontentlanguage}, it will return -1 if not set.
    2. Make sure you search in the right result source.
    3. Please check the crawled property mapped to the managed property CombinedLanguage and make sure that there is at least one value indexed by the crawled property equal to the {user.preferredcontentlanguage}.
    The article below is about the query variables.
    https://technet.microsoft.com/en-us/library/jj683123.aspx
    The article below is about the different query variables return different result examples.
    http://techmikael.blogspot.in/2014/05/s15e03-query-variables-constant-trouble.html
    Best regards
    Sara Fan
    TechNet Community Support

  • BEx: How to change a Query Variable that is not visible in Filters List?

    Hello Experts,
    Good day, I'm currently editing an old query, I am changing the Query Variables with new ones, but I found one variable that I cannot replace.
    Please see the screenshot below, in the Query Properties Window [Variable Sequence Tab (right side of picture)] the Variable that I am trying to replace (Unit) is visible. But when I look for the variable in the "Filter Tab" (left side of picture) under Characteristic Restrictions, it doesn't exist in the list.
    How can I find this Variable and replace it with a new one?
    Other reports are still using this variable so it will impact the other reports if I simply edit the variable. So I need to replace it with a new variable instead.
    Thank you for your time.

    Hi,
            SInce you are searching for a variable for Unit, look into below screenshot and navigate to the variables.
    First click on drop down and select 'Entry for variable' then you will get lisl (after you click on drop down in 'Target Unit' drop down option.
    Normally these type of variable called 'Formula Variable' try editing any of the formula and locate the option as shown below,
    Hope it helps! don't forget to update the final solution and mark the correct/helpful answers.
    Remember it will help others to find the solution and motivate the members to answer your question.
    Thanks,
    Umashankar

  • How to enable wild search(*) on a query variable

    how to enable wild search(*) on a query variable?

    Prakash,
    When you build the variable, what did you use as the "Processing By"? Were there any other special options you had to use to get it to work....This is something our client base would love to use....
    Thank you in advance...
    Jim

  • Table name where query variables stored

    Hi All,
    can any one please tell me in which data base table all the custom query variables are stored???

    Hi Pousali,
      Check RSZGLOBV.
    Hope it Helps
    Srini

  • 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.

  • WebI Prompts using BEx Query Variables

    Hello,
    I have the following issues with WebI report selection input paramaters (prompts) that use BW BEx Query variables. Could anyone please assist?
    Issue 1:
    The WebI report has one mandatory and two optional input paramaters (all paramaters from BW BEx Query). When I execute the report via WebI rich client directly, enter the value for mandatory input parameter and leave blanks for both optional input parameters, the report ran OK and has no issue. However, when I ran it through CMC a strange thing happen: I could not select the value for mandatory input paramater as it requires to have values for both optional input paramaters first (which I wish to have them blank and optional). When I refersh values for the mandatory paramater, it says "List of Values for current prompt requires values for following prompts:...(ie. the two optional parameters).
    Anyone has any idea - it seems like it is a CMC issue for the WebI...
    Issue 2:
    Take the same WebI report above, the issue here is the order sequence of the prompts (ie. the selection input parameters). How can we change/control the sequence of the prompts? Whatever sequence of the varaiables (input paramters) in BW BEx Query, the WebI ignores it. Please advise.
    Thanks & Regards,
    Andy

    I did not see separate thread for issue #1, therefore I'll us this thread.
    I am running into similar issue when I get an error message ''List of Values for current prompt requires values for following prompts: <Name of the prompt>".
    We are using BO V4, SP2, Patch 10 with SAP BW as DB via BEx queries.
    I opened support ticket for this issue since obviousely it's still an issue after applying patch 10.
    It's not an issue when 'Rich Internet Application' option is selected to view report in 'Reading' mode (via Launchpad Preferences then Web Inteligence; defautl value for viewing is 'Web').
    I have not tried to use Client tools but even if it works with Client tools - it is not a solution for us. Our company does not plan to install client tools on end user computers.
    Bigger issue us is that report scheduling invokes Web version (not Rich Internet Application). Therefore we cannot schedule report that is giving us problem described. I tried scheduling report from Launchpad and from CMC and both game me error highlighted.

  • Query Variable Screen

    Good day,
    Is it possible to remove or protect the "Check" option on a standard Web Query variable screen.
    Thanks

    Hi.
    As I know it is impossible.
    Regards.

  • Query Variable - Replacement Path

    Hi all,
    I would need to fill a query variable (based on calendar week characteristic) with specific list of values. I need all calendar weeks that are present in infocube, but only if key-figure > 0. So I've created a query with cal. weeks in rows and with suppressed zero rows. Output values from query contains exactly what I need.
    Than I created a variable (replacement path) with reference to mentioned query. But it seems to me that the variable does not contain all values displayed in the query, but only filtered values (if I use some restriction of cal. week).
    Is it possible to achieve this using replacement path at all?
    If not I would appreciate any idea or experiences how to accomplish this requirement.
    Many thanks,
    regards,
    Pavel

    Hi Pavel, I didn't get your requirement 100% . Still, I would like to tell How Replacement path works.
    First of all for the Source query you have given condition to restict the output of the query on particular keyfigure value > 0 ......  Right.
    Now on second query, you have created the Characteristic variable with Replacement path....here some important things to look at.
                    while creating the variable, select Processing Type as REPLACEMENT PATH, then in the "Replacement path" Tab,  give Replaced variable with.. "Query" ...and at bottom, For QUERY give the query name.
    If u want RRI facility from Source Query to Target Query, then u give RRI Connection in T-Code : RSBBS....
    ...and now when u execute the Second Query, First the first Query will be executed and those filtered values > 0 will be passed to the Second Query's variable input...then the second query will be executed...
    But, in your case check once again all settings in Variable in Second Query..and Conditions block in First Query..
    It should definitely work...
    ---Intros.
    Edited by: Intros on Apr 25, 2008 1:31 PM

  • Query variable : selection option with no interval

    Hello,
    Is it possible to define a query variable as selection option, with no interval (like in abap).
    I am in 3.X version.
    Many Thanks in advance,
    Manuel

    Hi Manuel,
    This should be possible through multiple single value variables, but to ensure that the user has not in input the same charateristic value for exclusion and selection you may choose to write customer exit at the background.
    I think interval and select option would allow 'To values'.
    So I was wrong in what I said before. SORRY
    However multiple single value would not allow exclusion, I think.
    Your scenario would only be possible by excluding multiple single values in variable type select option and process the variable using customer exit, to trmove all to Values.
    But you are right, you cannot have your scenrio handled , I think.
    ( ie multiple exclusion in from values with no To Values )
    One more way is restrict your characteristic by two input ready variables, one select option for exclusion and have a customer exit to delte all inclusion that were input accidently and one multiple value ready for input variable.
    But, all in all, there would be no straight drive through this I think.
    Hope it helps,
    Regards,
    Sunmit.

  • Query variable entry - want modal dialog screen instead of full scr

    hi
    Is there a way to show query variable input screen as a dialog modal window rather than the default full screen mode?
    thanks.
    Message was edited by:
            BWer

    yeah do a restriction and in the restriction screen fill in the variable to be restricted on and save and run query and this dialog screen will pop up

  • Query variable modification transport

    I modified a query variable description in RRMX and a change request (let's call it CR1) gets created.  But I wonder if I should go to RSA1 Transport Connection to add the variable to CR1?  and how?  I used to do this before quite a while ago and don't remember.  Anyone's answer is greatly appreciated!

    I go to RSA1 Transport Connection and locate the query variable and find that the CR number I mentioned above is listed under the column of Transport Request, that means I don't have to take any action, right?
    I also go to SE09, find the CR number, but find the following under it:
    Elements of the Query Builder
         3V1YMXBY0TW59BDED9632UZ05
         3V1YMXJMJSHURXWUJ38FCWXPX
         3V1YMXRB2R3KAKGAOXARMYWFP
         3V1YMXYZLPP9T6ZQURD3X0V5H
         3V1YMY6O4OAZBTJ70LFG72TV9
         3V1YMYECNMWOUG2N6FHSH4SL1
         3V1YMYM16LIED2M3C9K4R6RAT
         3V1YMYTPPK43VP5JI3MH18Q0L
         3V1YMZ1E8IPTEBOZNXOTBAOQD
         3V1YMZ92RHBIWY8FTRR5LCNG5
         3V1YMZGRAFX8FKRVZLTHVEM5X
         3V1YMZOFTEIXY7BC5FVU5GKVP
         3V1YMZW4CD4NGTUSB9Y6FIJLH
         3V1YN03SVBQCZGE8H40IPKIB9
         3V1YN0BHEAC2I2XOMY2UZMH11
         3V1YNI1142DWG1RY39H665IGL
         3WHDEB8V8U67QMLG3GCHWS7UD
         3WHM6ATJPZQ1ZHELM3DG5URAT
    I can't tell if it contains the variable or not from the above lines.
    Thanks

Maybe you are looking for