Command buttons to Assign Query / Query view with variables on Workbooks

Hi experts,
We want to have a workbook with buttons that will change the Query/Query view displayed in the unique grid we have.
We've included command buttons on a workbook, as "<b>Data Provider Specific Command</b>" and chose the Queries, selecting the "<b>Assign Query / Query View</b>" option.
When using queries without variables or just SAP exit variables it works perfectly, clicking the buttons change the table displayed accordingly. But when using queries that have at least one variable, in our test to select time interval, it doesn't work anymore.
In our test, we're using just 2 queries and they have the same input variable (to select months interval); but when clicking the button no change/error occurs.
Any ideas?
Thanks in advance.

Hi,
Here is one approach - Keep three analysis items in the WT. Assign three different data providers to all three analysis items. If you do not want to show any query when the WT first loads, don't assign any query to the data providers. When a button is pushed, you can use the command SET_DATA_PROVIDER_PARAMATERS to assign a query to a DP so that that query will show up.
Other commands that will help you would be SET_ITEM_PARAMETERS using which you can hide analysis items and also, you can use the command BACK_TO_INITIAL_DP_STATE on data providers so that they do not show up if they were blank at the start.
Another way to hide a query is to assign the analysis item to a data provider which is blank.
For your requirements, you will have to put multiple commands behind each button - you can decide which of the above commands suit you best.

