Sap query output to save on application server

Hi All,
I have one requirement, want to save the output of sap query on application server as a text file?
Is there any work around?
Regards
Vasumathi
Edited by: komma vasumathi on Nov 5, 2009 10:32 AM

Hi Vasumathi,
Application server path cannot be accessed unless otherwise using OPEN DATASET. More over, Infoset cannot be executed directly. It can be accessed through SAP Query only.
Writing Logic for 2 or 3 tables with Inner Join will not be a big deal. Writing Abap program will be optimum for you FTP requirement.
1. create a folder in AL11 as \sap\common\
2.  create z program and Declare sel-screen parameters : selopt1, selopt2
3. Query : Select Afield1 Afield2 Bfield1 Bfield2 from table1 as A inner join table2 as  B on Afield1 eq Bfield1 where Afield1 in selopt1 and Afield2 in selopt2  into corresponding fields of table itab.
4. creating file  at application sever
      w_fileloc = '\sap\common\file.txt'
     OPEN DATASET w_fileloc FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    . Loop itab into wa_itab.
      Transfer wa_itab to w_fileloc.
     clear w_fileloc.
    endloop.
5. goto AL11 and check the file file.txt in  folder \sap\common
Please let me know if you need more information or close this thread by offiering the points( If you are satisfied).
Regards,
Sakthivel N

