Download file in txt format

Hi,
Im using Forms 6i,
The output data is not spliting into lines by line .in between the lines there is a small box.If i open the same file in word itis spliting line by line.
PROCEDURE do_based_customers (p_org_id in number,p_user_id in number,p_inv_org in number,p_location in varchar2,
          p_route in varchar2, p_dodatefrom in date,p_dodateto in date, p_dofrom in number, p_doto in number) is
l_path varchar2(100) := '/export/home/loadman';
l_filename varchar2(20000) := 'hht_cust_'||sysdate||'.txt' ;
l_buffer varchar2(80) := 'this is a test';
l_outfile utl_file.file_type;
cursor c1 is
select * from table;
begin
l_outfile := utl_file.fopen(l_path, l_filename, 'w');
for rec1 in c1
loop
     l_filename := rec1.cust_code||'~'||rec1.cust_name||'~'||rec1.ROUTE_CODE||'~'||rec1.LOCATION_CODE;
          utl_file.put_line(l_outfile, l_filename);
end loop;
utl_file.fclose(l_outfile);
exception
when others then
utl_file.fclose(l_outfile);
dbms_output.put_line(sqlerrm);
end do_based_customers;
Thsi is the code to download the data.Itis saving in a TEXT FORMAT.
Can any one help me in this to get reslove my problem.

Maybe you need ot issue unix2dos -ascii oldfile newfile on the os.