Similar Messages

  • Is there a way to have more than one Query view in the same workbook?

    Is there a way to have more than one Query view in the same workbook?
    BEx allows us to insert Queries into workbooks, but not saved views.
    I can open a view in excel & then save it as a workbook....but after that there is no way to add another view to the same excel. If I open a new view, it opens in a new Excel.

    Hi
        when u open some query in BEx analyser,u can save it as a query view as well as workbook.The difference is, workbook is if u work with the design mode which will be in the left side of ur screen and query view is wen u save after drill downing some char or key figures from a intial screen wen u execute query in BEx analyser

  • Using command button to select query - WAD 7.0

    Hello all
    Can anyone please tell me how to configure a command button (button group) to display a particular query in WAD 7.0?
    Here's what I mean -
    I have a web template with three queries. I have inserted 3 command buttons on the template. I want to assign one button to one query, so that the users can select which of the three they want to view. Which Command do I select in the command wizard to do this? Also, is it possible to hide the other two queries, when one is selected?
    Thanks
    Karen

    Hi,
    Here is one approach - Keep three analysis items in the WT. Assign three different data providers to all three analysis items. If you do not want to show any query when the WT first loads, don't assign any query to the data providers. When a button is pushed, you can use the command SET_DATA_PROVIDER_PARAMATERS to assign a query to a DP so that that query will show up.
    Other commands that will help you would be SET_ITEM_PARAMETERS using which you can hide analysis items and also, you can use the command BACK_TO_INITIAL_DP_STATE on data providers so that they do not show up if they were blank at the start.
    Another way to hide a query is to assign the analysis item to a data provider which is blank.
    For your requirements, you will have to put multiple commands behind each button - you can decide which of the above commands suit you best.

  • Dynamically assigning query/view to a table

    Hi All,
    i want to assign a view to a table dynamically in WAD as per certain condition, can any 1 tell me how to do this?
    thanks in advance
    Godhuli

    Just a thought
    Instead of assigning query dynamically is it possible that you will have tables with different queries as dataprovider and at run time you can show only the required table and other tables you can hide.
    Unfortunately my WAD is not working so I am just giving a pseudo code.Please don't blame me for syntax errors.Please Paste this code between <\BODY> and
    <\HTML>.
    You can write a script like this
    <script>
    var obj;
    var tablobj;
    obj = findobject("option_1");
    HideTables();
    if (obj.value == 1)
       tablobj = findobject("TABLE_1");
       tablobj.style.display = "show";
    if (obj.value == 2)
       tablobj = find_object("TABLE_2");
       tablobj.style.display = "show";
    function findobject(objname)
    var all = document.all;
    for( var i=0;i<all.length;i++ ){
    if (all<i>.name==objname)//we have found object
    return all<i>;
    return null;
    function HideTables()
    var all = document.getElementsByTagName("table");
    for( var i=0;i<all.length;i++ )
    all<i>.style.display = "hidden";
    <\script>
    Regs
    Gopi.
    Message was edited by: Gopi

  • Query SQL with variables Parameters and user defined tables

    Hi  everyone
    I got a problem about Query SQL
    [dbo].[@CSOURCE]  is a user defined table
    select * from [dbo].[@CSOURCE]
    you can get the result in following
    code    name
    T01      newspaper
    T02      TV
    T03      radio
    T04      friends
    when I execute the following SQL   Statements ,I get an error
    SELECT T0.CardCode , 0.CardName ,T1.Name ,T2.SONumber
    FROM OCRD T0    LEFT JOIN [dbo].[@CSOURCE]  T1 ON T0.U_CSOURCE = T1.Code
                                 LEFT JOIN (SELECT  T0.CardCode ,COUNT(T0.DocNum)SONumber
                                 FROM ODLN T0  INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
                                WHERE T1.GroupCode =111
                                AND   (T0.DocDate >=[%0] or [%0]='')
                                AND   (T0.DocDate <=[%1] or [%1]='')   
                                GROUP BY T0.CardCode) T2 ON T0.CardCode=T2.CardCode
    WHERE T0.GroupCode =111
    and  T0.CardType ='C
    Is there anyone can correct it for me
    thank you very much
    Edited by: Li Mishan on Jul 17, 2008 9:36 AM
    Edited by: Li Mishan on Jul 17, 2008 9:40 AM

    I am sorry .It is just a mistake of my typewriting.
    The following is the whole SQL
    dbo.@CSOURCE is a user table.It's content is
    code  name
    T01    newspaper
    T02    TV
    T03    radio
    T04    friends
    declare @m int
    declare @FromDate DateTime
    declare @ToDate DateTime
    set @m=(SELECT count(*)  FROM ORDR T0 WHERE T0.DocDate >=[%0] and  T0.DocDate <=[%1])
    set  @FromDate=[%0]
    set  @ToDate=[%1]
    /*****************If I do not connect user tavble dbo.@CSOURCE ,I will succed *****************************************************/
    SELECT T0.CardCode ,T0.CardName ,T2.SONumber,T1.Name
    FROM OCRD T0  LEFT JOIN [dbo].[@CSOURCE] T1 ON T0.U_CSOURCE = T1.Code
                               LEFT JOIN (
                                                SELECT T0.CardCode ,COUNT(T0.DocNum)SONumber                                            FROM ODLN T0 INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
                                                WHERE T1.GroupCode =111
                                                AND (T0.DocDate >=@FromDate or @FromDate='')
                                                AND (T0.DocDate <=@ToDate  or  @ToDate ='')                                                                               
    GROUP BY T0.CardCode
                                            ) T2 ON T0.CardCode=T2.CardCode
    WHERE T0.GroupCode =111
    and T0.CardType ='C'
    when I excute the SQL, It return a error , whith says the column name '%0'  is invalid.
    If I delete "set @m=(SELECT count(*)  FROM ORDR T0 WHERE T0.DocDate >=[%0] and  T0.DocDate <=[%1])"
    and rewrite "set  @FromDate='2008.05.01' set  @ToDate='2008.07.01' "
    It Shows the following results
       CardCode     CardName     SONumber     name
    1      000070        Deng. Jiahua   1                newspaper
    2      000293        LU .Weijuan    1                radio
    3      000313         Xie .Jifang       3               TV
    Edited by: Li Mishan on Jul 18, 2008 4:42 AM
    Edited by: Li Mishan on Jul 18, 2008 4:43 AM
    Edited by: Li Mishan on Jul 18, 2008 5:43 AM

  • BEx Query Problem with variable

    Hi experts,
    I want to create a report with month variable such that when the user enters (let say)October the report will look like this:
    October    November   December
    I want to see the October column as cumulative(sum of Jan-Oct) and the remainings as single values.How can I achieve this?
    Thanks and regards,
    Sunny

    Hi,
    As far as i understand your problem you need three things to display.
    Suppose you have a key figure sales and you want to display cumulative sales (current year till month entered by user) and another sales of next two months.
    For next months based on user entry you can work around with offset only.Restrict your keyfigure with 0calmonth offset1 and offset2.
    FOr yeat till month requirement you need to make one customer exit variable.Please check the below link for the same.
    Variable Exit
    Hope it helps.
    Regards,
    AL

  • Creating materialized view with variables - help

    Greetings,
    I want to create an materialized view (MV) from the external public db link. Below is my full query:
    CREATE MATERIALIZED VIEW PROJECTS_MV
    REFRESH WITH ROWID
    AS
    SELECT prj.Project_id, prj.desc,
    prj.parent_project_id, f_year, f_month
    FROM sysadm.prj@EFUYEEDW_DB_LINK.MSDB prj
    WHERE prj.pf_scenario_id = '708KDD'
    AND prj.ph_id = 'SHAREDP'
    AND f_year = (SELECT EXTRACT(year FROM current_DATE) FROM dual)
    AND f_month = (SELECT EXTRACT(month FROM current_DATE) FROM dual)
    Question: In the query there are two variables that capture the month and year and requery it. Does the data get updated automatically when a new month or new year changes?
    If there is a change, how would I change so it would update the data accordingly?
    Thanks for your help
    john9569

    Hi Christian,
    Thanks for your response. Your codes return the date as 01-JAN-09 which is not what I'm looking for. Maybe my question is not clear.
    So far, the MV is executed correctly what I want. My concern is when it updates the MV, does it get the new data (f_month & f_year) when the MV is updated automatically?
    Other words, the MV is updated nightly to get the incremental data from the db link. Once it passes to the new month, I am not sure how this MV handles since the f_month is now changed to differrent number.
    Thanks for your help.
    Bests,
    John9569

  • Create view with variables

    Is there any way of create a view that asks for the value of some parameters?
    something like...
    CREATE VIEW "VIEW1" AS
    SELECT NOMBRE
    FROM EPTABLA_01
    WHERE NOMBRE = ??? WITH READ ONLY

    The method below won't "ask" for a value, but if you set the variable, this will work as a parametrized view.
    SQL> create context my_ctx using my_proc
      2  /
    Context is aangemaakt.
    SQL> create procedure my_proc (p_nombre in number)
      2  is
      3  begin
      4    dbms_session.set_context('my_ctx','my_nombre',to_char(p_nombre));
      5  end;
      6  /
    Procedure is aangemaakt.
    SQL> create table eptabla_01 as select l nombre from (select level l from dual connect by level <= 10)
      2  /
    Tabel is aangemaakt.
    SQL> create view view1
      2  as
      3  select nombre
      4    from eptabla_01
      5   where nombre = sys_context('my_ctx','my_nombre')
      6    with read only
      7  /
    View is aangemaakt.
    SQL> exec my_proc(5)
    PL/SQL-procedure is geslaagd.
    SQL> select * from view1
      2  /
                                    NOMBRE
                                         5
    1 rij is geselecteerd.
    SQL> exec my_proc(8)
    PL/SQL-procedure is geslaagd.
    SQL> select * from view1
      2  /
                                    NOMBRE
                                         8
    1 rij is geselecteerd.Regards,
    Rob.

  • How to Locate "Query View u2013 Selection" web item in WAD

    Hi,
       Where/How can i find the "Query View u2013 Selection" web item in Blank Templete of a WAD
    or
    From where i can install it from Business Content
    Thanks

    Hi,
    Are you with 7.x WAD?
    This option will be available with that.
    Or else,after putting Analysis Item->Properties->General tab->Click "New Data Provider" icon->Select the Type dropdown as "Data Provider of Type Query View".
    This will list three radio buttons ""Query View","Query" and "InfoProvider" under "Define Data Provider Type".You can select "Query View" radio button and assign Query View.
    Rgds,
    Murali

  • Bookmark with Query View Issue !!!

    Hello Experts,
    I have a query view for my data provider. I change the Variable at runtime and modify the layout and when i try to bookmark the page it always uses the defaults from the Query view.
    Variable Screen
    <SAP_BW_URL CMD='PROCESS_VARIABLES' VARIABLE_SCREEN='X'>
    Bookmark
    <SAP_BW_URL CMD='BOOKMARK'>
    Is there any way to Refresh the data provider to have the current variables values & layout in the page with the Bookmark?
    Thank you
    Arun Prasad

    Hi,
    Did you try using Save View command in the command wizard?
    Thanks

  • Report Designer - Query with variable

    Hi!
    When testing the report designer, we have found an issue - it’s not possible to embedding queries with variables.
    We have found note https://websmp107.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=012006153200000232982006
    that suggest a solution to the issue.
    My question is simply, does anyone know if this is a temporary fix, or is this a constraint that is not planned to be fixed by SAP? The note is a bit ambiguous.
    BR
    bjørn

    Hello,
    Queries with variables are still in restrictions for Report Designer.
    You can use this work-arond creating Query View and fill up the variables. This allows you to define a Report in RD. Then, use Web Appication Designer to include your Report into Web Application and replace the Query View with your initial Query.
    For the integration do following:
    1. Create new Web Template in WAD
    2. Drag-and-drop Web Item "Report"
    3. Go to Property Window in WAD and search for "REPORT" (description Report Design) parameter in Web Items Parameters
    4. Use the button on the right side of the parameter to open Report Designer and choose your Report in it.
    5. You should see that new Data Provider was created in WAD -> Open it and set it to your initial Query.
    5. Save you Web Template and execute in the browser.
    Regards, Karol
    Development BI

  • PeopleSoft Query View

    Folks,
    In Application Designer, I create a record with its type Query View. Because Query View has not connected with SQL Editor in the Tool, only SQL View and Dynamic View connect with SQL Editor in which we type in SQL statement, I don't know where to type in SQL statement for the Query View. Thus, building the record fails !
    Do any folks understand how to connect a record, whose type is Query View, with some existing SQL tables ?
    Thanks.

    The button to launch query should appear below the "Record Type" group box where you selected Query View. I tried removing query access from my permissions and I still see the button, so the only other suggestion I can offer is that the button is there but you need to scroll down or expand your window to see it...
    +-Record Type ---------+
    |                      |
    |  o SQL Table         |
    |                      |
    |  o SQL View          |
    |                      |
    |  o Dynamic View      |
    |                      |
    |  o Derived/Work      |
    |                      |
    |  o SubRecord         |
    |                      |
    |  @ Query View        |
    |                      |
    |  o Temporary Table   |
    |                      |
    +----------------------+
      Click to Launch +---+
      Query:          | ? |    <=== The button should appear here
                      +---+Sorry about the misinformation re permissions. Note that if you do find the button, it can take a long time to launch because of the SQL the tool runs to return the list of records. If necessary you can use the Query Access List cache to improve response, but if you don't use it often then be patient and it should launch eventually.
    Regards,
    Bob

  • Query views are not using OLAP cache

    Hi,
    I am trying to pre-fill the OLAP cache with data from a query so as to improve the performance of query views. 
    I have read several documents on the topic, such as “How to… Performance Tuning with the OLAP Cache” (http://www.sapadvisors.com/resources/Howto...PerformanceTuningwiththeOLAPCache$28pdf$29.pdf)
    As far as I can see, I have followed the instructions and guidelines in detail on how to set up the cache and pre-fill it with data. However, when I run the query views they never use the cache. For example, point 3.4 in the abovementioned document does not correspond with my results.
    I would like some input on what I am doing wrong:
    1. In RSRT I have Cache mode = 1 for the specific query.
    2. The query has no variables, but the following restrictions (in filter): 0CALMONTH = 09.2007, 10.2007, 11.2008 and 12.2007.
    3. I have one query view with the restriction 0CALMONTH = 10.2007, 11.2008 and 12.2007.
    4. I have a second query view, which builds on the same query as the first query view. This second query view has the restriction 0CALMONTH = 11.2008 and 12.2007.
    5. There are no variables in the query.
    6. I run the query. 
    7. I run the first query view, and the second query view immediately after.
    8. I check ST03 and RSRT and see that cache has not been used for either of the query views.
    Looking at point 3.4 in the abovementioned document, I argue that the three criteria have been fulfilled:
    1. Same query ID
    2. The first query view is a superset of the second query view
    3. 0CALMONTH is a part of the drill-down of the first query view.
    Can someone tell me what is wrong with my set-up?
    Kind regards,
    Thor

    You need to use following process of process chain: "Attribute change run (ATTRIBCHAN)". This process needs to be incorporated into your process chains which loads data into provider on top of which your query is based.
    See following links on topic how to build it:
    https://help.sap.com/saphelp_nw73/helpdata/en/4a/5da82c7df51cece10000000a42189b/frameset.htm
    https://help.sap.com/saphelp_nw70ehp1/helpdata/en/9a/33853bbc188f2be10000000a114084/content.htm
    cheers
    m./

  • Bex Query view

    Hi Expert,
    For my requirement I need to create query view from basic query.In the basic query I have more than 10 chars and some key figure. In the query view i need only 3 char & some keyfigures. I have created a query view with those keyfigures wat I requires but for char how to select only 3 char from 10 chars in the basic query.
    Can any body suggest me any thing.
    Thanks
    Vinod

    Hi,
    Run the query in BEx Analyzer.
    Right click on results -> Select Query Properties.
    In the Row/Characterastics section, keep your 3 characterastics and move the remaining 7 characterastics to free char section. and press OK.
    Now, you will see the report with key figures for only 3 characterastics..
    Save it as a view.
    Hope this clarifies.
    Best Regards,
    Srinivas.

  • How do I...Mimic Replacement Path with Query using Customer Variable Exits?

    Hello SDN:
    We are on BW 3.5 SP16.
    We are currently using a replacement path Query(RP) with variables
    to populate a variable in another Query(T).
    The problem we are having is with performance.
    The entry of variables in replacement path Query(RP) is optional (This is necessary there cannot be required values)
    When results from Replacement Path Query are small performance is fine. (e.g. 10 seconds)
    When results from Replacement path query are large performance suffers. (e.g. 1+ minutes)
    Users are free to leave the replacement path variables empty resulting in a large set of data to be replaced. This is the worst performance case.
    We would like to discover a way to conditionally execute the replacement path query. That is if users do not enter values for the replacement Query(RP) variables do not execute the replacement path query(RP).
    Does anyone know if this is possible within reason and in customer exit space?
    We have reviewed the situation from all angles and the requirement for the replacement path FUNCTIONALITY and the freedom for the user to leave variable values blank remains.
    I've been searching and reading SDN and SAP notes for about a week and do not find threads which address this situation.
    We are also exploring Customer variable exits to mimic replacement path functionality
    (different topic subject="How do I...Mimic Replacement Path with Query using Customer Variable Exits?")
    Any help will be appreciated
    Many thanks
    David Schuh

    My appologies-I posted this message with the wrong subject. I will repost it with appropriate subject.
    dave schuh

Maybe you are looking for

  • How to change network settings

    hello, so i just recently got my first macbook pro (yay me) and the day i was setting it up i was going through the start ups and all and when it came to the network connections i used a connection that is a guest connection for my home router and no

  • Please help me clarify the benefits of Lightroom and PSE

    Hello, I've had PSE for many years and I am a light user of it. I've got about 13000 family photos I want to catalog, mark favorites, and touch up favorites - mostly adjust lighting and color, crop, red eye. I will occasionally edit out an object, li

  • Custom Workflow Activity not showing in Plugin Registration

    Could anybody suggest what I am doing wrong here? I have created a Custom Workflow Activity using this sample Create a custom workflow activity. But this is not showing up as a plugin/activity type in Plugin Registration Tool. See image below: My sam

  • Browser crash upon debug

    Hello, my Firefox browser always freezes up when I debug and receive a Flex error. If I debug and no errors, then it does not freeze. I have been using Firefox 3.04 and 3.5.  Both have this problem. Does anyone have any advice ?

  • Live! Ultra for Notebooks will not install

    I have a Toshiba A75-s229 notebook running Windows XP Pro. I went through the installation process but when I plugged the web cam into the USB port it Windows would not recognize the device. The message says "one of the USB devices attached to this c