Extracting the result of a query into a internal table

Hi,
Does anyone knows or have an idea how to extract the result of a query into a internal table, is there a function module or BAPI?
Thanks in advance,
CK

So then normally I would use a statment like:
IFunctionTemplate ftemplate = repository.getFunctionTemplate("<b>BAPI_SALESORDER_GETLIST</b>");
to call a particluar function, but I tried using
IFunctionTemplate ftemplate = repository.getFunctionTemplate("<b>BAPI_MDDATAPROVIDERBW_GETCATALOGS</b>");
and it did not seem to work. I also tried -
IFunctionTemplate ftemplate = repository.getFunctionTemplate("<b>MDDataProviderBW.GetCatalogs</b>");
How do I format the function?
Thanks
Paul

Similar Messages

  • How many records are  fetched my query into my internal tables

    Hi
    I am in the debugger, would like to know, how many records are  fetched my query into my internal tables. How do I  find out ?
    thanks
    siva

    Hi,
    Do the following,
    Step 1:
      Fill your internal table with select query.
    Step 2 : Use DESCRIBE statement with LINE addition to get the no of rows in the internal table.
    for further informations, check
    http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3798358411d1829f0000e829fbfe/content.htm
    Regards,
    Anirban

  • To eliminate the duplicate entries while looping into final internal table

    Hi friends,
    IAam facing the follwoing problem.
    Get Shipment for the Delivery number
          SELECT tknum
                 vbeln
                 INTO TABLE lt_vttp
                 FROM vttp
                 FOR ALL ENTRIES IN lt_vbfa
                 WHERE vbeln = lt_vbfa-vbelv.
        IF sy-subrc EQ 0.
          SELECT vbeln kunnr
                 FROM likp
                 INTO TABLE lt_likp
                 FOR ALL ENTRIES IN lt_vttp
                 WHERE vbeln = lt_vttp-vbeln.
      endif.
    now iam my internal table lt_vttp i have following values
       shipment             delivery
          1000                  2000
          1000                 2001
    in my internal table lt_likp i have the follwoing values
          delivery              shipto
           2000                  ABC
           2001                  ABC
    now iam looping those values in a final internal table.
      LOOP AT lt_likp INTO ls_likp.
        CHECK sy-subrc EQ 0.
         READ TABLE lt_vttp INTO ls_vttp WITH KEY vbeln = ls_likp-vbeln BINARY SEARCH.
        CHECK sy-subrc EQ 0.
             SELECT SINGLE * FROM vttk INTO ls_vttk
                    WHERE tknum = ls_vttp-tknum.
                  CHECK sy-subrc EQ 0.
                APPEND ls_vttk TO lt_vttk.
       endloop.
    Now my problem is if the shipment is same and the shipto is same then need to eliminate the duplicate records.
            in internal table iam getting 2records with same shipment and shipto combination.
           but instead if both the shipment and shipto are same then i should elimate the duplicate entries.
    and for the same shipment if i have differnt shipto then i neeed those 2 value.
    can any body tell me how can i get that.
    Regards
    Priyanka.

    Hi Priyanka,
    In your code you are using seelct statement inside the loop which will affect the performance.
    So, declare a another internal table which contains your both shipment and shipto elements with other required fields, say the name is lt_new.
    sort lt_new by shipment shipto.
    delete adjacent duplicates from lt_new comparing shipment shipto.
    "then use for all entries to choose values from VTTK.
    Hope this helps you.
    Regards,
    Manoj Kumar P

  • How to spool the result of an query into a file in sql 2000

    Hi All,
    I have an SQL query which iterates through number of times for checking on some conditions and will return results each time. I wants to save the results into an different xml file each time. I tried using below query:
    exec xp_cmdshell 'bcp "use Mimsadaptorlogs; select top 10 * from log order by logdate" queryout "D:\cdr_cg.xml" -T -c -t,'  ---> Its not working as expected.
    I got the Below output:
    NULL
    Starting copy...
    SQLState = 01000, NativeError = 5701
    Warning = [Microsoft][ODBC SQL Server Driver][SQL Server]Changed database context to 'MIMSAdaptorlogs'.
    NULL
    10 rows copied.
    Network packet size (bytes): 4096
    Clock Time (ms.): total       62
    NULL
    Could you anuone please suggest me on this.......
    Thanks and Regards, Bala

    You will need to write a client program to do this. SQL Server is not intended for writing files. People still do it by calling BCP through xp_cmdshell, but this is a dubious practice. Better is to write a CLR stored procedure for the task. However, you
    are on SQL 2000, and the CLR support was added in SQL 2005. Furthermore, there is no XML type in SQL 2000, and the only way to generate XML is with the FOR XML clause. But this output is not well understood by BCP. Then I try: [code} bcp "SELECT * FROM Northwind..Customers
    FOR XML RAW" queryout slask.bcp -c -T [/code] on SQL 2000, I get [code] 11 rows copied. [/code] which is complete hogwash, because there are 91 rows in that table, and the output should be a single XML document, and the output looks like this: [code] <row
    CustomerID="ALFKI"... Bouchers" City="Marseil... tomerID="DUMON" Company... 0.32.21.21" Fax="40.32.... los Hern ndez" ContactT... n Steel" ContactTitle="... e" ContactTitle="Market... ="Salzburg" PostalCode=... " Phone="(21) 555-3412"... ty="Charleroi" PostalCo...
    <row CustomerID="WARTH"... [/code] I have truncated the output on the right side, but the left side is authentic. It really is that bad.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Exporting the results of a query into excel

    Hi,
    Here's my code for exporting a cfm page into a spreadsheet:
    <cfsetting enablecfoutputonly="Yes">
    <cfcontent type="application/msexcel">
    <cfheader name="Content - Disposition" value="filename=myReport.xls">
    <cfquery name="getInfo" datasource="#dsn#">
    SELECT      id, fname, lname, orgname, email, phone, topic, synopsis, pdf, expertise, fiscal_year, date_added
    FROM         table
    </cfquery>
    <table border="1" cellspacing="1">
    <tr>
    <td>EFRI 2011 Submissions (Total Submissions: <cfoutput>#getInfo.recordcount#</cfoutput>)</td>
    </tr>
    <tr>
    <td>Record Number:</td><td>Last Name</td><td>First Name</td><td>E-mail</td>
        <td>Phone</td>
        <td>Organization</td>
    <td>Expertise</td>
    </tr>
    <cfoutput query="getInfo">
    <tr>
    <td>#currentRow#. #lname#</td>
    <td>#fname#</td>
        <td>#email#</td>
        <td>#phone#</td>
        <td>#orgname#</td>
    <td>#expertise#</td>
    </tr>
    </cfoutput>
    </table>
    and here's the error that I'm getting.  What is wrong with the code?
    500
    Corrupt form data: no leading boundary:  != -----------------------------7d96c1140276
    java.io.IOException: Corrupt form data: no leading boundary:  != -----------------------------7d96c1140276
         at com.oreilly.servlet.multipart.MultipartParser.<init>(MultipartParser.java:174)
         at com.oreilly.servlet.multipart.MultipartParser.<init>(MultipartParser.java:93)
         at coldfusion.filter.FormScope.fillMultipart(FormScope.java:136)
         at coldfusion.filter.FusionContext.SymTab_initForRequest(FusionContext.java:428)
         at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:33)
         at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
         at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126)
         at coldfusion.CfmServlet.service(CfmServlet.java:175)
         at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
         at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
         at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
         at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
         at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
         at jrun.servlet.FilterChain.service(FilterChain.java:101)
         at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
         at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
         at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
         at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
         at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
         at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
         at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

    try this
    <cfsetting showdebugoutput="false">
    <cfcontent type="application/msexcel">
    <cfheader name="Content-Disposition" value="attachment; filename=myReport.xls">  

  • How do I extract the data of Variant configuration into internal tables

    Hi Experts,
    How can I extract the data of variant configuration into an internal tables while preparing the report.
    Thanks,
    bsv.

    Hi i´m not a "Expert.." but may I can help you:
    CUCB_GET_VALUES_FROM_INSTANCE
    Example:
    Instance =  MARA-CUOBF  or
    Instance = lips-cuobj
    Result is the data of the Variant tables.
    I need that for a simple report to evaluate customer & and his Variants......
    Robert

  • How to execute a procedure depending on the result of a query?

    Hello, I'm new in ODI.
    I want to execute a procedure depending on the result of a query Oracle table.
    We have a Oracle Table whit a column that contains two possibles values.
    I want read the table, row by row, and depending on this value, execute a Procedure or execute another.
    How can i do?

    what you need to do is
    1. create a variable which "new_var2" which has the count of the number of rows you want to process. must be data type numeric.
    2. copy "new_var2" to the package screen.
    3. duplicate the "new_var2" on the package screen and evaluate the variable and test for "> 0" zero, call it "new_var2_E"
    3. create a new odi variable "new_var1" with a refresh of "select field1 fom (select field1,rownum as rownumber from tablex) where rownumber = #new_var2" in the relevant schema and technology.
    4. copy "new_var1" into your package (some where in the flow)
    5. right click the "new_var1" variable in you package screen and you should get the option duplicate step (click on that)
    6. select the the duplicate "new_var1" on the package screen and correct the the name to something meaning full to you "new_var1_E", also change the "type" to "evaluate variable" then you should see a "value" box. enter one of the values you want to test in the box (remember do not put in quotes ' )
    7. now back on the package screen join the "new_var1" to the "new_var1_E" with an OK line
    8 you now join "new_var2" to "new_var2_E" with OK
    9 you join "new_var2_E" to "new_var1"
    10. you then join the "new_var1_E" with an OK or a KO line to the relevant procedure.
    12. you need to duplicate "new_var2" in the package screen one more time this time and call it "new_var2_D" set the type to evaluate and then select the increment of -1
    13. the relevant procedure to "new_var2_D" with an OK
    14. join the "new_var2_D" to the "new_var2_E" with an OK
    15. this should close off the loop now the exit point is "new_var2_E" with a KO line to the next part of your process....
    Basically you should end up with a loop on new_var2 decementing, and it is used to get a specific next record row from your table.
    Hope this helps, sorry it is a little long winded..
    Edited by: DavidGD on Feb 8, 2009 3:29 PM

  • I need return the result of a query on a stored procedure

    I need return the result of a query on a stored procedure, I mean when I execute a stored procedure it returns a result set as a select query.
    Best regards...

    If you want some pl/sql code that can be used in a query as it were a table you may be interested in table functions:
    SQL> create or replace type
      2  t_emp is object (
      3  name            varchar2(30),
      4  hire_date date,
      5  salary       number);
      6  /
    Tipo creato.
    SQL> create or replace type
      2  t_emptab is table of t_emp;
      3  /
    Tipo creato.
    SQL> create or replace function tab_fun(p_dept in number)
      2  return t_emptab is
      3  e t_emptab;
      4  begin
      5    select t_emp(ename,hiredate,sal)
      6      bulk collect into e
      7      from emp
      8     where deptno=p_dept;
      9
    10    return dip;
    11  end;
    12  /
    Funzione creata.
    SQL> select *
      2  from table(tab_fun(20));
    NAME                           HIRE_DATE  SALARY
    SMITH                          17-DIC-80        800
    JONES                          02-APR-81       2975
    SCOTT                          09-DIC-82       3000
    ADAMS                          12-GEN-83       1100
    FORD                           03-DIC-81       3000A procedure cannot be used in a select statement.
    Max
    http://oracleitalia.wordpress.com

  • Can intermedia be used to index the results of a query

    The objective is to search for a key word in the results from two different tables got by a jointed query

    Or, you could try something like
    select ...
    from contextIndexedTable
    where contains(textColumn, 'keyword') > 0
    and rowid in
    (select rowid from contextIndexedTable
    where contains(textColumn, 'origquery') >0)
    Should work, but not sure how it will perform. You could also place the rowids
    from the original query into a temporary table and modify the query above to join to that first-level table instead of re-running the query. That may perform better.
    If your original query is all text, you can
    simply extend the text query:
    (originalquery) AND (newquery)
    but I get the sense that the original query involves structured conditions.

  • How do you use BOBJ SDK to retrieve the results of a query in XML

    I am trying to programatically get the results of a query given the query id
    My old code used BusinessObjects Enterprise Web Services API to  Retrieve a document's contents
    DocumentInformation biDocInfo;
    RetrieveData retBOData = RetrieveData.Factory.newInstance();
    Action[] actions = new Action[1];
    retBOData.setRetrieveView(xmlView);
    biDocInfo = rEngine.getDocumentInformation(queryId, null, actions, null, retBOData);
    (XMLView) biDocInfo.getView();
    Is there an equivalent way to retrieve the results of the query using SAP BusinessObjects BI 3.x Developer SDK Library ?
    Thanks for any information

    Hello.
    Are you wanting to use the BusinessObjects Enterprise SDK along with the Report Engine SDK as opposed to using the Web Services SDK that you were using previously?
    Also, what part of a webi document are you trying to get the XML format of?
    - Whole document
    - Single report within a document
    - Report page of a report
    - Report part within a report
    - All data providers
    - Single data provider
    If you are trying to use Business Objects Enterprise along with the Report Engine SDK, there are numerous samples for the various parts of the webi document that I mentioned above available at the following link:
    http://wiki.sdn.sap.com/wiki/display/BOBJ/JavaReportEngineSDKSamples
    I hope that this information helps.
    Regards.
    - Robert

  • Procedure to save the output of a query into excel file or flat file

    Procedure to save the output of a query into excel file or flat file
    I want to store the output of my query into a file and then export it from sql server management studio to a desired location using stored procedure.
    I have run the query --
    DECLARE @cmd VARCHAR(255)
    SET @cmd = 'bcp "select * from dbo.test1" queryout "D:\testing2.xlsx;" -U "user-PC\user" -P "" -c '
    Exec xp_cmdshell @cmd
    error message--
    SQLState = 28000, NativeError = 18456
    Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Login failed for user 'user-PC\user'.
    NULL
    Goel.Aman

    Hello,
    -T:
    Specifies that the bcp utility connects to SQL Server with a trusted connection using integrated security. The security credentials of the network user,
    login_id, and password are not required. If
    –T is not specified, you need to specify
    –U and –P to successfully log in.
    -U:
    Specifies the login ID used to connect to SQL Server.
    Note: When the bcp utility is connecting to SQL Server with a trusted connection using integrated security, use the
    -T option (trusted connection) instead of the
    user name and password combination
    I would suggest you take a look at the following article:
    bcp Utility: http://technet.microsoft.com/en-us/library/ms162802.aspx
    A similar thread regarding this issue:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/b450937f-0ef5-427a-ae3b-115335c0d83c/bcp-connection-error-sqlstate-28000-nativeerror-18456?forum=sqldataaccess
    Regards,
    Elvis Long
    TechNet Community Support

  • Can you store the resultSet from a query into a vector?

    I am totally frustrated. How the heck does one store the results of a query (resultSet) in a vector so that I can get the vector from my jsp page to display in a table.? searchRS is my resultSet from stmt.executeQuery().
    public Vector storeResultSet ()throws SQLException
    int dataType;
    Vector rows = new Vector();
    System.out.println("INSIDE SEARCHQUERY VALUE OF searchRS: " + searchRS);
    // Get the ResultSetMetaData. This will be used for the column headings
    ResultSetMetaData rsmd = searchRS.getMetaData();
    // Get the number of columns in the result set
    int numCols = rsmd.getColumnCount ();
    columnNames = new String[numCols];
    System.out.println("inside of store results and column count of rsmd is: " + numCols);
    boolean more = searchRS.next();
    while (more)
    Vector testData = new Vector();
    for(int i=0;i<numCols;i++)
    Object value = searchRS.getObject(i);
    rows.add(value);
    System.out.println("VALUE of testData vector is: " + rows);
    more = searchRS.next ();
    rows.add(testData);
    System.out.println("This is the populated vector in storeSearchResults " + rows);
    return rows;
    }>

    The OP has initiated a new thread asking this question, it's here
    http://forum.java.sun.com/thread.jspa?threadID=5162925
    Please don't created duplicate threads! If you feel you have to create a new thread for this question, post here and explain (as I did) so that no further replies will be posted to this thread.

  • Using the results of one Query in a workbook as a filter in another query

    Hello!
    I'd like to have one workbook which my users can execute and the result from one Query (e,g, Customer Account Number) will then be used as a filter in a second query (which would be from a different cube).
    Can this be done?
    Cheers.

    Hi,
    As far as I understand your requirement, you want to pass the result of one query to another query as a filter.
    Well you can do this, by Using Replacement Path Variable.
    For e.g. you want to pass Values of Custmomer Account Number to another query. In the second query, create one variable on Customer Account Number with type Replacment Path. Here it will ask you to enter the name of the query from which you would like to take the values of Customer Account Number.
    When you will run the second query , it will execute the first query from which you want to read the customer accoutn number in the back-end. And it willl display the output the second query as per the valeus of customer account number.
    This will help.
    - Jaimin

  • Getting the actual size of the result of a query

    Hi,
    I would like to ask if someone knows on how to get an estimate size of the result of a query on a table. To make it more specific, here is an example.
    Let us say I have this table called EMP and it has a column called DATE. I have issued a query like this:
    select * from EMP where DATE < to_date('01-AUG-08');
    I want to get the actual size of the result of the query in bytes or MB. How would i achieve this without creating another table and transferring the data on it.

    You can use SQL*Plus Autotrace to have the data size sent between client and database session:
    SQL> set autotrace traceonly statistics;
    SQL> select * from employees where hire_date < to_date('01/08/08');
    107 rows selected.
    Statistics
            430  recursive calls
              0  db block gets
            123  consistent gets
             11  physical reads
              0  redo size
           9405  bytes sent via SQL*Net to client
            457  bytes received via SQL*Net from client
              9  SQL*Net roundtrips to/from client
              3  sorts (memory)
              0  sorts (disk)
            107  rows processed
    SQL>Edited by: P. Forstmann on 25 janv. 2011 18:55

  • How to show only the result of a query

    Hi experts,
    i need to show only the result of a query (hiding all the rows)
    according to mathematical functions like sum, average, count ets. i need the result to be shown widhwise the query (Horizontal)
    thanks a lot
    Nir

    Hi
    I did get exactly.....but if i m right then you can do this by selecting the keyfigure goto the calculation tab select calculate result as sum or whatever you want to use.
    Regards
    Lalit k Tyagi

