Incorrect format in Excel file

I have 2 columns in a table -
Column C1 is a varchar2 with values like -ABC, -MNO etc i.e. every value has a '-' as the first character.
Column C2 is a number column.
Through a procedure, I send them to Excel file but the column C2 is displayed as text column left aligned. How do I get it as a number column in the Excel file? It happens due to the '-' in the first column.

What is the purpose of the - character? I don't understand why Excel thinks c2 is not a number field, if it contains values like -111. A .CSV with a column of negative numbers would open up in the general number format.
Through a procedureWhat sort of procedure? Something using SYLK? Or some other PL/SQL API?Or a Stored Java Procedure? Or UTL_FILE to write a .CSV file?
Honestly I don't know how you expect us to solve your problem when you give us so little to go on.
Regards, APC

Similar Messages

  • Formating an excel file by BSP Download

    I have made a BSP application which can dowload file into an excel file.But now i have a requirement in which i have to format the excel file with colour and cell width.I have to colour the column  header of the excel file with some colours like blue,red etc.
    Please suggest me how we can achieve this?
    Thanks and regards,
    Manish Kumar

    Hi Manish,
    This can be achieved using javascirpts and active x objects. Check this wiki,
    http://wiki.sdn.sap.com/wiki/display/CRM/DownloaddatafromwebuitoExcelandPPT
    Regards,
    Arun

  • Writing into Excel file using PL/SQL and formatting the excel file

    Hi,
    I am writing into a excel file using PL/SQL and I want to make the first line bold on the excel. Also let me know if there are any other formatting options when writing into excel.
    Regards,
    -Anand

    I am writing into a excel file using PL/SQL
    Re: CSV into Oracle and Oracle into CSV
    check that thread or search in this forum...

  • To Send HTML Format and excel file attachment  in same mail

    Dear All,
            Have requerment ,to send a mail options HTML table format and same data in excel file attachement.have capable to do the html format using methods BCS .but how to send excel format attachment in same  mail.
    Please guide me how to do it.
    Regards ,
    Santhu
    Edited by: santosh jajur on Apr 9, 2010 1:54 PM

    Santhosh,
    please check the code:
    report bcs_example_7.
    This report provides an example for sending an Excel
    attachment in Unicode Systems
    constants:
      gc_tab  type c value cl_bcs_convert=>gc_tab,
      gc_crlf type c value cl_bcs_convert=>gc_crlf.
    parameters:
      mailto type ad_smtpadr
       default 'ur mail id'.                    "#EC *
    data send_request   type ref to cl_bcs.
    data document       type ref to cl_document_bcs.
    data recipient      type ref to if_recipient_bcs.
    data bcs_exception  type ref to cx_bcs.
    data main_text      type bcsy_text.
    data binary_content type solix_tab.
    data size           type so_obj_len.
    data sent_to_all    type os_boolean.
    start-of-selection.
      perform create_content.
      perform send.
    form send.
      try.
          send_request = cl_bcs=>create_persistent( ).
        create document object from internal table with text
          append 'Hello world!' to main_text.                   "#EC NOTEXT
          document = cl_document_bcs=>create_document(
            i_type    = 'RAW'
            i_text    = main_text
            i_subject = 'Test Created By BCS_EXAMPLE_7' ).      "#EC NOTEXT
        add the spread sheet as attachment to document object
          document->add_attachment(
            i_attachment_type    = 'xls'                        "#EC NOTEXT
            i_attachment_subject = 'ExampleSpreadSheet'         "#EC NOTEXT
            i_attachment_size    = size
            i_att_content_hex    = binary_content ).
        add document object to send request
          send_request->set_document( document ).
        --------- add recipient (e-mail address) -----------------------
        create recipient object
          recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
        add recipient object to send request
          send_request->add_recipient( recipient ).
        ---------- send document ---------------------------------------
          sent_to_all = send_request->send( i_with_error_screen = 'X' ).
          commit work.
          if sent_to_all is initial.
            message i500(sbcoms) with mailto.
          else.
            message s022(so).
          endif.
      endtry.
    endform.                    "send
    form create_content.
      data lv_string type string.
      data ls_t100 type t100.
    columns are separated by TAB and each line ends with CRLF
      concatenate 'This Is Just Example Text!'                  "#EC NOTEXT
                  gc_crlf gc_crlf
                  into lv_string.
    header line
      concatenate lv_string
                  'MSGID'    gc_tab
                  'MSGNO'    gc_tab
                  'Language' gc_tab                             "#EC NOTEXT
                  'Text'     gc_crlf                            "#EC NOTEXT
                  into lv_string.
    data lines
      select * from t100 into ls_t100
        where arbgb = 'SO' and msgnr = '182'.
        concatenate lv_string
                    ls_t100-arbgb gc_tab
                    ls_t100-msgnr gc_tab
                    ls_t100-sprsl gc_tab
                    ls_t100-text  gc_crlf
                    into lv_string.
      endselect.
      select * from t100 into ls_t100
        where arbgb = 'SO' and msgnr = '316'.
        concatenate lv_string
                    ls_t100-arbgb gc_tab
                    ls_t100-msgnr gc_tab
                    ls_t100-sprsl gc_tab
                    ls_t100-text  gc_crlf
                    into lv_string.
      endselect.
      try.
          cl_bcs_convert=>string_to_solix(
            exporting
              iv_string   = lv_string
              iv_codepage = '4103'  "suitable for MS Excel, leave empty
              iv_add_bom  = 'X'     "for other doc types
            importing
              et_solix  = binary_content
              ev_size   = size ).
        catch cx_bcs.
          message e445(so).
      endtry.
    endform.                    "create_content
    Thanks.

  • Create and Format an Excel File as a Background Process(Application Server)

    Hi all,
    I have a requirement to Output a formatted(Bold fonts, Merged Cells etc.) Excel File.
    It is to be run as background process. So ideally, the file will be produced in the ApplicationServer and will already contain the formatting. If I am to use ole2 functions such as
    *--Opening the existing document
       call method of gs_wbooks 'Open' = gs_wbook
       exporting #1 = file_path.
    Is this possible? can file_path point to the file created in the ApplicationServer?
    Any answers, suggestions or workarounds would be greatly appreciated.
    Thanks in Advance

    no.
    that works only in dialog
    A.

  • How to format a excel file use java.

    hi,
    everyone, i meet a problem.i want to write a excel file use java.i can use .csv input the date to excel.but i want to know how to format it.
    thanks
    Jove

    hi,
    everyone, i meet a problem.i want to write a excel
    el file use java.i can use .csv input the date to
    excel.but i want to know how to format it.
    thanks
    JoveIf I understand your question correctly you need to know the format of a .csv file for use in an Excel spreadsheet. A .csv file is a comma-delimited file so all that you need to do is write your data elements to the file with commas in between them. Having done something similar in the past, let me warn you that when Excel is reading your file, it uses some characters other than commas as field delimiters. for example, / : and ; are treated as commas. To defeat this, you will need to surround fields containing those characters in double quotes.
    Hope that helps
    Mark

  • How to read data in correct format from EXCEL file into an internal table??

    Hi Experts,
    My requirement is to upload data from an excel file on presentation server into an internal table on <b>SRM</b> server.
    I used 'GUI_UPLOAD' function module to achieve the same but all the the data is getting uploaded in # only.I had set in the 'HAS_FIELD_SEPARATOR' to 'X' to overcome this problem.
    But all the efforts are in vain. The function module 'ALSM_EXCEL_TO_INTERNAL_TABLE' doesn't exist on SRM Server and I am not getting any other function module having similar functionality available on SRM server.
    I have written the following code:-
    TYPES: BEGIN OF ty_addr_loc,
             userid    TYPE xubname,      "User Id
             addr_code TYPE char4,        "3 Digit Site Location Code/4 Digit
                                                       "Alternate Address
             loc_id    TYPE bbp_location, "Indicator: Address is standard address
            END OF ty_addr_loc.
    *Retrieving file name
    parameters: p_file type rlgrap-filename.
      DATA:
        Local variable holding file name
          l_file TYPE string,
        Local Variable holding the file type,
          l_type TYPE filetype VALUE 'ASC',
        Local Variable holding the field separator
          l_sep  TYPE char01,
          i_tab type standard table of ty_addr_loc.
    Clearing local variables
      CLEAR:
            l_file,
            l_sep.
    Initializing the local variables
      MOVE p_file TO l_file.
      l_sep = 'X'.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = l_file
          filetype                      = l_type
          has_field_separator           = l_sep
       HEADER_LENGTH                 = 0
       READ_BY_LINE                  = 'X'
       DAT_MODE                      = ' '
       CODEPAGE                      = ' '
       IGNORE_CERR                   = ABAP_TRUE
       REPLACEMENT                   = '#'
       CHECK_BOM                     = ' '
       VIRUS_SCAN_PROFILE            =
       NO_AUTH_CHECK                 = ' '
    IMPORTING
       FILELENGTH                    =
       HEADER                        =
        TABLES
          data_tab                     = i_tab
       EXCEPTIONS
         file_open_error               = 1
         file_read_error               = 2
         no_batch                      = 3
         gui_refuse_filetransfer       = 4
         invalid_type                  = 5
         no_authority                  = 6
         unknown_error                 = 7
         bad_data_format               = 8
         header_not_allowed            = 9
         separator_not_allowed         = 10
         header_too_long               = 11
         unknown_dp_error              = 12
         access_denied                 = 13
         dp_out_of_memory              = 14
         disk_full                     = 15
         dp_timeout                    = 16
         OTHERS                        = 17
      IF sy-subrc <> 0.
      Throwing an information message
        MESSAGE i003. "Data Upload Failed
        LEAVE LIST-PROCESSING.
      ENDIF.
    Please tell me a way out. I have to make a delivery urgently.
    Thanks in advance,
    Swati Gupta

    Hi
    Try the FM <b>KCD_EXCEL_OLE_TO_INT_CONVERT</b>
    Sample:
      call function 'KCD_EXCEL_OLE_TO_INT_CONVERT'
           exporting
                filename                = i_filename
                i_begin_col             = l_begin_col
                i_begin_row             = l_begin_row
                i_end_col               = l_end_col
                i_end_row               = l_end_row
           tables
                intern                  = xt_intern
           exceptions
                INCONSISTENT_PARAMETERS = 201
                UPLOAD_OLE              = 201.
      if sy-subrc <> 0.
        e_subrc = sy-subrc.
        exit.
      endif.
    <b>reward if Helpful.</b>

  • Issues with format of Excel file created from an Oracle Report

    I'm running Oracle Reports 6i.  My reports run fine but when I covert them to Excel files I lose my column headings (they end of being repeated for each row in their own columns) and the ordering of my other columns. I can't figure out what is determining the column order as it is not the order of the items in Report Builder or in the query. Could someone tell me why this might be happening and how to fix the issue?  Any help would be greatly appreciated as I'm a very new user. Thanks!

    Hi,
    First of all let me clear out generating a report pdf is different from excel.
    The Repeating Frame and boxes,lines etc., used in your reports plays a vital role in excel.
    Because, the fields in the reports are segmented into XL cells and displayed as the output.
    For Better results in excel...Follow the below instructions,
    --Remove Boxes,lines,etc.,
    --Make your repeating frame and main frame visible (don't put 'NO_LINE') for any frames,
    --Don't leave any unnecessary spaces in reports between fields,frames etc.,
    --Then run your report.
    It will work fine,
    Regards,
    Soofi

  • Formatting an Excel File in Java

    Hi,
    I have created a Excel file in Java, But i want to put each column with a specific width. How can i do this?
    Help anyone?

    I have this piece of code.
    outputFile=new java.io.File(vVirtualDir+nomeFicheiro.toString());
    java.io.FileWriter out1 = new java.io.FileWriter(outputFile);
    String dados="\15\12";
    out1.write("\15\12");
    dados+="Column Name 1";
    dados+="Column Name 2";
    dados+="Column Name 3";
    dados+="\15\12";
    dados+="Regsiter1";
    dados+="1";
    dados+="1";
    dados+="\15\12";
    dados+="Regsiter2";
    dados+="2";
    dados+="2";
    dados+="\15\12";
    String res =new String(dados.getBytes("ISO-8859-1"));
    out1.write(res);
    out1.close();
    This creates me the content of a Excel File. But i want to define the width of each column. How can i do that?

  • Help, the file "nodename" setting in incorrect format!!

    Hi all,
    Could any one can help me to solve this problem?
    I just set an incorrect format of the file /etc/nodename:
    192.168.0.1 NAME ABC
    Moreover, the /etc/hosts:
    172.0.0 localhost
    192.168.0.1 NAME
    /etc/hostname.interface:
    NAME
    After reboot the system, it display the following messages and can't be up:
    SunOS Release 5.6 version Generic [UNIX(R) System V Release 4.0]
    Copyright(c) 1983-1997, Sun Microsystems, Inc.
    configuring network interfaces: ifconfig: SIOCSIFADDR: le0: Cannot assign requested address
    le0.
    usage: uname [-snrvmagiX]
    uname [-S system_name]
    re-trying host configuration...
    re-trying host configuration...
    re-trying host configuration...
    re-trying host configuration...
    and then continue to display this "re-trying host configuration...".
    It is noted that this system is SPARCstation 4 and running Solaris 2.6.
    It haven't cdrom and floppy drive.
    It can go to "ok" prompt if press "stop + a".
    Could anyone can tell me how to boot up and fix it?
    Thanks a lot.
    Best regards,
    Carlos Ko

    Hi all,
    Thanks for your suggestion.
    However, for the case "boot -s", the system seems no change the error messages after reboot and still shown these messages again and again.
    For the case setting up a install server and boot server, is it possible to set these severs on x86 system? Since the problem is on the SPARC system and no other available SPARC system can set up as a install server and boot server. I only concern the x86 system can provide install service for a SPARC system.
    Could you have any idea to modify the "nodename" file during boot up or by typing some command at "ok" prompt?
    e.g. type "boot -s /etc/uname -S NAME" at "ok" prompt or something like that??
    Thanks a lot.
    Best regards,
    Carlos Ko

  • Error while downloading data into excel file.

    Hi,
        I have a requirement to download data available in xstring to excel file.
    I have a RFC which has export parameter 'file_data' of type xstring. When i call RFC
    from web dynpro abap application it gives data out pout in xstring format.
    I am opening excel file using that xstring data as below
    cl_wd_runtime_services=>attach_file_to_response(
    i_filename = 'file.xls'
    i_content = ls_data_source-data_source   ***[xstring data from RFC]
    i_mime_type = 'x-excel/application'
    i_in_new_window = abap_true ).
    But excel file not coming in correct format. its  giving an error while download
    excel file
    Error is
          " the file you are trying to open , 'file[1].xls', is in a different format than
    specified by the file extension. Verify that the file is not corrupted and is from
    a trusted source before opening the file. Do you want to open the file now? "
    If i click on 'YES' button file opening but not in proper excel format. Data is coming
    in tab delimiter format in excel file.
    Please suggest any solution for this problem.
    Thanks,
    Venkat.

    Hi Thomas,
    Following is the logic implemented in RFC which is giving XSTRING as export parameter
    STEP1      create a dynamic internal table
               Create field catalog for the table   using LVC_FIELDCATALOG_MERGE
                   CALL METHOD cl_alv_table_create=>create_dynamic_table
                        EXPORTING
                           it_fieldcatalog = it_fieldcat
                         IMPORTING
                           ep_table        = dyn_table.
                  CREATE  EXCEL SHEET BY SENDING FIELD CATALOG AND DATA TAB
    STEP2 # Convert text table to xstring.
            CALL FUNCTION 'SCMS_TEXT_TO_XSTRING'
              IMPORTING
                buffer   = l_content
              TABLES
                text_tab = lt_data_tab
              EXCEPTIONS
                failed   = 1
                OTHERS   = 2.
    STEP3  *# Psss Data to Netweaver
              PERFORM pass_data_to_nw USING is_import
                                      CHANGING es_attachment_metadata.

  • Formatting of EXCEL Sheets during download

    Hi all,
    There is a requirement for Formatting EXCEL Sheets when downloaded into an FTP site in background.
    The internal table is saved in application server with .xls extension and transferred to FTP thru RFC.
    is there any way to format this EXCEL file and get it formatted in FTP when it is seen.
    The report will run in background daily and every day the report has to be in same format.
    Thanks in Advance..
    Vivek ..

    Hi
    You can not format EL file that is uploaded. You have to format the internal table before generation XL file from the internal table. Internal table should have all fields in char type. set char length for each field like
       data: begin of itab..
               field1(20) type c,
               field2(20) type c,
    Append header record if u want into this itab as first record.
    Append all records into this itab.
    Generate XL file from this itab.
    I suggest you that..
    Upload this itab in to application server as 'DAT' format then generate XL file from this file. Dont set .xls when you upload itab to appl. server.
    Bala
    Note: Award points if helpful

  • Storing an Excel File in the Oracle Table through Oracle Form (10g)

    Hi,
    We have the below requirement in the Oracle Forms (10g).
    Database: 11g
    Application: R12
    We need to provide an upload functionality to the user, so that he can upload an excel file into the form (from the local system), this is achived.
    Now what we need to do is that we need to capture the path of the document (in the local system) and we need to store the document in a Oracle table.
    Next we need to validate the records that are being loaded and the error records should be written into one more file and that file also we need to store in an Oracle table, this is because, i need to query this error file from the table later and need to send to the user as an e-mail.
    Basically i started off with the below code just for the POC. but iam facing the error. Please help. I did not put this code in my form.
    Create Table Email_Attachments(Id_Pk Integer Primary Key,Fname Varchar2(50),Image Blob);
    Create Or Replace Directory Temp As 'C:\';
    Create Or Replace Procedure Load_File(Pi_Id In Integer, Pfname In Varchar2) Is
    Src_File Bfile;
    Dst_File Blob;
    Lgh_File Binary_Integer;
    Begin
    Src_File := Bfilename('TEMP', Pfname);
    Insert Into Email_Attachments (Id_Pk,Fname,Image)
    Values (Pi_Id,Pfname, Empty_Blob())
    Returning Image Into Dst_File;
    Dbms_Lob.Open(Src_File, Dbms_Lob.File_Readonly);
    Lgh_File := Dbms_Lob.Getlength(Src_File);
    Dbms_Lob.Loadfromfile(Dst_File, Src_File, Lgh_File);
    Dbms_Lob.Close(Src_File);
    Commit;
    End;
    begin
    Load_File(1,'test.txt');
    end;
    ERROR
    ORA-22288: file or LOB operation FILEOPEN failed
    No Such file or directory
    ORA-06512: at "SYS.DBMS_LOB", line 1014
    ORA-06512: at "SYS.LOAD_FILE", line 10
    ORA-06512: at line 2
    How to capture the Path from which he has loaded the file?
    How to Write the error records it to the file and store it in an Oracle table?
    Will the below table be of use to me?
    fnd_lobs_document
    fnd_lobs
    fnd_documents
    Please share your ideas as to how to acheive this.
    Thanks and Regards
    Srinivas

    When you want to process the file, them it depends on the format. "Excel file" is a term that is used for a variety of file formats, mostly simple CSV, binary (true) XLS and XLSX.
    So to get help you have to give us more information. Since the file is already in the db you might get better answers at {forum:id=75}. The forum has a FAQ that has a whole section {message:id=9360007}.
    Regards
    Marcus

  • SQLLDR to load data in Excel file without converting to CSV file

    Hello Guys,
    We are getting data in excel sheet and we need to insert data into oracle table. Is it possible to do with SQLLDR command that too without converting the excel file to csv format.
    If its possible can any one share a pseudo code to do that.
    Your help is well appreciated.
    Thanks in advance

    Is it possible to do with SQLLDR command that too without converting the excel file to csv format
    SQL*Loader does not know how to process the microsoft proprietary binary format of Excel files.  If you really want to use SQL*Loader then the data will have to be exported from Excel to a format that SQL*Loader can use, such as CSV... otherwise, don't use SQL*Loader (see the FAQ I posted already)

  • Write to excel file (into AL11 directory)

    Hi,
    I am able to loop an internal table and write to csv file in AL11 directory.
    But how to write to excel file instead of csv file. And how to format the excel file (for example, column B should be format to numeric and column E should format to date format), and are we able to put like red color on column C for example?
    Thanks in advance.

    Hi,
    You need to add the tab inbetween all the fields of internal table and upload to application server using
    OPEN DATASET
    TRANSFER
    CLOSE DATASET.
    to add the tab inbetween the fields..you can use this code....
    concatenete itb-field1 itab-field2......... into string seperated by CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
    one exception whicle uploading data to the Application server you need to convert dec or currency field to char type otherwise it will give you short dump.

Maybe you are looking for

  • New Mac Book Pro & Logic Pro vs New 8 Core Mac

    I think this question may have been answered. a question, but here goes anyway. I am using a new Macbook Pro duel core and running Logic Pro on it. I get "system overload" every time I start playback on multiple tracks. Then if I restart the playback

  • Unsupported Image Format for DNG from GF1?

    I am in the process of trying to switch from Lightroom 3 to Aperture 3 (in case you are wondering why the main reason is increasing integration between iOS and Aperture). Most of the images in my Lightroom catalog are from Nikon DSLRs which when I im

  • Table for "Budget planning : Cost Center"

    Hi Gurus, can anyone pls tell me table for "Budget : Cost Centre" . We create budget with respect to cost center in KPZ2/KPZ3 but i am unable to find out in which this data can be found. Pls tell me the table to retrieve the data. Regards

  • How to find the last modified date of a workflow.

    How to find the last modified date of a workflow. thanks.

  • Problem  in Transports configuration   to  Production

    Hello  I have a problem I am configurating  the  transport system between  QA landscape and  Prod landscape but I got  this  message: System   QA DOMAIN_DEV   Command  TMS_MGR_CONFIGURE_CLIENT Client   000                          Service  Configurat