How to Create a Functiona Query

Dear all,
Could any body detail me how to create a functional query. Please give me step by step procedure to create a query.
I would appreciate if you can give me a material with screen shots. Your help will be highly appreciated.
Thank you
Raghu Ram

Hi Raghu,
           Go through this document it may help you,
SAP Query
Step 1: Create User Group – SQ03
Follow the menu path – SAP Menu > Tools > ABAP Workbench > Utilities > SAP Query > User Groups
a) In the User Group: Initial Screen -
Enter User Group Code (self named)
Click on “Create”
b) In the User Group (Code): Create or Change pop-up window -
Enter the User Group Description
Click on “Save”
c) In the Create Object Directory Entry pop-up window -
Ö Click on “Local Object” button
Ö The User Group Created is saved
Step 2: Create User Group – SQ02
Follow the menu path – SAP Menu > Tools > ABAP Workbench > Utilities > SAP Query > Infosets
a) In the Infoset: Initial screen -
Ö Enter Infoset Code (self named)
Ö Click on “Create” button
b) In the Infoset: Title & Database Screen -
Ö Enter Description of Infoset in the “Name” field
Ö In the Data Source selection: Select appropriate Data Source by clicking
the radio button
· Source the data can either be multiple tables OR single table. There are 4
options for the user to select from
Ö Click on “Continue” (Enter)
Ö Selected Table gets displayed in the Infoset : Initial Screen
c) In the Infoset: Initial Screen -
Ö Click on “Insert Table” button
d) In the Add Table Screen -
Ö Enter the Table Name that is to be inserted
Ö Click “Continue” (Enter)
e) In the Infoset: Initial Screen -
Ö Click on “Back” button
f) In the Field Group Defaults pop-up Screen -
Ö Select Appropriate Field Group Option by clicking on the radio button
· there are 3 options to select from. User can select Empty Field Group
option and then select the data fields in the steps explained further.
Alternatively, User can select an option which clubs all the data fields
From all the tables selected
Ö Click “Continue” (Enter)
g) In the Change Infoset Screen -
· the left side lists the Tables that the user has selected in step b, c & d
· In the right side, system creates field groups, one for each table listed in the
left part. Initially, the Field Groups are empty
Ö In the Left Side, Click on the arror next to the table name and expand and
display all the data fields in the table
Ö Select a Data Field from the expanded Table view, which is to be added to
the Field Group on the right.
Ö Select a Field Group on the right side, in which Data Field selected above
has to be added
Ö Right click on the Data Field selected and click on “Add Field to Field Group”
Ö The selected Data Field gets added to the selected Field Group, which is
indicated by an arrow next to the Field Group.
Ö Carry out the steps above to add the required Data Fields to the respective
Field Groups
Ö After transferring Data Fields to Field Groups click on “Generate” button
h) In the Create Object Directory Entry Screen -
Ö Click on “Logical Object” button to generate the infoset
i) In the Change Infoset Screen -
Ö Click on the “Back” button
j) User is taken back to the “Infoset: Initial Screen” which displays the
created Infoset record.
Step 3: Assigning User Group to Infoset – SQ03
Follow the menu path – SAP Menu > Tools > ABAP Workbench > Utilities > SAP Query > User Groups
a) In the User Groups: Initial screen -
Ö Enter the User Group for which Infoset is to be assigned
Ö Click on “Assign Users & Infosets” button
b) In the User Group: Assign Users Screen -
Ö Click on “Assign Infosets” button
c) In the next screen, select the Infoset, which needs to be attached to the
User Group selected
d) Click on the “Back” button
Step 4: Creating Query – SQ00 & SQ01
Follow the menu path – SAP Menu > Tools > ABAP Workbench > Utilities > SAP Query > Queries
a) In the “Query from User Group: Initial Screen -
Ö Click on “Other User Groups” button
Ö In the pop-up screen, User Groups, select the User Group for which the
Query has to created. The pop-up screen closes.
Ö Enter the Query Code in the “Query” field
Ö Click on “Create” button
b) A pop-up screen “Restrict Value Range” shows the list of Infosets assigned to
the User Group
Ö Select the Infoset for which Query has to be created
c) In the new screen Create Query: Title, Format -
Ö Enter the Description of the Query in the “Title” field
Ö Click on the “Next Screen” button
d) In the Select Field Group” screen
Ö Select the Field Groups from which Data Fields have to be selected for the
Output
Ö Click on the “Next Screen” button
e) In the “Select Field” screen -
Ö Select the Data Fields, which should appear in the output
Ö Click on the “Next Screen” button
f) In the Screen “Selection” -
Ö Select the Data Fields for the selection criteria
Ö Enter the sequence in which the selected fields would appear in the input
screen of the query.
Ö Define if the selection criteria should be Single Value or Multiple Value Range
by clicking in the appropriate check boxes
Ö Click on the “Basic List’ button
g) In the screen “Query Layout Design” -
Ö Select the Output Fields from the Data Fields section by clicking the
appropriate check box
Ö Change the sequence of Data Field columns if required
Ö Click on the “Test” button to test the query created
h) On the “Test Query” screen click “Continue”
i) In the “Query” screen -
Ö Enter the selection criteria
Ö Click on “Execute” button
j) Save the Query created
Step 5: Running the Query – SQ00
a) In the Query From User Group: Initial screen –
b) Click on “Other User Groups” button to select the User Group
c) In the pop-up screen “User Groups” select the User Group
d) System lists all the queries created for the User Group
e) Select the appropriate Query
f) Click on “Execute” button
g) User is taken to the Selection screen
h) Enter the selection criteria and click on “Execute” button
i) System runs the query and gives the output
Regards,
Murali.

