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.

Similar Messages

  • Running a query from a called form programmatically

    Hi,
    I would like to run a query from a called form using the same criteria as the calling form used, this is my situation;
    I have a form with a field called IDNO when I execute the query I have code in the KEY-EXEQRY that first checks the HOLDER table to see if the IDNO exists if it does, the query will continue as normal and the record will be shown in the form, if it does not exist I have to query another table called DISTRIBUTOR which also has a field called IDNO. I would this to happen without any intervention from the user, in other words the the code that I have will call the second form and must execute the query. This is what I have so far in the KEY-EXEQRY.
    *************************************************************************8
    IF :holder.idno IS NOT NULL THEN
    DECLARE
    v_holder_idno xrays.holder.idno%type;
    v_distr_idno xrays.holder.idno%type;
    CURSOR holder_idno_cursor IS
    SELECT idno
    FROM holder
    WHERE idno LIKE :holder.idno
    ORDER BY idno;
    CURSOR distr_idno_cursor IS
    SELECT idno
    FROM distr
    WHERE idno LIKE :holder.idno
    ORDER BY idno;
    BEGIN
    OPEN holder_idno_cursor;
    FETCH holder_idno_cursor INTO v_holder_idno;
    CLOSE holder_idno_cursor;
    IF v_holder_idno IS NULL THEN
    OPEN distr_idno_cursor;
    FETCH distr_idno_cursor INTO v_distr_idno;
    CLOSE distr_idno_cursor;
    IF v_distr_idno IS NOT NULL THEN
    CALL_FORM('X_DISTRIBUTOR_FORM');
    /* This is where I need to populate the idno of the called form and execute the query and when the program gets back to the calling form the calling form should be in normal mode not query */
    END IF;     
    END IF;     
    END;
    END IF;
    execute_query;
    *************************************************************************************8
    can anyone help me with this problem?
    Thank you
    Michael

    Note something else...
    If the above document is not applicable to 9i then you can find many...many articles if you write on the 'search' utility of OTN 'integrate reports and forms ' .
    Simon

  • Regarding reading data from a file in the application server.

    Hello Everyone,
    My question is:
    The file in the application server consists of data with header, detail and trail out of which the detail contains the main information. The detail again contains the data in the form of a continuous string and again some spaces corresponding to a single record. I need to split the data in the internal table in such a way so that the first few characters get into field-1 of the target internal table. Again I need to consider the spaces for accessing the data for filling up in field-2. How do I decide on the 'Split' statement and specially when the whole string has to be taken care of as contatining data in a single string format without space and again some data after some spaces corresponding to a single record.
    Your help is very much needed. Thanks to all the experts in advance.

    Hi
      This is the sample code I was used for the similar requirement.
    DATA: single_line TYPE string .
    v_file_listings = pa_filn1.
    IF v_file_listings IS INITIAL .
    MESSAGE e039 WITH v_file_listings.
    ENDIF.
    *-- read file, split lines into fields and put data into table
    OPEN DATASET v_file_listings FOR INPUT IN TEXT MODE ENCODING NON-UNICODE. "Opening the files
    IF sy-subrc EQ 0.
    DO.
    READ DATASET v_file_listings INTO single_line. "Reading the content of file into line
    IF sy-subrc = 0.
    IF sy-index > 1. "skip header-line
    SPLIT "Split the content of line into work area
    single_line
    AT k_split
    INTO
    wa_listings-kschl " Condition type
    wa_listings-tabname16 " Condition table name
    wa_listings-vkorg " Sales organisation
    wa_listings-kunnr " sold-to party numberor ship-to party number
    wa_listings-matnr " Material Number
    wa_listings-kodatab " Valid-from date
    wa_listings-kodatb1. " Valid-to date
    APPEND wa_listings TO itab_listings. "Appending Work Area to internal table
    ENDIF.
    ELSE.
    EXIT.
    ENDIF.
    v_count1 = sy-tabix.
    ENDDO.
    Regards,
    Sreeram

  • How to delete string or line from unix file(dataset) of application server

    Hi  All,
    After transfer workarea information or all records into dataset(unix file). When I see the file in application server automatically the last line is shown a blank line. I am not passing any blank line.
    I have tried for single record than also the file generates the last line(2nd line) also a blank line.
    When I m reading the dataset, it is not reading the last blank line but why it is showing the last blank line?
    How to delete string or line from unix file(dataset) of application server?
    Please give your comments to resolve this.
    Thanks
    Tirumula Rao Chinni

    Hi Rio,
    I faced similar kind of issue working with files on UNIX platform.
    The line is a line feed to remove it use
    DATA : lv_carr_linefd TYPE abap_cr_lf VALUE cl_abap_char_utilities=>cr_lf. 
      DATA : lv_carr_return TYPE char1,                                   
             lv_line_feed   TYPE char1.                                          
      lv_line_feed   = lv_carr_linefd(1).
      lv_carr_return = lv_carr_linefd+1(1).
    Note: IMP: The character in ' ' is not space but is a special
    character set by pressing ALT and +255 simultaneosly
      REPLACE ALL OCCURRENCES OF lv_line_feed IN l_string WITH ' '.
      REPLACE ALL OCCURRENCES OF lv_carr_return IN l_string WITH ' '.

  • How to run ear file in java application server

    i want how to run .ear file in java application server
    1. i m created ear file
    2. i m created jar file (bean,home,remote)
    3.i m created war file(in the form of jsp)
    but till now i couldnt run ear file
    how to run
    please hel me

    You must create :
    1.Jar file
    2.War file
    And then put them into an ear file
    Exemple : myapp.ear contains
    myappEJB.jar
    myappWEB.war
    META-INF/application.xml
    and application.xml looks like this :
    <application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee
                            http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
        <display-name>myapp</display-name>
        <description>Demo application</description>
        <module>
            <ejb>myappEJB.jar</ejb>
        </module>
        <module>
          <web>
             <web-uri>myappWAR.war</web-uri>
             <context-root>/myapp</context-root>
          </web>
        </module>
    </application>Good luck

  • Define path in selection screen to write the output file to pres.  server

    Hi can anyone tell me how to declare a variable so that the user can specify his own path name in the selection screen to store the output file in the presentation server. and please tell me how to link up the output file to the selection screen specified path.
    thanks in advance.

    DATA: FILE_TAB TYPE STRING.
    SELECTION-SCREEN BEGIN OF BLOCK B02 WITH FRAME TITLE TEXT-B02.
    PARAMETERS:
               P_FILE TYPE RLGRAP-FILENAME OBLIGATORY LOWER CASE.
    SELECTION-SCREEN END OF BLOCK B02.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      PERFORM OPEN_FILE USING P_FILE.
    FORM OPEN_FILE USING L_FILE.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
          FILE_NAME     = L_FILE
        EXCEPTIONS
          MASK_TOO_LONG = 1
          OTHERS        = 2.
      IF SY-SUBRC <> 0.
        SY-MSGTY = 'I'.
        MESSAGE ID     SY-MSGID
                TYPE   SY-MSGTY
                NUMBER SY-MSGNO
                WITH   SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        STOP.
      ENDIF.
    ENDFORM.
    FILE_TAB = P_FILE.
      CALL FUNCTION 'GUI_DOWNLOAD'
    *Complete the FM
    Greetings,
    Blag.

  • Running mysqldump query from java code

    Hello,
    I m making a program I want to take a backup of database on a click of a button for which i want to execute this query :
    "mysqldump --user=root --password=root --opt dbname>c:\backup.sql"
    and my code is :
    String command = "cmd /c start";
    String[] env = new String[]{"mysqldump","--user=root", "--password=root",
    "--opt", "njitsurvey", "<", "c:\\backup_db.sql" };
    File dir = new File("C:/Program Files/MySQL/MySQL Server 5.0/bin/");
    Process p1 = Runtime.getRuntime().exec(command, env, dir);
    My problem is my command is running and going in to the directory also but not running my query and i m not getting and error also
    Edited by: purva on Aug 7, 2008 11:56 PM

    You need to print the content of the process error stream ( p1.getErrorStream() ) . It would also be worth you while reading http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html .
    Also, you seem to think that setting the working directory toFile dir = new File("C:/Program Files/MySQL/MySQL Server 5.0/bin/");makes this the directory from which 'mysqldum' is found. It is not. The directory containing the executable has to on the PATH. The working directory is where the process looks for and creates data files if the full path to the files is not provided.
    Edited by: sabre150 on Aug 8, 2008 10:41 AM
    Also, you seem to think that the 'env' is the command executed! It is not. It the set of environment variables. You need to put the whole of the command as the first argument.
    Edited by: sabre150 on Aug 8, 2008 10:46 AM

  • Urgent - Cannot run sub query from VB 6

    Hello!
    I'm having a problem with my Oracle OLE DB connection in windows using Visual Basic 6.0 SP3.
    I can run normal queries just fine, but a correlated sub query like this:
    select A.col_a, (select col_b from Tab_B where id = A.id) from Tab_A A
    returns the following error:
    "ORA-00907: missing right parenthesis"
    But I'm able to run the query witout errors in Toad with the correct result!
    So basically, I cannot run a (correlated?) sub query via OLE DB...
    What am I doing wrong?? Is it a parameter that I need to set on the connection of command?
    I'm not using stored procedures, only plain text SQL.
    Very thankful for a quick answer, this is really urgent. If you have the possibility, please e-mail me at:
    [email protected]
    Thank you in advance.
    Best regards,
    Bnar Baban

    Hi!
    I'm running the latest version of Oracle OLE DB...when checking more in detail, it seems that the provider parses the code in a way, that makes the "(select" part of the sub statement be interpreted as a column name....when it does not find a right parenthesis, but a white space, it complains.
    I switched to Microsoft MSDAORA provider, and now it works perfectly...
    /Bnar

  • How to run select query from one SID to fetch record from another SID?

    I have two SID, one is AAA and another is BBB and the connection name is A1 and B1 respectively. I want to run one select query from A1 connection to fetch record B1. Can anyone help me how I can connect from one SID to another SID?

    Hi 869357,
    You can also use the copy command. (Works with limited types)
    try:
    help copyRegards,
    Turloch

  • 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

  • Output File from the Saudi Payment Output File

    Dear All ,
    I want to ask where did oracle save or store the output file after I ran the request Saudi Payment Output File.
    I need to see the file , to send it for the Bank.
    best Regards.

    Pl post details of OS, database and EBS versions. Did the concurrent program complete without errors ? Pl post the contents of the concurrent log file.
    Pl also see MOS Doc 553518.1 (What is the Extension of Saudi Payment output file ? And where it is exist ?).
    HTH
    Srini

  • Open a pdf file located on Application Server from forms 10g

    Dear all,
    I want to open a pdf file which is stored in a folder on Application Server.
    I have the following codes but could not be able to open the file.
    1. host('rundll32 url.dll,FileProtocolHandler C:\REP012.pdf');
    in this code I mentioned the path on local machine which is okey.
    but the question is that how to open the file which is located in a folder on application server?
    the following code don't show and file or error:
    host('rundll32 url.dll,FileProtocolHandler /EMS/MANUALS/ACC001.PDF');
    This is the file on Application Server not on local machine.
    2. web.show_document('//EMS/MANUALS/ACC001.PDF/','_blank');
    This give HTTP 404 NOT FOUND error
    I think the problem is in path, how to mention the path of my Application Server file?
    Regards:
    Muhammad Nadeem

    Hi,
    Did you find a solution to this?
    We are running into the same problem where we need to open a file present on the application server (path /opt/webapps/applications/ISL/)
    When we try this from the local machine it works (path D:/forms) however it does not work while trying to open it from the application server.
    Regards,
    Pooja

  • 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

  • Need help in installing Oracle Application Server 10g Rel  Wireless Portion

    I am trying to install the OAP and need to enable or configure the wireless portion of it. I got this cpio file from Oracle site (as_linux_x86_101300_disk1.cpio & as_linux_x86_101300_disk2.cpio) and installed the OAP. I don't see any option to enable the wireless portion. runInstaller is showing only the basic installer option ( IntegratedWebserver,J2EE Server,Process Management). I have my OAP server running now and this on RedHat AS3.
    Oracle Application Server 10g Release 3 (10.1.3.0.0)
    Need help!!
    - G -

    You might find better assistance in the APplication Server forum - Oracle Application Server - General

  • From PL/SQL call java class present in Application server

    Hi,
    I need to call a java class file which is present on the application server. the call has to be made from pl/sql.
    I do not want to make use of the java stored procedures for this.
    Is there a way to call a class file residing on the application server from a pl/sql.
    Please help me out.
    Thanks & Regards
    Kamlesh

    New idea. DDL isn`t working but if i would make some DQL ? Like select??
    I`m trying to deploy java class like this:
    public class test {
         public static String say()
              throws SQLException{
                   Connection conn = new OracleDriver().defaultConnection();
                   String sql = "Select names from pdb_proteins where numbers=61";
                   try {
                        // Load the Oracle JDBC driver
                        Class.forName("oracle.jdbc.OracleDriver") ;
                        System.out.println("Oracle JDBC driver loaded ok.");
                        } catch (Exception e) {
                        System.err.println("Exception: "+e.getMessage());
                   try {
                        ResultSet rset = null;
                        PreparedStatement pstmt = conn.prepareStatement(sql);
                        rset=pstmt.executeQuery(sql);
                        String wynik = null;
                        wynik = rset.getString(1);
                        return wynik;
              } catch (SQLException e) {
                   System.out.println("Connection Failed! Check output console");
                   e.printStackTrace();
                   return "nope";
    Then invoke with PL/SQL function
    and i`m getting error ORA-29534: object SYSTEM.oracle/jdbc/OracleDriver
    Could someone help me with this? How i could register jdbc driver inside Oracle db??
    Edited by: Rado_mir on 2013-06-03 02:42

Maybe you are looking for