Similar Messages

  • Can Bridge CC create a list of files in .txt format ?

    hi all,
    i'd like to know if i can create a list of files in .txt format using Bridge CC
    It could be a good way to verify the integrity of an external database.
    thank you all
    rafa

    hi mark,
    this is my situation:
    i shoot a great number of items everyday.
    So i have a db in excel format with the name of item, the shooting date and other informations about the files.
    now, with my batch file, i create a list of file in specific folders (to work, worked, deliverde etc)
    in this way i can comparate all files and i can update tha state of working in db file
    if bridge could create a list, i can make this comparation faster.
    this is the why of my question.
    can you help me to create the opportune script in bridge?
    sorry for my english
    rafa

  • Download files in excel format

    Hi,
    Can anyone help me for downloading file in excel format? I have scheduled a job repeated everyday at a particular time, but it dumps a text file, NOT in excel format. My programme is an ALV.
    Code snippet would be verymuch helpfull.
    Thank,
    Thushara.

    Hello Thushara,
    here is a code i am giving you . It will take the data from a database , and download it into the excel format..
    You just can customize this program to download the data from an ALV ....
    Here is the sample code...
    REPORT  ZKUN_FILE4                              .
    TABLES: USR03,DD02L.
    DATA: ZX030L LIKE X030L.
    DATA BEGIN OF ZDFIES OCCURS 0.
         INCLUDE STRUCTURE DFIES.
    DATA END OF ZDFIES.
    DATA: BEGIN OF FLDITAB OCCURS 0,
          FLDNAME(11) TYPE C,
          END OF FLDITAB.
    DATA ITABUSR03 LIKE USR03 OCCURS 0 WITH HEADER LINE.
    DATA TNAME LIKE DD02L-TABNAME.
    SELECT * FROM USR03 INTO TABLE ITABUSR03.
    TNAME = 'USR03'.
    PERFORM GETFIELEDS.
    PERFORM SHOW123.
    FORM GETFIELEDS.
         CALL FUNCTION 'GET_FIELDTAB'
          EXPORTING
              LANGU              = SY-LANGU
              ONLY               = SPACE
              TABNAME            = TNAME
              WITHTEXT           = 'X'
          IMPORTING
              HEADER             = ZX030L
          TABLES
              FIELDTAB           = ZDFIES
          EXCEPTIONS
              INTERNAL_ERROR      = 01
              NO_TEXTS_FOUND      = 02
              TABLE_HAS_NO_FIELDS = 03
              TABLE_NOT_ACTIV     = 04.
         CASE SY-SUBRC.
            WHEN 0.
              LOOP AT ZDFIES.
                   FLDITAB-FLDNAME = ZDFIES-FIELDNAME.
                   APPEND FLDITAB.
              ENDLOOP.
            WHEN OTHERS.
                 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  with  SY-SUBRC.
          ENDCASE.
    ENDFORM.
    FORM SHOW123.
    CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
         EXPORTING
              FILE_NAME                 = 'C:\USR03.XLS'
              DATA_SHEET_NAME           = 'USER LIST'
        TABLES
             DATA_TAB                  =  ITABUSR03
             FIELDNAMES                =  FLDITAB
        EXCEPTIONS
             FILE_NOT_EXIST            = 1
             FILENAME_EXPECTED         = 2
             COMMUNICATION_ERROR       = 3
             OLE_OBJECT_METHOD_ERROR   = 4
             OLE_OBJECT_PROPERTY_ERROR = 5
             INVALID_FILENAME          = 6
             INVALID_PIVOT_FIELDS      = 7
             DOWNLOAD_PROBLEM          = 8
             OTHERS                    = 9.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    Hope this solves your problem.
    Regards,
    Kunal.
    Note : Reward points if found useful.

  • Issue while downloading file in .CSV format

    Hi,
    I need to download the file in .CSV format.
    I hade used FM SAP_CONVERT_TO_CSV_FORMAT  and then used GUI_Download.
    Now when I am opening file which is downloaded, it gives all the data in a single column. If there are 5 fields in my table, the generated file gives the data of all the 5 fields in a single column.
    Could you please help?

    Hi try wi th the following code.
    TYPE-POOLS : truxs.
    DATA: t_file TYPE STANDARD TABLE OF type_file.
    data:t_conv_data TYPE truxs_t_text_data.
    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
      EXPORTING
        i_field_seperator          = ', '
      TABLES
        i_tab_sap_data             = t_file
    CHANGING
       i_tab_converted_data       = t_conv_data
    EXCEPTIONS
       conversion_failed          = 1
       OTHERS                     = 2.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                = 'C:\TESTCSV.CSV'
        filetype                = 'ASC'
        write_field_separator   = '  '
      TABLES
        data_tab                = t_file
       fieldnames              = names
      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.

  • Download file in different formats(its urgent)

    Hi experts,
    I have a problem when downlaod a file in different formats.
    File should be downloaded 3 Formats.
    1. DWG
    2. DXF
    3. PDF
    this file is used for CAD Drawings.
    So i required a Functional Modules to generate a file in 3 different formats.

    Hi,
    You can download an internal table data (of report format) into PDF
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    * BIN_FILESIZE =
    filename = i_pfad
    filetype = 'BIN'
    * IMPORTING
    * FILELENGTH =
    TABLES
    data_tab = i_att_cont
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    OTHERS = 5.
    But DWG DXF are third party specific, i think in SAP we don't have functional modules to download in these
    aRs
    Points are always welcome

  • Download File In Csv Format

    Hi all,
        I want to create a file on the presentation server with csv format. i used gui_download function. The file is created but it is not csv format.
    it is urgent please can you help e out in this
    I used filetype as 'ASC' then CSV but in vain
    GV_ERR_FNAME = '
    SAM\ERRORFILE.CSV'
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = GV_ERR_FNAME
        FILETYPE                        = 'ASC'
        WRITE_FIELD_SEPARATOR           = 'X'
      TABLES
        DATA_TAB                        = GT_ERROR_TAX
    THANKX IN ADV

    Please check out this sample program.
    report zrich_0001.
    data: begin of itab occurs 0,
          fld1(10) type c,
          fld2(10) type c,
          fld3(10) type c,
          end of itab.
    data: begin of iout occurs 0,
          rec(1000) type c,
          end of iout.
    parameters: p_file type localfile default 'C:test.csv'.
    data: file type string.
    start-of-selection.
    * Build the ITAB
      itab-fld1 = 'A'.
      itab-fld2 = 'B'.
      itab-fld3 = 'C'.
      append itab.
      itab-fld1 = 'D'.
      itab-fld2 = 'E'.
      itab-fld3 = 'F'.
      append itab.
      itab-fld1 = 'G'.
      itab-fld2 = 'H'.
      itab-fld3 = 'I'.
      append itab.
    * Build the output internal table from ITAB
    * Concatenate all fields into IOUT-REC
      loop at itab.
        concatenate itab-fld1 itab-fld2 itab-fld3 into iout-rec
                    separated by ','.
        condense iout-rec no-gaps.
        append iout.
      endloop.
    * Now Download
      file = p_file.
      call function 'GUI_DOWNLOAD'
           exporting
                filename = file
           tables
                data_tab = iout
           exceptions
                others   = 22.
    Regards,
    Rich Heilman

  • Pdf file in txt format in application server

    Hi all,
             can we use open datset to store pdf file in text format in application server.
    when i am using this some data was getting correctly stored in appl server.but some data is getting converted to # symbols.of course the pdf data also contains some different characters in that place.
    but  i want that pdf data in that format,i dont want that change of # symbols...how can i do that...
    and while storing it,it is allowing only open dataset in binary mode only ..can anybody explain why?
    regards,
    sharma.

    <b>Check this example....</b>
    report ztest.
    data: begin of itab occurs 0,
    field(256),
    end of itab.
    data: dsn(100) value '/usr/sap/xfr/FIS/testpdf',
    length like sy-tabix,
    lengthn like sy-tabix.
    call function 'GUI_UPLOAD'
    exporting
    filename = 'c:\temp\test.pdf'
    filetype = 'BIN'
    importing
    filelength = length
    tables
    data_tab = itab.
    open dataset dsn for output in binary mode.
    loop at itab.
    transfer itab-field to dsn.
    endloop.
    close dataset dsn.
    clear itab.
    refresh itab.
    *- To crosscheck if it went well
    open dataset dsn for input in binary mode.
    do.
    read dataset dsn into itab-field.
    if sy-subrc = 0.
    append itab.
    else.
    exit.
    endif.
    enddo.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = 'c:\temp\testn.pdf'
    filetype = 'BIN'
    bin_filesize = length
    importing
    filelength = lengthn
    tables
    data_tab = itab.
    <b>TIP</b>
    Use the TCode
    CG3Z or CG3Y
    for downloading to Application Server.
    Regards,
    Pavan

  • DOWNLOAD SMARTFORM IN TXT FORMAT

    NORMALLY WE DOWNLOAD SMARTFORM IN PDF FORMAT BUT I HAVE REQUIREMENT TO DOWNLOAD IN TEXT FORMAT.
    PLEASE HELP.
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Jul 24, 2008 6:24 PM

    when you generate the spool you can down load that in txt format
    Function is used RSPO_DOWNLOAD_SPOOLJOB when you want to do that programatically.
    Using the spool number, and provide the path where you want to down load that time mention the name
    C:\smart.txt
    it will be downloaded .

  • Downloading files in mp3 format

    I am a novice at this. I have an mp3 player, but not an ipod. Can I download files from the itunes store in mp3 format so that I can play them on my mp3 player?
    I downloaded one file from the itunes store. However, It won't work in the format that it is in. Please help. I really want to buy music but I need it in the format that i require.

    Sorry, songs downloaded from the iTunes store are available in Protected AAC format only, which means that they are only playable on your PC and iPods. Another alternative would be to burn the downloaded song to a CD and then re-rip it as an MP3. You'd lose some quality, but at least it would be playable on your player.

  • Downloading file - MS WORD FORMAT

    hi.
    I am trying to make a download on user request in MS-WORD format. I have already downloaded the file in CSV format successfully. What i want to know is how to arrange data in word file ... i.e there should be some tags, or keywords which will help me to make table in word file, bold specific font, alignment ... and such stuff.
    can you tell me how can i?

    You can try setting the content type.
    Search for the appropriate type and use it.
    - Subramanyam V

  • Download file in particular format

    I want to download a file. The downloaded file should open in its corresponding application. A �.DOC� file should open in MS Word and �.XLS� file should open in MS Excel. What should be set in HttpRequest and/or HttpResponse objects to achieve this?
    thx in advance

        String      objectName = "whatever_you_like.doc";
        response.setContentType( "application/octet-stream" );
        response.setHeader( "Content-Disposition", "attachment; filename=\"" + objectName + "\";" );
        OutputStream        out = response.getOutputStream();
        //....

  • Downloading file in xls format

    Hi All,
    I have a program that downloads data from a server to the local machine in xls format, via a JSP. The data comes from a ResultSet which I read and convert to csv format, but using ";" as the separator (it works..) and "\n" for each new line I require. I then set the response to download the file. Eveything works fine when I run the web application locally, the file downloads and opens in Excel, BUT when I do the same accessing a remote server running on Solaris, I have a problem opening the downloaded xls. Everything works fine until I try to open the file, Excel tells me that it can't read the first record.
    Here's my code:
    String path = servlet.getServletContext().getRealPath("/");
    PrintWriter printWriter = new PrintWriter(new OutputStreamWriter( new FileOutputStream( path+ "upload/excel.csv" )));
    String data;
    String fileName; // a filename set when I read the data
    // read data, put ";" and "\n" where required
    printWriter.println(data);
    printWriter.close();
    response.setContentType("application/binary");
    response.setHeader("Content-Disposition","attachment" + ";fileName=\"" + filName + ".xls" + "\"");
    RequestDispatcher rd = request.getRequestDispatcher("destination.jsp");
    rd.include(request, response);
    It works from Windows to Windows, but something's amiss when I try it from Solaris to Windows.
    Any help is greatly appreciated!!

    Most probably it has to do with line.separator system property which is different between windows and unix.
    I noticed you using a printWriter.
    The println method will use the appropriate line separator for the platform it is running on. (from the System properties)
    I would try saving the file to disk rather than opening, to see if you can discern the differences.
    Also - what does the included jsp do? does it just include the newly created file?
    Do you need that file? Could you just stream it straight out to the user?
    ie instead of sending it to a FileOutputStream, send it to the ServletOutputStream.
    Hope this helps some,
    evnafets

  • Java application export output file of Crystal Report in .TXT format

    Hi,
    I have a Java application which is able to export the output file of Crystal Report in PDF format. But I'm trying to change the export file to .TXT format. Is this possible? I'm using Crystal Report XI. Is there any available updates or fixes to solve this? Please advice.
    Thank you

    I've tried, but I have an error
    frm-40735: when button-pressed trigger raised unhandled exception ORA-06502
    ORA-06502 when I try write a text field to the file the text field in question is a date.
    Did a similar problem ever occured to you?

  • How can I download & save an .txt ebook from Russian site in cyrillic and save in Word 2013.

    I wish to download ebooks in.txt format and save them in MS Word 2013. The books are in Russian language and therefore need to be converted into cyrillic. I am now using Windows 8 and Firefox19. On my OLD system (xp) and Word 2000 I had no problems. As soon as I pushed the download button, Firefox gave me the option to open the document in MS Word and after that it would give the option to download in cyrillic. Now all that has gone on the new system. Please help! Thanks. The site I am using is Tululu.org

    Hello seagull58, see : [https://support.mozilla.org/en-US/kb/set-how-firefox-handles-different-file-types#os=win8&browser=fx19 Set how Firefox handles different types of files]
    also : [https://support.mozilla.org/en-US/kb/change-firefox-behavior-when-open-file#os=win8&browser=fx19 Change what Firefox does when you click on or download a file]
    thank you

  • Can Bridge CC create a list of files in .txt?

    hi all,
    i'd like to know if i can create a list of files in .txt format using Bridge CC
    It could be a good way to verify the integrity of an external database.
    thank you all
    rafa

    i'd like to know if i can create a list of files in .txt format using Bridge CC
    There is a dedicated Bridge Scripting Forum that might have something suitable for you, it is not possible with Bridge 'Out of the box'
    https://forums.adobe.com/community/bridge/bridge_scripting

Maybe you are looking for