Similar Messages

  • How to create user function in Data Functions in Query Designer?

    Could someone tell me how to create user function in Data Functions in Query Designer?
    I mean function like "NDIV0" in Data Functions.
    SAP BW 3.x.
    Query Designer (SAP BW 3.x)

    Hi check the following URL, it gives how to add in Formulas in formula Builder, not in DataFunctions.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f095592f-42f7-2a10-6ab1-c836a559b48f
    Thanks
    Reddy

  • How to create search function (af:query) using method in java

    hi All..:)
    i got problem with search custom (af:query), how to create search function/ af:query using method in java class?
    anyone help me....
    thx
    agungdmt

    Hi,
    download the ADF Faces component demo sources from here: http://www.oracle.com/technetwork/testcontent/adf-faces-rc-demo-083799.html It also has an example for creating a custom af:query model
    Frank

  • In BOX R2 Universe how to create External Function in C++??

    Hi All,
    Can any one tell me how to create dynamic SQL Query in BOXI R2 Universe, I heard that we can create c++ custom external functions.
    i know the procedure for using Oracle functions but that is taking more time to generate report.
    I want to create a conditional statement inside universe
    Following are three queries
    Query1 = select a,b,c,d from aab where a=@Prompt(jjjjjjj)
    Query2 = select a,b,c,d from aab where a=oracleFunction(@Prompt(jjjjjjj))
    Query3 = select a,b,c,d from aab where a=@myFunc(@Prompt(jjjjjjj))
    The above example is a simple one but in my real senario that function is called 120 times in my single query.
    Query1 takes 7 minutes
    Query2 takes 30-35 minutes (as that oracle function is called 120 times)
    So i want to create a custom external function in c++ so that the conditional expression is evaluated at BOBJ Server and the result of that function goes as a normal static string to oracle server.
    so it will again reduce the time
    Any ideas..

    Hi Mehmet,
    Please provide following information:
    1. How are you creating these functions (are you creating a Webi Extension Point)?
    2. How are you compiling these functions?
    3. Are you using Visual Studio to create these functions?
    Webi Rich Client is a 32 bit application so a function which is compiled in 32 bit mode would be visible in it.
    To access these functions through BI LaunchPad which is a 64bit application, we need to compile the function in x64 mode.
    Also make sure you compile the function in Release mode.
    Hope this helps.
    Regards,
    Vinit Shete

  • How to create a function with ref_cursor as parameter in OWB 10.1

    Hi,
    Can any one help me how to create a function with ref_cursor as parameter in OWB 10.1.?
    Its urgent. Please help me.
    Thanks,
    Siv

    Hi David,
    Thanks for your reply.
    Before going for this function, I need to create a package in transformation node in owb module.
    My package is as follows,
    Create or replace package 123
    type xxx is RECORD ( parameters);
    type yyy is RECORD (parameters);
    type aaa is table of yyy;
    type bbb is REF CURSOR return xxx;
    type ccc is record (parameters);
    type ddd is ref cursor return eee;
    END;
    How can I create the above kind of package manually in OWB 10.1 (Should not to import the package)
    Please help me its urgent.
    Thanks,
    Siv

  • How to create a function group (step by step)?

    I would like to know how to create a function group, step by step.
    step 1 do....
    step 2 do ...

    also,
    Go to SE80 for creating a function group.
    Also have a look at below link.
    http://help.sap.com/saphelp_nw04/helpdata/en/d1/801ef5454211d189710000e8322d00/frameset.htm
    i.e.
    TCODE - SE80
    Choose - Function Group ,it wil ask to create..
    Create and then activate..give a name starting with Z .
    Other way is go to tcode SE37.
    In the menu,there is a option in sub menu for creating function group.
    Just create it by clicking that and give names starting with z or y.

  • HOW TO CREAT VARIANT IN QUERY

    Hi,
    its very simple question but i want the procdure for it.
    how to creat variant in query &maintain?don't give URL's i try it already plzzz.any body have the steps regarding this topic..
    plzzzzzzzz urgent ...
    thanks,
    goodyear..

    Hi,
    If you're using the BEx Analyzer, you can create a variant at the variable selection screen. There is a button "save as variant" and you can also maintain existing variants.
    Best regards.
    LauQ

  • Pls give some ideas? how to create a function.

    Make an MS-Access form to accomplish:
    Use a list box to display part-time employees and their assignments (SSN, Hours, FullName). Include only those who currently work a total of less than 40 hours/week.
    SSN , Hours and FullName are stored in 2 different table.
    I have no idea how to implement this function. How to create this function to get SSN, Hours and LastName and FirstName (RecordSet which will be used in application)?
    Thanks alot!

    I'm afraid this is an Oracle forum, not an MS-Access forum.
    ;)

  • How to create menu function for link to open file

    Hi,
    I need help how to create menu function for link to access file and allow user to save the file when click on it.
    The file will keep inside server.
    Thank you.
    Regards,
    Wilson

    I need help how to create menu function for link to access file and allow user to save the file when click on it.
    The file will keep inside server.AFAIK, you have to write a custom code to achieve this and Oracle does not provide this functionality.
    If you want to store the file as an attachment, please see (How to Store Image/PDF Attachments on the File System in 11i and R12 (like Attachment File Directory) [ID 294525.1]).
    Thanks,
    Hussein

  • How to Create the Function Module Exit

    Hi,
      How to Create the Function Module Exit. Please tell me the step by step procedure.

    Hi,
    Check this link for how to create the function module exit..
    http://sap.niraj.tripod.com/id62.html
    Thanks
    naren

  • How to create an ABAP Query with OR logical expression in the select-where

    Hi,
    In trying to create an ABAP query with parameters. So it will select data where fields are equal to the parameters entered. The default logical expression is SELECT.. WHERE... AND.. However I want to have an OR logical expression instead of AND.. how can I attain this??
    Please help me on this.. Points will be rewarded.
    Thanks a lot.
    Regards,
    Question Man

    Hi Bhupal, Shanthi, and Saipriya,
    Thanks for your replies. But that didn't answer my question.
    Bhupal,
    You cannot just replace AND with OR in an ABAP QUERY. ABAP QUERY is a self generated SAP code. You'll just declare the tables, input parameters and output fields to be displayed and it will create a SAP standard code. If you'll try to change the code and replace the AND with OR in the SAP standard code, the system will require you to enter access key/object key for that particular query.
    Shanthi,
    Yes, that is exactly what need to have. I need to retireve DATA whenever one of the conditions was satisfied.
    Saipriya,
    Like what I have said, this is a standard SAP code so we can't do your suggestion.
    I have already tried to insert a code in the ABAP query (there's a part there wherein you can have extra code) but that didn't work. Can anybody help me on this.
    Thanks a lot.
    Points will be rewarded.
    Regards,
    Question Man

  • How to create a dyanamic query in PL/SQL from XML

    Hi Forum,
    I am having an XML file with tags. I am controlling my JSP page layout with these tags and it is working fine. But I need to send the Orange colour nodes to a pl/sql in the JSP page to construct the query as per the XML
    <?xml version="1.0"?>
    <Jobmanage>
    <Customer name="StGeorge">
    <Column>
    <Name>QM_NUMBER</Name>
    <Title>Job Number</Title>
    <Width>10</Width>
    <Font>Arial</Font>
    <Size>10</Size>
    <Align>center</Align>
    <Display>Yes</Display>
    <cloumn1> QM_NUMBER <column1>
    </Column>
    <Column>
    <Name>QM_JOB_STATUS</Name>
    <Title>Job Status</Title>
    <Width>10</Width>
    <Font>Arial</Font>
    <Size>105</Size>
    <Align>center</Align>
    <Display>Yes</Display>
    <column2>QM_JOB_STATUS</column2>
    </Column>
    <Column>
    <Name>QM_USER_STATUS</Name>
    <Title>User Status</Title>
    <Width>10</Width>
    <Font>Arial</Font>
    <Size>10</Size>
    <Align>center</Align>
    <Display>Yes</Display>
    <column3>QM_USER_STATUS</column3>
    </Column>
    </Customer>
    </Jobmanage>
    The select statement I am using n the JSP page is
    SELECT Q.QM_NUMBER, Q.QM_JOB_STATUS, Q.QM_USER_STATUS FROM QMI Q WHERE ((Q.QM_JOB_STATUS IN (5, 6, 7, 8, 9, 10)) OR (Q.QM_JOB_STATUS IN (12) AND Q.QM_CLOSE_DATE >= SYSDATE - INTERVAL '6' MONTH))
    Can you give me instructions how to create the above SQL statement dynamically as per the XML file. I want the select statement in a pl/sql
    BEGIN
    SELECT Q.QM_NUMBER, Q.QM_JOB_STATUS, Q.QM_USER_STATUS FROM QMI Q WHERE ((Q.QM_JOB_STATUS IN (5, 6, 7, 8, 9, 10)) OR (Q.QM_JOB_STATUS IN (12) AND Q.QM_CLOSE_DATE >= SYSDATE - INTERVAL '6' MONTH))
    END
    So, when ever the columns hirerachy changed in the XML file it should show theat effect in the PL/SQl. Thats hoe I am aiming to develop.
    Thankx for you time.
    Cheers,
    Krishna

    I want the select statement in a pl/sql BEGIN
    SELECT Q.QM_NUMBER, Q.QM_JOB_STATUS, Q.QM_USER_STATUS FROM QMI Q WHERE ((Q.QM_JOB_STATUS
    IN (5, 6, 7, 8, 9, 10)) OR (Q.QM_JOB_STATUS IN (12) AND Q.QM_CLOSE_DATE >=
    SYSDATE - INTERVAL '6' MONTH)) ENDThat doesn't make sense. Such a plsql block would not compile. What is your final goal you want to achieve with this?

  • How to create a function with dynamic sql or any better way to achieve this?

            Hello,
            I have created below SQL query which works fine however when scalar function created ,it
            throws an error "Only functions and extended stored procedures can be executed from within a
            function.". In below code First cursor reads all client database names and second cursor
            reads client locations.
                      DECLARE @clientLocation nvarchar(100),@locationClientPath nvarchar(Max);
                      DECLARE @ItemID int;
                      SET @locationClientPath = char(0);
                      SET @ItemID = 67480;
       --building dynamic sql to replace database name at runtime
             DECLARE @strSQL nvarchar(Max);
             DECLARE @DatabaseName nvarchar(100);
             DECLARE @localClientPath nvarchar(MAX) ;
                      Declare databaselist_cursor Cursor for select [DBName] from [DataBase].[dbo].
                      [tblOrganization] 
                      OPEN databaselist_cursor
                      FETCH NEXT FROM databaselist_cursor INTO @DatabaseName
                      WHILE @@FETCH_STATUS = 0
                      BEGIN       
       PRINT 'Processing DATABASE: ' + @DatabaseName;
        SET @strSQL = 'DECLARE organizationlist_cursor CURSOR
        FOR SELECT '+ @DatabaseName +'.[dbo].[usGetLocationPathByRID]
                                   ([LocationRID]) 
        FROM '+ @DatabaseName +'.[dbo].[tblItemLocationDetailOrg] where
                                   ItemId = '+ cast(@ItemID as nvarchar(20))  ;
         EXEC sp_executesql @strSQL;
        -- Open the cursor
        OPEN organizationlist_cursor
        SET @localClientPath = '';
        -- go through each Location path and return the 
         FETCH NEXT FROM organizationlist_cursor into @clientLocation
         WHILE @@FETCH_STATUS = 0
          BEGIN
           SELECT @localClientPath =  @clientLocation; 
           SELECT @locationClientPath =
    @locationClientPath + @clientLocation + ','
           FETCH NEXT FROM organizationlist_cursor INTO
    @clientLocation
          END
           PRINT 'current databse client location'+  @localClientPath;
         -- Close the Cursor
         CLOSE organizationlist_cursor;
         DEALLOCATE organizationlist_cursor;
         FETCH NEXT FROM databaselist_cursor INTO @DatabaseName
                    END
                    CLOSE databaselist_cursor;
                    DEALLOCATE databaselist_cursor;
                    -- Trim the last comma from the string
                   SELECT @locationClientPath = SUBSTRING(@locationClientPath,1,LEN(@locationClientPath)-  1);
                     PRINT @locationClientPath;
            I would like to create above query in function so that return value would be used in 
            another query select statement and I am using SQL 2005.
            I would like to know if there is a way to make this work as a function or any better way
            to  achieve this?
            Thanks,

    This very simple: We cannot use dynamic SQL from used-defined functions written in T-SQL. This is because you are not permitted do anything in a UDF that could change the database state (as the UDF may be invoked as part of a query). Since you can
    do anything from dynamic SQL, including updates, it is obvious why dynamic SQL is not permitted as per the microsoft..
    In SQL 2005 and later, we could implement your function as a CLR function. Recall that all data access from the CLR is dynamic SQL. (here you are safe-guarded, so that if you perform an update operation from your function, you will get caught.) A word of warning
    though: data access from scalar UDFs can often give performance problems and its not recommended too..
    Raju Rasagounder Sr MSSQL DBA
          Hi Raju,
           Can you help me writing CLR for my above function? I am newbie to SQL CLR programming.
           Thanks in advance!
           Satya
              

  • How to create business functions and expose as webservice?

    Hi...
      How to use Java to create business functions and expose that as a webservice.

    Hi Leela,
    Can you please post the answer to the question posed?
    We are also looking for a similar implementation in our integration and would really appreciate any help.
    Regards

  • How to create a select query to compare a collection via jpa?

    I'm new to jpa (java persistence) and its query language.
    If I've an entity named "Person" with a collection of Addresses (a one-to-manay relationahip), how do I create a Select query to get a person by using a collection of Addresses as its input parameter?
    Would "SELECT p FROM Person p JOIN p.addresses = :addresses" work?

    Hi,
    You can try the below logic:
    STATISTICS.date_reg} >= '27-may-2011' and { STATISTICS.date_reg} < ' 27-June-2011'
    I guess you are trying to apply this condition.
    Here in selection formula you need not to give select and from.
    Cheers,
    Kiran

Maybe you are looking for

  • How to keep checked items in report

    all I've a interactive report  which has checkbox column but when I click pagination next or prevoius the checked item are lost. how can I keep checked rows when I paginate in apex 4.2? regards

  • Unable to rename document name on ItemAdded event programmatically

    Hi, I have developed a Event Receiver on Item Added event basically to update the document name after document gets uploaded to SharePoint Library. I have developed below code but its getting failed at on Item.Update(); function call. Referred this M

  • Some websites, like Amazon and Shutterstock became garbled after I updated Java.

    Some websites, like Amazon and Shutterstock show up completely garbled. I suspect problems with Javascript, and I'm pretty sure the issue started after I updated Java. I did all the troubleshooting tips listed on this site, and none helped. I booted

  • N95 screen lights don't always work

    Hi guys just got my nokia replacement but the screen lights don't always work. They work sometimes then go off. Any ideas? Its not who i am underneath. But what i do that defines me. You are here for a reason Superman. "Come to me son of Jor-EL. KNEE

  • Proxy issue in Mozilla!

    Hi All, In my applcation we have three users like.. 1. Admin 2. Customer 3.Public user.. The problem is in public user, since for them there is no need to access using authentication, which is working fime in IE, but when we have tried using mozilla