Saving an output in a file

Hi all, i am having problems with an assignment that i have. I have to prompt the user for a dna sequence and a description of that sequence and then save it to a file., but when i go to look at the file that i created, it give me the memory address of that sequence and then the description always returns null like i never set it. Can anyone help.
Sequence.java(you shouldn't need this but in case you do)
public class Sequence
    // instance variables - replace the example below with your own
    public String sequence;
    public String description;
    public double energy;
    public int number;
    public int temp;
    public double boltzman;
    public final double gasConstant = 1.9872;
     * Constructor for objects of class sequence
    public Sequence()
        // initialise instance variables
        sequence = " not set";
        description = "  not set";
        energy = 0;
        number = 0;
        temp = 0;
        boltzman = 0;
     /**initialize variables
     public Sequence(String aSequence, String aDescription)
         sequence = aSequence;
         description = aDescription;
     /** Sets the sequence
     public void setSequence(String aSequence){
         sequence = aSequence;
     /** Returns the sequence
     public String getSequence(){
         return this.sequence;
     /** Sets the description
     public void setDescription(String aDescription){
         description = aDescription;
     /** Returns the description
     public String getDescription(){
         return this.description;
     /** sets the energy
     public void setEnergy(double aEnergy){
         energy = aEnergy;
     /** returns the energy
     public double getEnergy(){
         return this.energy;
     /** sets number
     public void setNumber(int aNumber){
         number = aNumber;
     /** returns that number
     public double getNumber(){
         return this.number;
     /** sets temp
     public void setTemp(int aTemp){
         temp = aTemp;
     /** returns temp
     public int getTemp(){
         return this.temp;
      /** calculates the number of A's and T's
    public int countATs(){
        int count = 0;
        String at = "AT";
        for (int i=0; i < sequence.length(); i++)
            char ch = Character.toUpperCase(sequence.charAt(i));
            if(at.indexOf(ch) >= 0)
            count++;
        return count;
  /** calculates the number of C's and G's
    public int countCGs(){
        sequence = this.sequence;
        int count = 0;
        String cg = "CG";
        for (int i= 0; i < sequence.length(); i++)
            char ch = Character.toUpperCase(sequence.charAt(i));
            if(cg.indexOf(ch) >= 0)
            count++;
        return count;
     /** calculates boltzmann factor
     public double calculateBoltzman(){
        boltzman = Math.exp(-(energy)/(gasConstant*temp));
        return boltzman;
    /** calculates number-- number overflows when the integer exceeds 32-bits...(i.e. 4^200000000000)
    public int calculateNumber(){
        number = (int)Math.pow(sequence.length(),4);
        return number;
     * ToString method that returns the sequence.
     public String toString(){
         return super.toString()+" The Sequence is  "+ "\n"+this.sequence+"\n"+" The Description is "+"\n"+ this.description+"\n";
}SequenceTest.java <---where my problem is
import java.io.FileWriter;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.*;
* A Class to Sequence.
* @author (Corbin Blake)
* @version (10/20/04)
public class SequenceTest
public static String desc;  
public static String[] b;   
     public static void main(String[] args) throws IOException
      while (true)
          System.out.println("Welcome to my program!");
          try
              System.out.println();
              System.out.println("Enter d to enter a new DNA sequence, s to save the entered sequence to a file, and x to exit:  ");
              BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
              String input = console.readLine();
              Sequence aSequence = new Sequence();
              String[] sequenceArray = new String[10];
              if (input.equalsIgnoreCase("d"))
                //keeps track of exactly how many elements are being used in the array
                int sequenceSize = 0;
                // asks the user for an input
                System.out.println("Enter a DNA Sequence: ");
                // gets the input string from the user
                String input0 = console.readLine();
                //stores that input as an array
                sequenceArray = new String[input0.length()];
                String[] b = sequenceArray;
                //checks to see if arraysize needs to be doubled and doubles it if necessary
                if(sequenceSize >= sequenceArray.length)
                    MyUtilities.myarraycopy(sequenceArray);
                //enters a description
                System.out.println("Enter a Description of the Sequence: ");
                //gets input from the user
                String input1 = console.readLine();
                String desc = input1;
              else if (input.equalsIgnoreCase("s"))
                   //asks to save information
                   System.out.println("Enter the name of the file( as a .txt file):");
                   String input2 = console.readLine();
                   //saves the information to the filename of the users chosing.
                   FileOutputStream out;//declares a fileoutput object
                   //declares a printstream object
                   PrintStream p;
                   String [] x = sequenceArray;
                   try
                       //creates a new file output stream connected to the user input
                       out = new FileOutputStream(input2);
                       //connect the printstream to the output stream
                       p = new PrintStream(out);
                       p.println("The saved DNA sequence is: " + b +"/n"+ "The Description is: "+ desc);
                       // exit
                       p.close();
                    catch (Exception e)
                        System.err.println ("Error writing to file");
              else if (input.equalsIgnoreCase("x"))
                  break;
              else
                  System.out.println("You have entered an invalid letter, please try again");
                  continue;
    catch (IOException e)
                  break;
          System.out.println("Thank you for using the application");
}

I guess we are discussing this line:
p.println("The saved DNA sequence is: " + b +"/n"+ "The Description is: "+ desc);b is a String[] and arrays don't have overridden toString(). You can use Arrays.asList(b) to get a better String representation or make your own method that lists array to String.
As far as the null desctiption is concerned - is is possible that there is no more input and readLine returns null?
HTH
Mike

Similar Messages

  • Saving report output to a file on the server.

    Hi,
    We are using BI Publisher Standalone version 10.1.3.3.1.
    Is it possible to schedule a report to output to a file on the server?
    I want the whole report to be saved as a file on the server.
    This is somewhat similar to bursting to a file system, but, I don't want to split the output.
    Any help is appreciated.
    Thanks,
    Nanda

    Yes, use the scheduler and schedule the report,
    do the bursting into FTP or
    schedule the report to run and run it into FTP as a single FILE.
    First option, you need to provide the query , with FTP server name, username, password etcccc.

  • Saving RMAN output to os file..

    Dear Rman Gurus!
    I'd like to save an RMAN output to os file.. for example this would be terrific:
    RMAN> list backup; > /home/oralce/os_user/list.txt ???
    is this possible? how do you have this solved in your env? I cannot find the right solution..
    I am using version 8 and 9.. so spool log is not quite good as it doesn't work with v. 9..
    Many thanks for your suggestions!
    agat81

    RMAN v. 8Are you talking about 8i or 8.0?
    The LOG option is available in 8i, but I don't believe the SPOOL LOG option is available. I have no idea about 8.0.

  • AppleScript: Saving text output to a file

    Hi all,
    I am trying to save some output to a text file from AppleScript. Based on some postings I've found, I've been trying variations on this where theSubjects has some formatted text in it.:
         tell application "TextEdit"
              activate
              make new document
              set text of document 1 to theSubjects
              save document 1 in file (("/Users/karl/Desktop/") & "ListSubjects.rtf")
         end tell
    The text makes it into TextEdit as I intended, but when the script tries to save the file, I'm getting "The document "Untitled" could not be saved as "/Users/karl/Desktop/ListSubjects.rtf". You don't have permission."
    This error is consistent across all output directories that I have tried. I cannot find any sign that there are actual permissions issues.
    Any suggestions would be appreciated.
    Thank you.

    Yes, use the scheduler and schedule the report,
    do the bursting into FTP or
    schedule the report to run and run it into FTP as a single FILE.
    First option, you need to provide the query , with FTP server name, username, password etcccc.

  • Saving List Output to a file

    Hi all,
    I have developed one classical report in that user is saving the report output to a text file from menu list->Save/Send>File> Unconverted
    there every time user has to enter path and file name and he replace the existing file by replace option.
    Is there any way to pass this info. (path,file name) dynamically?
    I want that when user finish with parameter form then automatically the out put is stored in the file with predifine name.
    Thanks in advance.
    Deval Bhatt
    Message was edited by:
            Deval Bhatt

    Hi,
    Use fm
    Create Application Button using your PF status as "Download List" and use the following function module to download
      sy-lsind = sy-lsind - 1.
      call function 'LIST_DOWNLOAD'
           exporting
                list_index = sy-lsind
                method     = 'RTF'
           exceptions
                others     = 1.
    aRs

  • Problem while saving list output as local file.

    Hi Gurus!
    i want to save the list output of classical report into excel but complete data is not coming into excel file.
    [SYSTEM - > LIST ->SAVE ->  LOCAL ->SPREADSHEET ]
    when same output is transfer to unconverted file [notepad ] then completed data is coming.
    please help me ,
    points sure!
    Rahul
    Message was edited by:
            rahul deshmukh

    Yes Rahul, I know that and you have to do the formating. This is how you can do.
    Open the unconverted file in Excel format.
    Select the first column and then goto Data - Text to Columns , a pop up will come.
    Select Delimited, then press next.
    Then selct the delimeter that is used in the unconverted file to seperate two columns. Say for example if ' | ' is used then in others write ' | ' and press next.
    IN the data preview section select all the columns and then select text radio button on top and press finish finally.
    Now u will get the proper format of the file. Delete all the empty rows and columns that u don't want.
    Reward if you find it useful.
    Regards.
    Akhil.

  • Adding numbers in a file a and saving the output in another file.!

    can any one pls tell me how to add numbers from a textfile and save the output in another textfile. i'm new with java so pls help out..

    Hi Friend,
    your statement is not clear, it's bit confuse
    this is my unserstanding,
    you want to open a file and read the values then add numbers,
    latter save the sum in a new file.let me know if this is the thing, I can help u
    with Cheers
    Prasanna

  • Saving JSP output to a file

    I need to be able to save what a user sees on his browser, to a local file (where the web app runs).
    The content is dynamic. It is being created using a JSP.
    One way to write it to a local file would be to move the content creation from a JSP to a servlet and write to the HTTP response as well as to a file in the servlet.
    That's going to make it look messy.
    Any thoughts on how I could make this happen while continuing to use a JSP?

    OK, so now I've tried it, it's essentially what is described in the J2EE tutorial:
    /* File 1 */
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * passes on a subclass of HttpServletResponseWrapper
    * in order to replace the output writer.
    public class OutReplacementFilter implements Filter {
      public void init(FilterConfig filterConfig) throws ServletException {  }
      public void destroy() {  }
      public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
                  throws IOException, ServletException {
        //wrap the original response
        HttpServletResponse newResponse = new ReplacementHttpServletResponse((HttpServletResponse) response);
        //pass it to the resource
        chain.doFilter(request, newResponse);
        //get what the resource wrote
        String output = newResponse.toString();
        //put it to the output stream
        PrintWriter out = response.getWriter();
        out.write(output);
        out.close();
        //and then put it where ever else you like
        System.out.println(output);
    /* File 2 */
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * returns specialized writer to capture jsp output
    public class ReplacementHttpServletResponse extends HttpServletResponseWrapper {
      private CharArrayWriter replacementWriter;
      public ReplacementHttpServletResponse (HttpServletResponse response) {
        super(response);
        replacementWriter = new CharArrayWriter();
      public PrintWriter getWriter() throws IOException {
        return new PrintWriter(replacementWriter);
      public String toString() {
        return replacementWriter.toString();
    }This way is easy and few keystrokes, but buffers all the output until the filter chain returns.

  • Saving ALV Grid to Local File issue - Missing half of the report

    Hi Experts, Good Day.
    I have developed an ALV Grid report using class CL_SALV_TABLE which displays 200 Columns and 100+ rows/records. It is displaying well, but when I am saving the output into local file (any type) there only 98 columns are downloading and remaining all the columns are missing.
    I would like to know whether there is any restriction for number of columns or what might the problem for it. How can I download all the columns into local file.
    Thanks in Adv.
    Vijay

    Hi,
    Thanks for your response. Even though there are multiple ways to send data to local file I believe all three are same. And even I am facing same issue all the ways. Only 98 Columns data is getting downloaded into Files (it might be .txt, .xls, etc.).
    After downloading first 98 Columns, I am hiding the downloaded columns and again I am downloading remaining columns. Then I am merging in the Excel file. This is very complicated for the End-User. So, please help me out.
    I have used only following methods for displaying ALV.
    For initial object/instance:
    CL_SALV_TABLE=>FACTORY,
    For ALV functions:
    CL_SAVL_TABLE->GET_FUNCTIONS,
    CL_SALV_FUNCTIONS_LIST->SET_ALL,
    For Column heading and Optimized width:
    CL_SALV_TABLE->GET_COLUMNS,
    CL_SALV_COLUMNS_TABLE->SET_OPTIMIZE,
    CL_SALV_COLUMNS_TABLE->GET_COLUMN,
    CL_SALV_COLUMN->SET_SHORT_TEXT,
    To display grid:
    CL_SALV_TABLE->DISPALY.
    - Thanks
    Vijay

  • Saving the output of a .sql file in .csv format

    Hi,
    I am saving the output of a .sql file in .csv format. But the problem is , the record of few columns have "new line" character in it, so when it is getting saved in .csv format, those records are coming in multiple rows, but they should come in one single row in single block. Please advise how to overcome this problem.
    Regards,
    Niraj

    Hi Guys,
    I guess, there is a misunderstanding.
    He is talking about the issue caused as a result of the data containing a "CRLF" ( Carriage return Line feed ) .
    That is mainly a data issue.
    The query i presume, must be right.
    I guess you should be able to fix it using some string functions.
    Some thing similar to this
    CREATE TABLE ASH (NAME VARCHAR2(10))
    SELECT REPLACE(NAME, CHR(13)||CHR(10), 'ISH') FROM ASH;
    SELECT REPLACE(NAME, CHR(10), 'ISH') FROM ASH;
    SELECT REPLACE(NAME, CHR(13), 'ISH') FROM ASH;
    depending on the type of new line whether it is CR or LF. or CRLF.
    Regards
    Ashish/-

  • Saving JSP report output as a file on the application server

    I am trying to determine if it is possible to save a web based JSP report to the file system in the same way you can with a report generated via the rwservlet command. I am specifying DESTYPE=HTML and DESNAME=/home/mydirectory/abc.htm on the command line, but it seems to be ignored. The directory has 777 permissions on it.
    1. Is it possible to save the JSP output onto the file system just like paper based reports?
    2. Where, if any, is documentation addressing this issue? The reports deployment guide appendix lists all the URL parameters that are available to the various rw commands, but nowhere is discussed what params are relavent to JSP reports.
    3. If it is not possible to do this via the URL, does anyone know if I can somehow fetch out the inner HTML from the generated page at the bottom pf the JSP and then write it to the file system using JAVA? I know how to do it via JavaScript, but the reports are run on UNIX. Is there someway I can access the DOM inside the JSP?
    4. Why hasn't Oracle explained this better?
    Thanks,
    matt

    Thanks for getting back to me. But the documentation link below takes me to running rwservlet requests. This was not what I needed. The good news is my most excellent DBA, Manoj Gandhi, found an old TAR in Metalink that emphatically states that what I am trying to do is not possible. See Note:272401.1
    Well, sort of not possible...
    As it turns out it is possible, but you must schedule the report for immediate execution using the rwservlet's scheduling facility. Again, this came to me via my DBA. The TAR for this piece is Note:295420.1. Ignore the rwservlet urlparameter= part as best I can tell it's gibberish. Below is what I did. Substitute your info for the stuff in UPPER CASE and put it all on one contiguous line of course:
    http://SERVER:PORT/PATH/rwservlet
    ?server=REPORT_SERVER_NAME
    &destype=file
    &desname=A_PATH_AND_FILE_FILE_NAME_WITH_EXTENSION
    &jobtype=rwurl
    &schedule=
    &urlparameter=http://SERVER:PORT/PATH/JSP_NAME?userid=USERID&OTHER_PARAMETERS...
    I am not sure why cmdkey= fails when passed in the urlparameter= but I am working on a solution!

  • Anyone know how to output an XML file from ABAP to a non sapgui location?

    I have a program that creates XML and then outputs a file via CALL METHOD cl_gui_frontend_services=>gui_download. But now I want to execute the program in background mode and therefore I need to be able to output that XML to a NON sapgui file location. Current code creates the XML to an internal table which is binary then the gui_download method converts that to output XML. .  Does anyone know how I can change the code to either a) output the XML to an internal table which can be output via, say, a TRANSFER command..or, b) output the created binary table of XML to a NON sapgui file location?
    Excerpts from current code are as follows:
    first the XML is created (to the binary file)
          Creating a ixml factory
      l_ixml = cl_ixml=>create( ).
          Creating the dom object model
      l_document = l_ixml->create_document( ).
          Fill root node with value XML
      l_element_xml  = l_document->create_simple_element(
                  name = 'XML'
                  parent = l_document ).
          Create tag 'HEADER' as child of 'XML'
      l_element_header  = l_document->create_simple_element(
                  name = 'HEADER'
                  parent = l_element_xml  ).
    header information about the file and general data about the fleet follows
      l_value = c_fleet_import.
      l_element_dummy  = l_document->create_simple_element(
                name = 'TYPE'
                value = l_value
                parent = l_element_header ).
    etc.......
    then the xml is connected to the stream factory and rendered
      Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
      Connect internal XML table to stream factory
      l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
      Rendering the document
      l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                            document = l_document ).
      l_rc = l_renderer->render( ).
      Saving the XML document
      l_xml_size = l_ostream->get_num_written_raw( ).
    and then output to the file
      IF sy-subrc = 0.
        CALL METHOD cl_gui_frontend_services=>gui_download
           EXPORTING
             bin_filesize = l_xml_size
            filename     = 'g:\sapdms\BSCC-DEV\EFPAC XML Files\ALL.xml'
           filename     = '/TRICK/727/OUT/ZEFP/EFPAC.XML' "doesnt work with sap gui
             filetype     = 'BIN'
           CHANGING
             data_tab     = l_xml_table
           EXCEPTIONS
             OTHERS       = 24.
    as implied by the comments the method above will successfully output the XML file to the g:drive but will not output to /TRICK/ location, which is where I need it to go in a background mode run.
    This is a problem which has defeated all our local expertise and I would appreciate any help given... Barry Jones

    Try this code below:
    data  l_xml_table2  type table of xml_line with header line.
    W_filename - This is a Path.
      if w_filename(02) = '
        open dataset w_filename for output in binary mode.
        if sy-subrc = 0.
          l_xml_table2[] = l_xml_table[].
          loop at l_xml_table2.
            transfer l_xml_table2 to w_filename.
          endloop.
        endif.
        close dataset w_filename.
      else.
        call method cl_gui_frontend_services=>gui_download
          exporting
            bin_filesize = l_xml_size
            filename     = w_filename
            filetype     = 'BIN'
          changing
            data_tab     = l_xml_table
          exceptions
            others       = 24.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
                     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.

  • Saving report output in default path

    Hi,
    We are using the 6i reports server. We want to save the report output as a file in a default path. We are making the report requests through URL call from within a PL/SQL block. When we give just the filename(this will dynamically be generated for each request) in the DESNAME parameter, it is saving directly into the path where we started the reports server. We don't want to hardcode the required path in the PL/SQL block.
    Can't we set the default path for saving the report output during the configuration of the reports server?
    Is there any alternative to achieve this, like storing the path(without filename) in any configuration file similar to <servername>.conf in 9i reports server?
    Regards,
    Milton.

    Hi Milton
    Try these suggestion and see if they work...
    Add ORACLE_HOME/bin in your system PATH and run Reports Server from the folder where you want your output file to be generated.
    You could also be storing the "default" path in a config file and use IO packages to read it.
    Create a user parameter of character type and do the following in any of the Reports trigger:
    :desname := :p_1 || :desname;
    You may pass the "default" path on the URL.
    Regards
    Sripathy

  • How to download a smartform output as excel file WITH EXACT LAYOUT.

    Hi,
         I have searched the forum but could not found any satisfactory answer. I have a smartform with a table, some texts and a logo. I have to write a code which will save the smartform output as excel file in the system keeping the layout of the smartform output EXACT.
    i.e., the excel file will contain the output with EXACTLY THE SAME layout as would have been for a pdf file (if the smartform output is converted to a pdf file) and the client can then edit the fields of the table in the excel file.  How can I achieve this? Please give a suggestion.. Thanks in advance.

    Hi Anirban,
    Your Requirement is to download a smartform to  microsoft  Excel .
    Well unfortunately we can only download data into excel which is in a tabular format i.e stored in internal tables we have function modules to do the same even u can do that using OLE2.
    If u try to download a smartform to Excel only format supported will be ASCII, if u will continue with that the smartforms text's will get downloaded to excel but whole data would be downloaded in a single Cell.
    Code to do the same is -
    >>>>
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
      EXPORTING
      i_language = v_language
      i_application = 'SAPDEFAULT'
      IMPORTING
      e_devtype = v_e_devtype.
       CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          FORMNAME                 = w_form
    *   VARIANT                  = ' '
    *   DIRECT_CALL              = ' '
       IMPORTING
         FM_NAME                  =  w_fmname
       EXCEPTIONS
         NO_FORM                  = 1
         NO_FUNCTION_MODULE       = 2
         OTHERS                   = 3
      IF sy-subrc <> 0.
        MESSAGE E002(zcpm) WITH 'Smartform call fails'.
      ENDIF.
    wa_outopt-tdprinter = v_e_devtype.
    wa_ctrlop-no_dialog = 'X'.
    wa_ctrlop-getotf    = 'X'.
      CALL FUNCTION w_fmname "'/1BCDWB/SF00000025'
        EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
        CONTROL_PARAMETERS         = WA_CTRLOP
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
        OUTPUT_OPTIONS             = WA_OUTOPT
    *    USER_SETTINGS              = ' '
        IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
        JOB_OUTPUT_INFO            = T_OTFDATA
    *   JOB_OUTPUT_OPTIONS         =
    *    document_output_info       = st_document_output_info
    *    job_output_info            = st_job_output_info
    *    job_output_options         = st_job_output_options
        TABLES
          T_FINAL                    = T_FINAL
          T_ZSDT_WAGONS              = T_ZSDT_WAGONS_1
          T_QTY                      = T_QTY
          T_QTY1                     = T_QTY1
          T_CON1                     = T_CON1
          T_CON2                     = T_CON2
          "T_ZTMM_OUTWB_TXN           = T_ZTMM_OUTWB_TXN
    EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 4
       OTHERS                     = 5
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    T_OTF[] = T_OTFDATA-OTFDATA[].
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
              format = 'ASCII'
              max_linewidth = 132
    * ARCHIVE_INDEX = ' '
    IMPORTING
              bin_filesize = w_bin_filesize
    TABLES
              otf   = t_otf
              lines = t_pdf_tab
    EXCEPTIONS
              err_max_linewidth = 1
              err_format = 2
           err_conv_not_possible = 3
    OTHERS = 4
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    if tabix_m = 1.
    *CALL METHOD cl_gui_frontend_services=>file_save_dialog
    *CHANGING
    *filename = w_FILE_NAME
    *path     = w_FILE_PATH
    *fullpath = w_FULL_PATH
    ** USER_ACTION =
    ** FILE_ENCODING =
    *EXCEPTIONS
    *CNTL_ERROR = 1
    *ERROR_NO_GUI = 2
    *NOT_SUPPORTED_BY_GUI = 3
    *others = 4
    *IF sy-subrc <> 0.
    *MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    CALL function 'TMP_GUI_BROWSE_FOR_FOLDER'
    EXPORTING
    WINDOW_TITLE = 'Select A File Folder'
    INITIAL_FOLDER = 'C:\'
    IMPORTING
    SELECTED_FOLDER = W_PATH.
    endif.
    CONDENSE W_PATH.
    concatenate W_PATH '\' wa_final-vbeln '.XLS' into w_FULL_PATH.
    ****************************************************************************Saving the PDF file on to Application server************************
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
       BIN_FILESIZE                     = w_bin_filesize
       FILENAME                         = w_FULL_PATH
       FILETYPE                         = 'BIN'
    *   APPEND                          = ' '
    *   WRITE_FIELD_SEPARATOR           = ' '
    *   HEADER                          = '00'
    *   TRUNC_TRAILING_BLANKS           = ' '
    *   WRITE_LF                        = 'X'
    *   COL_SELECT                      = ' '
    *   COL_SELECT_MASK                 = ' '
    *   DAT_MODE                        = ' '
    *   CONFIRM_OVERWRITE               = ' '
    *   NO_AUTH_CHECK                   = ' '
    *   CODEPAGE                        = ' '
    *   IGNORE_CERR                     = ABAP_TRUE
    *   REPLACEMENT                     = '#'
    *   WRITE_BOM                       = ' '
    *   TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *   WK1_N_FORMAT                    = ' '
    *   WK1_N_SIZE                      = ' '
    *   WK1_T_FORMAT                    = ' '
    *   WK1_T_SIZE                      = ' '
    IMPORTING
       FILELENGTH                      = w_filesize
      TABLES
        DATA_TAB                        = t_pdf_tab
    *   FIELDNAMES                      =
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
    As u said ,u want to download a smartform to Excel it could be done but only if u r using a internal table and exactly printing line by line values in the smartform, But if u are performing calculation in between, using multiple internal table Work areas, structures, etc i.e if whole smartform is developed with many distributed windows , unfortunately it wont be possible to download a smartform to excel in such cases, because the whole output comes from multiple internal tables, calculations, etc all the data is not printed in a tabular manner so in such a case it would be just impossible to download the smartform  to excel.
    But we definitely have a workaround which could be done to download the data into excel.
    you can develop a ALV report with a header and footer u can define the header and footer of the alv according to the smartform and the middle portion would contain the tabular kind of data which u must be using as Smartform table to print the same.
    So if u have a similar kind of smartform with some header data, tabular data, and some footer data, then u can use ALV to do the same thing , advantage with ALV would be that u can easily download the same into excel.
    Other alternative is that u can Convert and download the smartform to PDF  and copy the same to an Excel wooksheet.
    These are all the possibilities with which u can do the same.
    Regards,
    Akash Rana

  • Saving query result to a file

    Hi,
    I have a sql*developer version 1.5 but i am getting a problem while saving query result to a file. When i click on "script output "-> "file icon" nothing is showing.
    Can anyboby guide me whether its a bug or some other settings are required.
    I have oracle 10.2.0.3 working on linux.
    Thanks & regards
    Girish

    I am getting the same thing and as far as I know it is a bug.
    As a workaround, you can either copy the contents of the script output or run the query as a statement (F9) instead of as a script (F5) and export the query results from the results tab.

Maybe you are looking for

  • Loading multiple instances of the same loader

    Hello everyone, I am trying to load in 5 pictures but 2 of those pictures need to be added multiple times to the same scene. For example you would use Loader to load one tree but would show that tree 9 times. The problem I am experiencing is that eac

  • How do I locate a shared hard drive on my personal wireless network?

    I would like to access a drive that my husband and I share over our wireless network. However, I am not sure how to prompt my Macbook Pro to look for the drive. In 'Finder' the shared drive doesn't show up under my available devices, even though I kn

  • F-53 Bank charges

    Hi Guys while useing f-53 for making payment we entered the bank charges in the screen.. becuase of bank charges  i am not able to make the payment . It shows the message it is too large for clearing . I also assigned Bank charges GL on OBXL.. Pl hel

  • Query Regarding UTL_FILE.fopen() -

    Guys hope you all doin well- I am using Oracle 9i release 2 - I am having problem while i am trying to open a file using the UTL_FILE builtin package - I created the directory as well where the file is located, that i want to access While i am execut

  • Addition of new table in object BUS2013 in MASS T.Code

    hi, I like to add table A016 in object BUS2013 in mass transaction, please let me know the process or is there any other way to extend PO line item condition validity. Regards, Kishore Ghodki.