Query Selection

Hello Every One,
I created an Info-set and attached the “user group” to it. Now when the user uses this query, he should only be able pull the data for the organization to which he belongs. For example, if he belongs to company code 1000, he should only be able to pull the data with respect to this company code (1000) and if he tries for other company codes, the query should give him error message. Is this possible in SAP query and if possible how to achieve this. Are there any  settings in sq02 ?
Thanks
A Vaman

Hi,
Good evening and greetings,
I think you can handle that requirement through "Role/User Group Assignment" available in the SQ02 Tcode...assign the object to a User Group and Role thereby the authorisation is controlled for the user.
Please reward points if found useful
Thanking you
With kindest regards
Ramesh Padmanabhan

Similar Messages

  • Getting the MDX query select error when running a webi report on BI query

    Getting the following error when running a webi report on BI query :
    A database error occured. The database error text is: The MDX query SELECT  { [Measures].[D8JBFK099LLUVNLO7JY49FJKU] }  ON COLUMNS , NON EMPTY [ZCOMPCODE].[LEVEL01].MEMBERS ON ROWS FROM [ZTEST_CUB/REP_20100723200521]  failed to execute with the error Unknown error. (WIS 10901).
    I have gone through many threads related to this error. But not able find the steps to follow for resoultion.
    Please help in this regard.
    Thanks,
    Jeethender

    The Fix Pack is also for Client Tools--it is a separate download.  Please see the text below for ADAPT01255422
    ADAPT01255422
    Description:
    Web Intelligence generates an incorrect MDX statement when a characteristic and a prompt are used.
    The following database error happens: "The MDX query ... failed to execute with the error
    Unknown error (WIS 10901)."
    New Behavior:
    This problem is resolved.
    This information is also available in the Fixed Issues document for any Fix Pack greater than 2.2.

  • Check box in SAP Query selection screen

    I want to keep 2 check box in SAP Query selection screen.
    could you please tell me any one.
    regards,
    kumar

    Hi Vijay,
    If these check boxes are the fields in the table you are using then you can do it in SQ01, otherwise you may required to make the changes in the standard code generated for that query.
    You can find the name of the generated program of the query when you execute the query.
    Reward points if useful.
    Regards,
    Atish

  • SA 520 error every 10 seconds: sqlite3QueryResGet failed.Query:SELECT * FROM networkInterface WHERE interfaceName=\'bdg1\

    Hi all,
    On a SA 520 I got this error, every 10 seconds:
    sqlite3QueryResGet failed.Query:SELECT * FROM networkInterface WHERE interfaceName=\'bdg1\
    Internet access was very spoty and I couldn't reach the firewall administration on the LAN interface. Had to shutdown the appliance to get it working again.
    Firmware version is 2.1.7.1
    What could have happenend?
    With kind regards,
    Jeroen

    Hi, everything in the "Quick Reference" section should be commented out with ;
    You should change those settings further down in the php.ini file.
    Example:
    error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
    display_errors = Off
    Last edited by adrianx (2013-07-26 12:32:02)

  • Wildcards in Query selection filter

    Friends,
    We are using BW 3.0B and wanted to have Query selection to accept wildcard characters to material characteristic.  upon searching I could not find the selection option "Pattern" either when I create a variable or at Query user selection 'Selection Options'.  All I see is only following 5 options
    1) Single value
    2) Greater than or equal to
    3) Less than or equal to
    4) Greater than and
    5) Less than
    If anyone has any comments please post it..
    by the way this Inobject has NO "Conversion Routine" at InfoObject level..
    Regards
    Mavi

    Hi Mavi,
    I hope you did not use the word PATTERN in there..
    By pattern i mean the string u r trying to search..
    eg: We used TF* in the variable screen to select all values starting with TF..
    In case of doc numbers we used 3000* to get all document numbers in the 3000 series..
    Hope this makes it clear..Let me know..coz this works for sure..
    Ashish..

  • XSQL bug  when using CURSOR in xsql:query SELECT statement?

    Hi there,
    When I tested with different XSQL pages, I found out that if I
    did not involve any XSQL pages that contain "CURSOR", I received
    data correctly and when I shut down Tomcat, Oracle DB server did
    NOT create any dump file (???). However, as long as I involve a
    XSQL page which contains "CURSOR", even I received data
    correctly, but when I shut down my Tomcat, Oracle DB server
    created a dump file (???).
    for example, if I involve xsql:query like:
    <xsql:query>
    SELECT emp_name,
    emp_id
    CURSOR( SELECT emp_address
    from address a
    where a.emp_id = b.emp_id)
    FROM employee b
    </xsql:query>
    Once, I involve this xsql page, when I shut down Tomcat, Oracle
    dB will create a dump file on the server.
    Even when I run this xsql page from
    oracle.xml.xsqlXSQLCommandLine, Oracle dB server still create a
    dump file on the server.
    Any idea for help ?
    Thanks,

    Hi,
    Is this what you are trying:
        try {
        Statement *stmt = conn->createStatement("SELECT ename AS aaaaaaaaaaaaaaa  FROM emp");
          ResultSet *rs = stmt->executeQuery ();
          vector<MetaData> md = rs->getColumnListMetaData ();
          int numCols = md.size ();
          cout<< "Number of columns :" << numCols << endl;
          string *colName = new string [numCols];
          int type = (int ) malloc (numCols);
          for (int i = 0; i < numCols; i++ ) {
            int ptype = md [ i ].getInt (MetaData::ATTR_PTYPE);
            if ( ptype == MetaData::PTYPE_COL ) {
              colName[ i ] = md[ i ].getString (MetaData::ATTR_NAME);
              cout<<"Column Name :" << colName[ i ] << endl;
          delete[] colName;
          stmt->closeResultSet (rs);
          conn->terminateStatement (stmt);
        catch (SQLException &ex) {
                    cout<<ex.getMessage()<<endl;
        }The above snippet works correctly for me.
    Rgds.
    Amogh

  • BEx query selection screen takes long time to popup

    Hi,
    I have a query which is taking long time to popup the selection screen. I have tried in RSRT the generate report option, the generating report takes 45 to 60 mins. After the report is generated the query selection screen comes up in couple of seconds. The first time I run the query everything its fine but then for the second time the problem comes back again.
    The selection screen takes +/- 40 mins to comes up in RSRT and in the portal it times out.
    I have run the statistics of the query and according to the statistics report the query takes a  lot of time for the following component :
    OLAP: Query Gen.     2681,312682
    I have removed the query from the cache monitor and after that regenerate the report. But these steps didnu2019t solve my problem.
    I made two test queries, in one query I have made the CKFu2019s and RKFu2019s directly at the infoprovider, and dragged and dropped in the KF structure. In the other query I made the CKFu2019s and RKFu2019s in the query KF structure itself. The query where I have the CKFu2019s and RKFu2019s at the infoprovider that query times out, the other query where I put the CKFu2019s and RKFu2019s in the query KF structure doesn't has this performance problem.
    What I donu2019t know is why the query is failing when I use RKFu2019s and CKFu2019s from the infoprovider, the other query donu2019t have this problem.
    Please advise how to proceed.
    Thanks in advance,
    Arash

    Hi,
    Please check the following notes which should be useful.
    1387593 - Performance optimization for query change/generation
    1416737 - Performance optimization for query change/generation(2)
    1396485 - Performance optimization for query check/save
    Then please execute the SE38 report ANALYZE_RSZ_TABLES (see notes
    1472915, 1506560) and repair/correct the different tables to optmize
    the query definition tables.
    Regards,
    Amit

  • SQL query: select billaddress if no delivery address exist.

    hi sql expert,
    The Query shall filter all invoices by date, articles and show the delivery address. Problem: Not every customer has deposited a delivery address. In this case the billing address is to be taken.
    How can this be done ?
    This query
    SELECT T0.[CardName], T3.[ZipCode],T3.[Street], T1.[ItemCode], T1.[Dscription], T1.[ShipDate], T1.[Price], (T1.[Price] * T1.[Quantity]) as "Gesamtpreis in €", T1.[FreeTxt],substring(T1.Freetxt,0,5) as "Grundpreis in €",substring(T1.Freetxt,9,6) as "TS-Wert in %", T1.[Quantity] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN CRD1 T3 ON T2.CardCode = T3.CardCode WHERE CONVERT(nvarchar(8), T1.ShipDate, 112) BETWEEN '[%FromDate]' AND '[%ToDate]'
    and T1.Itemcode = [%0] GROUP BY T0.[DocNum], T0.[CardName], T3.[ZipCode],T3.[Street], T1.[ItemCode], T1.[Dscription], T1.[ShipDate], T1.[Price], T1.[FreeTxt], T1.[Quantity]
    UNION ALL
    SELECT T0.[CardName], T3.[ZipCode],T3.[Street], T1.[ItemCode], T1.[Dscription], T1.[ShipDate], -T1.[Price], -(T1.[Price] * T1.[Quantity]) as "Gesamtpreis in €", T1.[FreeTxt], ('-' + substring(T1.Freetxt,0,5)) as "Grundpreis in €",substring(T1.Freetxt,9,6) as "TS-Wert in %", -T1.[Quantity] FROM ORIN T0  INNER JOIN RIN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN CRD1 T3 ON T2.CardCode = T3.CardCode WHERE CONVERT(nvarchar(8), T1.ShipDate, 112) BETWEEN '[%FromDate]' AND '[%ToDate]' and T1.Itemcode = [%0]
    GROUP BY  T0.[DocNum], T0.[CardName], T3.[ZipCode],T3.[Street], T1.[ItemCode], T1.[Dscription], T1.[ShipDate], T1.[Price], T1.[FreeTxt], T1.[Quantity]
    Thanks a lot!

    hi,
    I think I got it now :-)
    First: Show me priority all  delivery addresses . Otherwise billing addresses:
    SELECT T1.[CardCode], T2.[Street] FROM OCRD T1  INNER JOIN CRD1 T2 ON T1.CardCode = T2.CardCode WHERE NOT EXISTS
      SELECT *
      FROM CRD1 as T2
      WHERE T2.[AdresType] = 's' and t1.CardCode = t2.Cardcode
    union
    SELECT T1.[CardCode], T2.[Street] FROM OCRD T1  INNER JOIN CRD1 T2 ON T1.CardCode = T2.CardCode
    where T2.[AdresType] = 's'
    secondly:
    Filter all invoices by date, articles and show priority the delivery address else billingaddress and subtract the credits:
    SELECT T0.[Cardcode], T0.[CardName], T3.[ZipCode],T3.[Street], T1.[ItemCode], T1.[Dscription], T1.[ShipDate], T1.[Price], (T1.[Price] * T1.[Quantity]) as "Gesamtpreis in €", T1.[FreeTxt],substring(T1.Freetxt,0,5) as "Grundpreis in €",substring(T1.Freetxt,9,6) as "TS-Wert in %", T1.[Quantity]
    FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN CRD1 T3 ON T2.CardCode = T3.CardCode
    WHERE CONVERT(nvarchar(8), T1.ShipDate, 112) BETWEEN '[%FromDate]' AND '[%ToDate]'
    and T1.Itemcode = [%0] and not exists  (
      SELECT *
      FROM CRD1 as T3
      WHERE T3.[AdresType] = 's' and t2.CardCode = t3.Cardcode
    GROUP BY T0.[Cardcode], T0.[DocNum],T0.[CardCode], T0.[CardName], T3.[ZipCode],T3.[Street], T1.[ItemCode], T1.[Dscription], T1.[ShipDate], T1.[Price], T1.[FreeTxt], T1.[Quantity]
    union
    SELECT T0.[Cardcode], T0.[CardName], T3.[ZipCode],T3.[Street], T1.[ItemCode], T1.[Dscription], T1.[ShipDate], T1.[Price], (T1.[Price] * T1.[Quantity]) as "Gesamtpreis in €", T1.[FreeTxt],substring(T1.Freetxt,0,5) as "Grundpreis in €",substring(T1.Freetxt,9,6) as "TS-Wert in %", T1.[Quantity]
    FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN CRD1 T3 ON T2.CardCode = T3.CardCode
    Where T3.[AdresType] = 's' and T1.Itemcode = [%0] and CONVERT(nvarchar(8), T1.ShipDate, 112) BETWEEN '[%FromDate]' AND '[%ToDate]'
    -- ab hier werden die Gutschriften abgezogen
    union
    SELECT T0.[Cardcode], T0.[CardName], T3.[ZipCode],T3.[Street], T1.[ItemCode], T1.[Dscription], T1.[ShipDate], -T1.[Price], -(T1.[Price] * T1.[Quantity]) as "Gesamtpreis in €", T1.[FreeTxt], ('-' + substring(T1.Freetxt,0,5)) as "Grundpreis in €",substring(T1.Freetxt,9,6) as "TS-Wert in %", -T1.[Quantity] FROM ORIN T0  INNER JOIN RIN1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN CRD1 T3 ON T2.CardCode = T3.CardCode WHERE CONVERT(nvarchar(8), T1.ShipDate, 112) BETWEEN '[%FromDate]' AND '[%ToDate]' and T1.Itemcode = [%0]
    and not exists  (
      SELECT *
      FROM CRD1 as T3
      WHERE T3.[AdresType] = 's' and t2.CardCode = t3.Cardcode
    GROUP BY  T0.[Cardcode], T0.[DocNum], T0.[CardName], T3.[ZipCode],T3.[Street], T1.[ItemCode], T1.[Dscription], T1.[ShipDate], T1.[Price], T1.[FreeTxt], T1.[Quantity]
    union
    SELECT T0.[Cardcode], T0.[CardName], T3.[ZipCode],T3.[Street], T1.[ItemCode], T1.[Dscription], T1.[ShipDate], T1.[Price], (T1.[Price] * T1.[Quantity]) as "Gesamtpreis in €", T1.[FreeTxt],substring(T1.Freetxt,0,5) as "Grundpreis in €",substring(T1.Freetxt,9,6) as "TS-Wert in %", T1.[Quantity]
    FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN CRD1 T3 ON T2.CardCode = T3.CardCode
    Where T3.[AdresType] = 's' and T1.Itemcode = [%0] and CONVERT(nvarchar(8), T1.ShipDate, 112) BETWEEN '[%FromDate]' AND '[%ToDate]'

  • Using a UDF in query select

    I am using CF8 and MS Sql Server. I am getting an error on "select Str, CapFirst(Str) ..." when trying the following:
    <cffunction name="CapFirst" returntype="string" output="false">... </cffunction>
    <cfquery name="query" dbtype="query">
    select Str, CapFirst(Str) as CapStr from SampleTable
    </cfquery>
    Thanks for your help

    You can't run a UDF like that in any <cfquery> SQL string, be it a QoQ or any other DB's driver.
    If one wants to use a UDF in the SQL string, then one needs to call it like one would anywhere else: #myFunctionHere()#.  However this won't help you because all the CF calls are resolved before the resultant string is sent to the DB driver.
    And the string that goes to the driver needs to be valid SQL.
    So you cannot do what you're wanting to do via this approach.
    I presume the original data is coming from a DB?  Why don't you run an equivalent function on the DB before passing it back to CF, so the results are already how you want them to be?
    Adam

  • F4 search-help in infoset query selection-screen fields

    Hi all,
    I created an infoset, and it's corresponding query, and now I need to associate F4 search-help in two of the selection-screen fields. Since they don't have any reference field associated (they are SAP standard table fields), there are no possible values available to select.
    How can I do this?
    I have already tried to use the "AT SELECTION-SCREEN OUTPUT" in the infoset, but I'm not able to do that. When I try to use the select-options generated by the query (SP$00013 and SP$00014) I have a syntax error with "Field not known".
    Can you help me? I never done this before, so I really don't have a guess.
    Thanks in advance.
    Beste regards,
    Sónia Gonçalves

    Hi all,
    I have found thread  that helped me a lot in this issue.
    I just have one more doubt: I created the selection criterion and I can already see it in the query selection-screen, but it's appearing in the top of the selection-screen, in a different area called "General data selections".
    Isn't it possible to include it in the "Report-specific selctions"?
    Thanks in advance.
    Best regards,
    Sónia Gonçalves

  • Query Selection screen field validatoin

    I am testing a query using the RSRT2 transaction and have a query selection screen whose fields i want to create custom validations for. ( which should trigger when check or execute is pressed )
    How can this be achieved ?
    I tried looking for exits but did not find a relevant one.
    Thanks in advance.

    Hello,
    You need to write a routine in SMOD for selection screen validations.
    It will come in i_step = 3. please refer foll code as example:
    The code example is to check whether date is less than or equal to current date. If user enters future date it pop ups saying enter date less than or equal to current date.
    DATA:  LI_VAR like rrrangeexit,
           wa_t_var_range like LI_VAR,
           count type i value 0.
    IF i_s_rkb1d-infocube EQ 'CUBE1' or
       i_s_rkb1d-infocube EQ 'CUBE2'.
    Check whether only one of date variable is entered in variable screen.
    IF I_STEP = 3.
        Read table i_t_var_range into wa_t_var_range with key vnam = 'VARDATE'.
          if wa_t_var_range-low > sy-datum.
            CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
              EXPORTING
                I_CLASS  = 'RSBBS'
                I_TYPE   = 'E'
                I_NUMBER = '000'
                I_MSGV1  = 'Enter date less than or equal to current date'.
            raise again.
          endif.
    ENDIF.
    ENDIF.
    Regards,
    Shashank

  • Query Selection Screen restriction

    Hello All,
    In my query selection screen, i have date, month and week as selection parameters. Now my requirement is that user should select only one of them. If he selects more than one ie combination of two or all three, than query should not show any data.
    Can this be achieved? If yes how.
    Regds,
    Shashank

    Hi,
    You can try out, customer exit with I_STEP = 3.
    using which a exception will be raised if user enters value for more than one variable.
    Hope it helps......
    Regards,
    Umesh.

  • Query Selection Screen does not appear in Web Analyzer

    Hi Experts,
    Query Selection Screen appears when we open the query in Bex Analayzer in production system. But when we open the query in ABAP or JAVA Web view, the selection screen does not appears.
    As the volume of data in the cube is very high, and since the selection screen is not appearing, the query extracts 1.5Mrecords and results in dump.
    Kindly let me know the possibility for selection screen not appearing.
    Note: The selection screen appear in Development system in Bex Analyzer, ABAP View and Java View
    Regards
    Suresh Kumar

    Dear Suresh,
    You can check if the parameter &VARIABLE_SCREEN=X is added to standard template or not, If not add this,
    In order to add this parameter in the webtemplate you have to change 0ANALYSIS_PATTERN and save it as ZANALYSIS_PATTERN and enter this standard web template under TCODE RSCUSTV27.
    Also I would like to explain you the behavior of Web Analyzer,
    Parameter VARIABLE_SCREEN=X only influences the WEB application at startup. This will not come into affect
    when you use the 'New Analysis' button. The 'New Analysis' button resets the dataprovider so this would not
    affect the variable screen and would not redisplay the variable screen as you require.
    Regards,
    Arvind

  • A/R invoice Report Query selection by Items.

    Dear All,
    I need a A/R invoice  Report Query selection by Items.
    Thanx in advance!!!!!!!!

    Hi,
            Try this......
    Declare @Itemcode nvarchar(50)
    set @Itemcode = (select (T1.iTEMCODE) FROM INV1 T1 WHERE T1.ITEMCODE='[%0]')
    SELECT T0.DocNum, T0.DocStatus, T0.DocDate as 'Posting date',
    T0.TaxDate as 'Document Date', T0.CardCode as 'Customer Code',
    T0.CardName as 'Customer Name', T1.ItemCode, T1.Dscription as 'Item Name',
    T1.Quantity,T1.Price,T1.VatSum AS TAX,T1.LineTotal as Total
    FROM OINV T0
    INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
    where T1.ItemCode =@Itemcode 

  • Query Selection Critieria

    Hi experts,
    My users would like the query selection critieria to allow them to choose a particular selection or select all results
    For example:
    Where t0.slpname = [%0]
    will allow them to select a particular salesperson for the query results. Is there a way to code it so that they choose a particular salesperson OR select all salespersons?
    Thanks for your help!
    Jane

    Hi Jane Liang ,
    Try this,
    Select * from oslp T1 where (t1.SlpCode = [%0] or [%0] = '')
    Once you execute this query it will ask you to choose the value , dont choose anything just give OK query will give all the result.
    Edited by: Prasanna s on Mar 11, 2011 5:15 PM

  • Query Selection View

    I'm using the Query Selection View web item on one of my web templates.  The issue is related to the Create and Delete command buttons not being displayed even though the Create/Delete - Display Button property has been selected for this control. 
    Thanks

    Did you ever figure this out?  I am having the same problem now

Maybe you are looking for