Similar Messages

  • SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.  'Received Alerts' (OAIB)

    SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.  'Received Alerts' (OAIB)
    SELECT    
    CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
    WHEN T0.DocStatus = 'C' THEN 'CLOSED'  END  AS 'Document Status',
    T0.DocDate AS 'Posting Date',
    T0.DocNum AS 'Doc.No',
    T0.NumAtCard,
    T0.TransId AS 'Trans. No.',
    T0.Comments AS 'Remarks',
    T0.CardCode AS 'Offset Acct',
    T0.CardName AS 'Offset Acct Name',
    sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
    T3.DueDate AS 'Cheque Date',
    T3.CheckSum AS 'Amount'
    FROM         ODPO AS T0 LEFT OUTER JOIN
                          VPM2 AS T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
         OVPM AS T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
                          VPM1 AS T3 ON T2.DocEntry = T3.DocNum
    where T0.DocDate>='[%0]' and T0.DocDate<='[%1]'

    Hi,
    Try this:
    SELECT   
    CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
    WHEN T0.DocStatus = 'C' THEN 'CLOSED'  END  AS 'Document Status',
    T0.DocDate AS 'Posting Date',
    T0.DocNum AS 'Doc.No',
    T0.NumAtCard,
    T0.TransId AS 'Trans. No.',
    T0.Comments AS 'Remarks',
    T0.CardCode AS 'Offset Acct',
    T0.CardName AS 'Offset Acct Name',
    sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
    T3.DueDate AS 'Cheque Date',
    T3.CheckSum AS 'Amount'
    FROM         ODPO  T0 LEFT OUTER JOIN
                          VPM2  T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry
    LEFT OUTER JOIN
         OVPM  T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
                          VPM1  T3 ON T2.DocEntry = T3.DocNum
    where T0.DocDate >= '[%0]' and T0.DocDate <='[%1]'
    group by T0.DocStatus,T0.DocDate ,
    T0.DocNum ,
    T0.NumAtCard,
    T0.TransId ,
    T0.Comments ,
    T0.CardCode,
    T0.CardName ,
    T0.WTSum ,
    T3.DueDate ,
    T3.CheckSum
    Thanks & Regards,
    Nagarajan

  • Transfer SAP Query Output directly to SharePoint

    Hi,
    We are running the SAP Queries in the Background. I have a requirement to transfer the SAP Query output directly to SharePoint site. Could you please share your ideas on this?
    Regards,
    Siva.

    I don't have an answer but have the same issue.  Did you ever resolve?

  • Run BW query from R/3, need output file saved on application server

    Hello all,
    We are currently working on BI 7.0. Is there a way where we can run a BW query from R/3 by some program or tcode? We need to run the BW query and use the output of that query as an input to some other custom program in R/3.
    If we can save the output file on application server than the R/3 program will pick up that file from there.
    Is there any standard delivered functionality that will allow us to do that or how can we achieve this.
    Can some help help with some suggestions or links?
    Thanks in advance.

    Hi,
       Refer the following threads:
    [Calling BW Query from R/3;
    [Saving Bex Report / query in BW App server;
    Regards.

  • Save on application server

    hi.......
    Can u any one explain how to transfer data to application server.......

    Here is an example.
    report zrich_0001.
    parameters: d1 type localfile default '/usr/sap/TST/SYS/Test.txt'.
    data: begin of itab occurs 0,
          field1(20) type c,
          field2(20) type c,
          field3(20) type c,
          end of itab.
    data: str type string.
    constants: con_tab type x value '09'.
    * if you have a newer version, then you can use this instead.
    *constants:
    *    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
    start-of-selection.
    itab-field1 = 'ABC'.
    itab-field2 = 'DEF'.
    itab-field3 = 'GHI'.
    append itab.
    itab-field1 = '123'.
    itab-field2 = '456'.
    itab-field3 = '789'.
    append itab.
      open dataset d1 for output in text mode.
      loop at itab.
        concatenate itab-field1 itab-field2 itab-field2 into str
                      separated by con_tab.
        transfer str to d1.
      endloop.
      close dataset d1.
    Regards,
    Rich Heilman

  • Query to be saved in Application Server

    Hi Gurus ,
    We are on BI 7.0  SP 10 , We have a requirement, to send a Query Report to an Application Server .
    Is it Possible ??? If yes how ? Appreciate if you can give in detail how we can implement this in BI 7.0 .
    Waiting for a quick Reply .
    Thanks in Advance !
    Thanks & Regards
    Zeenath Syeda
    Hewlett Packard
    Singapore

    Hi Chetan ,
    Thanks for giving different options , but as i understand from Tcode RSCRM_BAPI, the report which we have done with queries or workbooks can't be sent through this Tcode as excel , it can be downloaded as .CSV or file fixed Length . We want the normal query or workbook need to be sent to the user at the application server in the form of formatted reports .
    So the only option left is the third one ie the KM using the EP .
    Any other option left apart from this for my this kind of requirement .
    Please suggest , if any .
    Thanks
    Regards
    Zeenath

  • SAP query output modification

    Dear all,
    Currently in one sap query having tables EKBE and other tables, output is comming. But now I need to add some more data from the table EKBZ to the same columns of the output which are from EKBE. If i use join then i need to use separate column for EKBZ, but i want EKBZ data ( additional records) to the same columns of EKBE in the output  in addition to to the records of EKBE . Please help me how to do this.
    Thanks,
    Prasad

    thanks for your reply dear. Actually its not my requirement.
    But I found the answer my self. I have created the separate internal table and selected the data directly from the database table ( like normal report) and inserted my records at the event 'At end of selection after processing' into the auto generated internal table using field symbols.

  • SAP Query  output  download to Excel

    Hi  All,
    Once I export/download  Query Output to Excel  the fields are not in the order of  Actul Query output
    <u><i><b>Char fields are treated as Key fields and displayed Left side.</b></i></u>
    As it is a SAP Query where to keep this kind of setting(key columns = 0).?
    Thanks in advance and useful answer will be awarded.
    cheers!!
    Komatsu

    when u download data to excel sheet, u can't handle the data from SAP....The data in excel takes excel properties and accordingly data gets adjusted to the formats of excel.
    If u need formatting u need to use OLE concepts in SAP from which u can set the formats of Excel Sheet.

  • SAP Query  output  download to excel   fields order is different

    Hi All,
    while download Query Output to Excel the fields are not in the order of actual Query output
    Char fields are treated as Key fields and displayed Left side.
    As it is a SAP Query where to keep this kind of setting(key columns = 0).?
    Thanks
    Komatsu

    when u download data to excel sheet, u can't handle the data from SAP....The data in excel takes excel properties and accordingly data gets adjusted to the formats of excel.
    If u need formatting u need to use OLE concepts in SAP from which u can set the formats of Excel Sheet.

  • SAP Query: How to filter records from SAP Query output before display

    Hi Friends,
      Can I delete records from an SAP query basic list before it is displayed?
    For example I want to delte all the orders whose system status is "RELEASED" before the basic list of that SAP query is displayed.
    I have gone through SAP help and found out that we can write some code in <b>END code</b> section which will execute before the basic list of the query is displayed. But I could not figure out how the code this...following is an excerpt form SAP help.
    <b>"The END-OF-SELECTION code consists of two parts (Before list output and After list output). The first part is processed before the list is output and the second part afterwards."</b>
    Can anybody help me?
    Regards,
    Bharat.
    Message was edited by:
            Bharat Reddy V

    Try this simple procedure. <b>Hope</b> this should work for you.
    You do the slection of the status in the List-Processing. say your final field of status flag is GF_STATUS.
    Immediatly after that use this within the List-Processing.
    CHECK GF_STATUS EQ '<RELEASED STATUS>'
    How it works:
    SELECT  <>       "<-------Query processing(system code).
    *< Your code put in the List processing
    CHECK GF_STATUS EQ '<RELEASED STATUS>'   "< --only released records passed.
    *>
    ENDSELECT      "<-----Query endselect(system code).
    Please let me know the result.
    Regards,
    A.Singh
    Message was edited by:
            Amarjit Singh

  • Extracting SAP Query,Infoset  Data from VB Application

    Hi,
    I need to get all SAP Queries,Infosets and SAP Query Group data from a VB application.
    I have found a Remote Enabled Function called    IQAPI_READ_QUERY_CATALOG.
    But when I call the Function from a VB application ,the call is not successful and even I am not getting any exception.
    The call is getting false with null exception .
    Can anyone please guide me.
    Or is there any other function module /procedure / table to extract SAP Query ,Infoset,SAP Query Group data??
    Thanks in Advance.

    http://stackoverflow.com/questions/3765373/how-do-i-do-a-select-distinct-using-a-sap-infoset-query

  • Output Technical Field Names in the SAP query Output

    Hi Experts,
    I am new to SAP Query/ABAP Query or Quick Viewer. Just would like to know if there is a way whereby I can print the technical field names as opposed to the English field headers. For example I want to print BUKRS in the place of CoCode.
    I have a vague feeling this could be possible through custom coding in SQ02 but have no idea which code section to choose.Any inputs greatly appreciated.
    thanks in advance,

    Hi Sreegopalan,
    Open your infoset in SQ02, by default in the left hand side you'll be having the tables that you have selected, double click the field name which you want change the long text, it will open a attributes window below your field group. Change the header data text as you wish.
    Please find the query documentation in the below link.
    [http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf]
    Regards,
    Nandha

  • SAP NW 7.0 AS JAVA Application Server Installation in DMZ : Win 2008 SR2

    Dear Experts,
    We are installing two AS JAVA application servers in DMZ (XYZ domain) and the central instance is running outside DMZ (ABC domain). While trying to give the profile path of the CI, in the application server installation, it says that the path cannot be found. We have opened the following ports 54200,54201,54204,54218,54230,3342,3641,3310,3610,8010,8011, and 25.  The installation inside DMZ is run with a user which is part of local administration group. The DB (SQL 2008R2)is running on a different host in a distributed setup.
    Could  someone please let us know if any other port needs to be open to allow communication between the central instance and application server?
    Help is appreciated.
    KP

    If FileSharing disabled, Firewal is open, unable to do ping test. How does the poor App server can access the Path from CI ?
    Please request your network team to open firewal between CI and APP server otherwise, even if you install you might get other below access problems
    1). user's in App server can't update CI
    2). Jobs in App server might run as expected.
    etc...

  • Sap Query in Background

    Hi Experts,
    is there a way to write the spool list of a sap query (run in background) to application server or to a logical file ?
    Thanks,
    Angelo.

    this dump appears mostly though not only when someting has been changed but maybe it's different for those HR queries. anyway: the query has obviously not been generated since it was last loaded. you can correct that in SQ01 by forcing the coding to be generated anew.

  • Save the o/p of the query in Application Server, Filename with Timestamp

    Dear Experts,
    I have a scenario that on 1st of every month, a query needs to execute and save the output of that query in Application Server, Filename along with Timestamp.
    For ex: Production_19/09/2011
    So, I Created a Query Extract in RSCRM_REPORT and gave the path name and scheduled. The output of the query is saved successfully in Application Server.
    But I need Timestamp along with Filename.
    Please help me out with the timestamp issues, how could I include Timestamp with Filename (Query Name).
    Thanks,
    SAP BI

    Hi chaith,
    You can achieve the result with out any code. You have to use the APD concept to extract the query to a file.
    check the following link which help you to create a logical path
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60e86545-9940-2d10-9f89-eb5bce1f9228?quicklink=index&overridelayout=true
    you can use the path in the APD.
    Regards,
    Ranganath

Maybe you are looking for