Maybe you are looking for

  • Audit is enable in local zone

    Audit is enabled and working fine in Global zone. root@MMS11:/var/audit# uname -a SunOS MMS11 5.11 11.2 sun4v sparc sun4v root@MMS11:/var/audit# root@MMS11:/var/audit# root@MMS11:/var/audit# pkg info entire           Name: entire        Summary: enti

  • Statistic Report - Key Figures Definition - Infoprovider 0TCT_MC01

    Hi Colleagues, What is the meaning of the KF 0TCTQUCOUNT ? Count for BI ApplObj ? It count the number of acces to a query by a user ? the number of navigational step in the query ? Thanks

  • Problem in ZMETHOD for sending email in WF Step?

    Hi all, I have written a zmethod to send mail to approvers. I am doin like this: SWC_GET_TABLE CONTAINER 'ZPERNR' LT_PERNR. *******fetch mail id of approver*********************** IF lt_pernr[] IS NOT INITIAL.    SELECT usrid_long FROM pa0105    INTO

  • Gift this app not received

    Hi guys and gals, My friend gift whatsapp to me. My iPhone 4s told me to turn on automatic download. I turned it on, but now nothing. Nothing downloading, nothing is happening. No email linking to anything either. Would be glad for any help in advanc

  • Apple TV from Singapore to a US Version

    we purchased and register our Apple TV in Singapore. Can we make it a US version as it has more options?  Is that possible?