Unknown column in the excel sheet created using Export to Excel

Hi,
I created an excelsheet for the table data using the below link
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/wdjava%20archive/exporting%20context%20data%20into%20excel%20using%20the%20web%20dynpro%
20Binary%20Cache.pdf
but problem here is when i open the excel sheet it is having some unknown columns apart from the expected like amount/#agg next to the actual column amount and it is happening only for the cloumns which have some numbers.
I dont know where these columns are coming from.
Send me the solution and points will be rewarded for the helpful answers.
I want to put some name to the excel file instead of using system created file name.for this requirement where do i need to change the code

Hi,
You can export to excel even not relating with any libraries
Follow this way..
Take one singleDimensional array, arrColNames[], and one Two dimensional array, arrValues[][].
File f=new File("Sample.xls);
FileOutputStream fos=new FileOutputStream(f);
for(int i=0;i<arrColNames.length;i++)
fos.write(arrLabels<i>.getBytes());
fos.write("\t".getBytes());
fos.write("\n".getBytes());
for(int j=0;j<noOfRows;j++)
String arr[]=arrValues[j];
for(int a=0;a<arr.length;a++)
if(arr[a]!=null)
     fos.write(arr[a].getBytes());
    fos.write("\t".getBytes());
fos.write("\n".getBytes());
fos.flush();
fos.close();
The exported excelFile will be stored in your server. If you want to open it using FileDownLoad UI Element,
Create value attributes resource of type Resource, behaviour of type FileDownLoadBehaviour, reso of type String, fileName of type String , Then then append this code
FileInputStream fis=new FileInputStream(f);
FileChannel fc=fis.getChannel();
byte data[]=new byte[(int)fc.size()];
ByteBuffer bb=ByteBuffer.wrap(data);
fc.read(bb);
fis.close();
IWDCachedWebResource objCachedWebresource=null;
if(data!=null)
objCachedWebresource=WDWebResource.getWebResource
(data,WDWebResourceType.XLS);
objCachedWebresource.setResourceName(f.getName());
wdContext.currentContextElement().setFileName(f.getName());
wdContext.currentContextElement().setResource(objCachedWebresource);
wdContext.currentContextElement().setReso(objCachedWebresource.getAbsoluteURL());
wdContext.currentContextElement().setBehaviour(WDFileDownloadBehaviour.ALLOW_SAVE);
Regards
LN

Similar Messages

  • Formatting of Excel worksheet While using Export to Excel

    Hello Experts,
    I have a requirement to format the workbook according to the user needs while the user clicks "Export to Excel" in the webpage of Web template.
    The major problem is with the hierarchy.. when exporting, the hierarchy nodes have triangular symbols.. is there any way to remove them??
    What can i do, so that i can make changes to the default export format of the workbook, while exporting it??
    Any helpful suggession will be appreciated and rewarded.
    Thanks and Best Regards,
    Vikas Bittera.

    Hi Mark,
    Thank you very much for the response.. however this is not the full solution of my problem..
    Now, if i execute the same query in the BEx explorer analyzzer, then even this setting does not work... it shows traingles.. wht oue intention is to use Excel grouping function, so that the user will have better navigation in hierarchy..
    so is there any way to do this? we need to other formatting of the output.. is it possible that we can change the standard query ouput in excel??
    Looking ahead for your response..
    Thanks and Best Regards,
    Vikas Bittera.

  • How to import pictures into excel sheet without using report generation

    Dear Friends
    I want to know how to import the picture or picture file into excel sheet without using report generation..
    kindly come up with any suggestions or example code
    Regards
    Karthick
    Solved!
    Go to Solution.

    Thank you Rajesh 
    i am going through that vi
    Rajesh Nair wrote:
    Please go through below link
    http://zone.ni.com/devzone/cda/epd/p/id/3638
    Eventhough one subVI is missing i think it will be usefull for you.
    Regards
    Rajesh R.Nair
    Rajesh Nair wrote:
    Please go through below link

  • How to add customized column in the time sheet CATS (transaction CAT2) ?

    Hello,
    I need to be able to add some columns in the time sheet CAT2 containing:
    - the name and first name of the person (in addition of the number), in display mode in the CATS time sheet.
    - a  text that I will found by reading some tables and values...
    Does anyone have any idea how to do so ? and if it's possible or not?
    Thanks a lot in advance for your help.
    Best regards
    Fanny GROUX

    Hi,
    Thanks a lot, it's really help...don't know why I didn't see this customized point before in SPRO.
    But I have an other issue, my new fields is added in the CATS screen and now I'm trying to put default value by using the user exit of extension CATS0009.
    When I complete the value of my new fields in structure CATSD_IMP, there are not taking into account and the CATS screen doesn't display the value.
    Am I using the wrong table ? wrong user-exit ? or my code ..
    Thansk a lot again for your help.
    Fanny GROUX

  • Uploading an excel sheet data using Oracle APEX 3.2

    Hi All,
    Please help me out to upload excel sheet data using oracle APEX 3.2.
    Am following the steps mentioned in the below link, but even after that am getting an error saying no data found
    http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
    Please help me to proceed further.
    Regards,
    Sakthi

    Hi Andy,
    Thank you very much for looking into my thread.
    Actually i followed everything that is been mentioned in "http://avdeo.com/2008/05/21/uploading-excel-sheet- using-oracle-application-express-apex/" and i got a successful result.
    But, with the above process I can only upload a .csv format excel and not a .xls format excel file.
    Thats where i got stucked and unable to find any clue on how to move further to achieve in uploading .xls file.
    It would be very great if you guide me through in this process.
    Shiva

  • Is there an apple approved agreggator that allows me to publish to the iBookstore ibooks created using iBooks author? I would like to use the interactivity that iBooks Author allows but need an aggregator that supports it. Thank you.

    Is there an apple approved agreggator that allows me to publish to the iBookstore ibooks created using iBooks author? I would like to use the interactivity that iBooks Author allows but need an aggregator that supports it. Thank you.

    Apple - iTunes - Partner Programs - Book Publishers
         See a list of Apple-approved aggregators
    Start contacting them with your particular needs and see who fits best.
    Be sure to understand this info:
    Please note that if you choose to work with an aggregator to distribute your content on the iBookstore, Apple's contractual and financial relationship is with that aggregator.

  • Many of the documents I create using my Adobe Exporter won't download

    Many of the documents I create using my Adobe Exporter won't download. What's the story?

    Hi,
    I'm using Google Chrome with windows 7, and the ExportPDF web ui.
    I simply select the file, press the "export" to microsoft word option. The
    file exports, butthen it won't download.
    Thanks for any help you can offer me.
    Kirsten
    Kirsten Black
    Tender Writer
    TJS Services Group
    The Entertainment Quarter
    Level 2, 215 Bent Street, Moore Park NSW 2021
    T  02 9581 9999
    D  02 9581 9935
    F  02 9581 9988
    *W *tjsservices.co <http://www.tjsservices.co/>
    <http://www.tjsservices.co/

  • RDL reports(2008).File name after using Export to Excel is not comming properly in mozilla firefox.

    I am using Export to Excel functionality in rdl report.
    File name should be "Profitabilty By Buyer". It is working as expected in IE and chrome.
    But in mozilla firefox the file name appears as "Profitabilty".
    So the issue is it doesnt consider anything after space and user requirement is such that I cant put underscore("_") also instead of space.
    Kindly suggest the proper solution.

    Hi Mukesh,
    Reporting Services, we use a Web browser to view the report that deploy to Report Service. However, not all report functionally is supported by all browsers. Such as, the print button is not supported in Mozilla Firefox. It works only in Internet Explorer
    due to it uses ActiveX for the print button.
    I have tested it on my local environment, (SQL Server Reporting Services 2008, Firefox 28.0), we cannot reproduce this issue. So the issue can be the custom setting of your browser. Since SSRS reports are not about targeting NON-IE browsers, so in your scenario,
    we recommend you use IE to view report on Report Manager.
    And you said that you cannot put underscore ("_") also instead of space. However we can do this which you can see on the screenshot below.
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to format the font in Cell when export to Excel file?

    Dear all,
    I am using the CRJ SDK 12 to export to Excel file, but i i want to format the font of Cells in Excel when exporting them.
    Can you help me to solve this issue?
    Thanks,
    Nha

    There's no control over per-cell formatting for Excel exports.
    Sincerely,
    Ted Ueda

  • How do I open a document in excel on another machine when the doc was created using numbers

    How do I open a numbers document in excel

    you can export from Numbers by selecting the menu item "File > Export To > Excel...":

  • How export report into excel sheet automatically using SSRS 2010?

    Hi,
    I have created many reports using SQL Server Data Tool 2010 and at my work, we are using active batch to ran reports every month.
    Now question is, my boss want me to set up reports such a way that when active batch is ran, reports should be exported into excel sheet automatically with the default values given for parameters at some specific folder location. How can I export report
    into excel sheet automatically when active batch is executed?
    Please help me on this. Thanks for the help in advance.
    Vicky

    Check this:
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'C:/test.xls'
          filetype                = 'ASC'
          write_field_separator   = 'X'
        TABLES
          data_tab                = t_output
    Regards.

  • Oracle report output in MS Excel sheet version used oracle apps 11.5.9

    Hi guys,
    I need ur help........plz tell me how to convert rdf report output in excel sheet format currently it come in pdf format. actually oracle apps version 11.5.9 there is no option for xml publisher report that's why i m facing prob.
    used:
    report builder version : 6i
    database : 9i
    Report belong from AR module......................... Debtor Ledger Report of AR.
    I hv tried Text,xml report output option but not worked.......plz give me idea how to resolve this issue...................................thanks

    How To View / Open Concurrent Requests With The Excel Application [ID 377424.1]
    Please also see old threads for similar discussion -- http://forums.oracle.com/forums/search.jspa?threadID=&q=Excel+AND+Concurrent&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • How to run a excel sheet macro using RH_START_EXCEL_WITH_DATA

    Hi All,
    I have found out one FM, RH_START_EXCEL_WITH_DATA,
    To run the excel sheet marco from the ABAP editor.
    DATA_FILENAME
    DATA_PATH_FLAG
    DATA_ENVIRONMENT
    DATA_TABLE
    MACRO_FILENAME
    MACRO_PATH_FLAG
    MACRO_ENVIRONMENT
    WAIT
    DELETE_FILE
    I found these parameters in the FM,
    which I need to pass,
    Any code sample...
    Any hint...
    Thanks,
    Kalyan Chandramouli

    hi
    good
    check with this report.
    REPORT Z_DISPLAY_IDOC_AND_DATA line-size 275.
    This tool reads an existing Idoc and dispays the contents in a       *
    spreadsheet format. The spreadsheet (MS-EXCEL) will be automatically *
    created if D_EXCEL = 'X'.                                            *
    data: idoc_control like EDIDC,
          NUMBER_OF_DATA_RECORDS like sy-dbcnt,
          NUMBER_OF_STATUS_RECORDS like sy-dbcnt,
          INT_EDIDS like edids occurs 0 with header line,
          INT_EDIDD like edidd occurs 0 with header line.
    TYPE-POOLS :  LEDID.
    data: STRUCT_TYPE TYPE  LEDID_STRUCT_TYPE ,
          IDOC_STRUCT TYPE  LEDID_T_IDOC_STRUCT,
          SEGMENTS TYPE  LEDID_T_SEGMENT,
          SEGMENT_STRUCT TYPE  LEDID_T_SEGMENT_STRUCT,
          excel_tab(2000) occurs 0 with header line.
    parameter: DOCNUM like edidc-docnum obligatory, ""Idoc Number
               sap_rel like SY-SAPRL default SY-SAPRL obligatory,
               pi_ver like EDI_VERREC-VERSION default '3' obligatory,
               d_excel as checkbox default 'X'. ""Download ?
    start-of-selection.
      perform read_idoc.
      perform process_idoc.
      if d_excel = 'X'.
        perform download_to_excel.
      endif.
    end-of-selection.
    FORM read_idoc.
      CALL FUNCTION 'IDOC_READ_COMPLETELY'
           EXPORTING
                DOCUMENT_NUMBER          = docnum
           IMPORTING
                IDOC_CONTROL             = idoc_control
                NUMBER_OF_DATA_RECORDS   = NUMBER_OF_DATA_RECORDS
                NUMBER_OF_STATUS_RECORDS = NUMBER_OF_STATUS_RECORDS
           TABLES
                INT_EDIDS                = INT_EDIDS
                INT_EDIDD                = INT_EDIDD
           EXCEPTIONS
                DOCUMENT_NOT_EXIST       = 1
                DOCUMENT_NUMBER_INVALID  = 2
                OTHERS                   = 3.
      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.                    "" read_idoc
    FORM process_idoc.
      perform read_idoc_structure.
      perform display_data_records.
    ENDFORM.                    "" process_idoc
    FORM display_data_records.
      data: PE_seg_HEADER like EDI_SAPI01,
            segname like EDI_IAPI12-SEGMENTTYP,
            prev_segname like EDI_IAPI12-SEGMENTTYP value ' ',
            pt_fields2 like EDI_IAPI12 occurs 0 with header line,
            PT_FVALUES2 like EDI_IAPI14 occurs 0 with header line,
            byte_first type i,
            byte_last type i,
            field_val(50),
            tmp_str(15),
            tmp_str3(15),
            seg_repeats type i value 0,
            tmp_str2(15),
            tab_cr(1) type x value '09',
            tot_ctr type i value 0,
            ctr type i value 0,
            msg(40) type c.
      data: IDOC_STRUCT_wa TYPE  LEDID_IDOC_STRUCT.
      sort int_edidd by segnum.
      describe table int_edidd lines tot_ctr.
      loop at int_edidd.
        move int_edidd-segnam to segname.
        clear msg.
        concatenate 'Reading segment ' segname
                    into msg separated by space.
        if tot_ctr <> 0.
          ctr = ( 100 * sy-tabix ) / tot_ctr.
        endif.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
             EXPORTING
                  PERCENTAGE = ctr
                  TEXT       = msg.
        add 1 to seg_repeats.
        clear tmp_str2.
        if int_edidd-segnam <> prev_segname.
          seg_repeats = 1.
          clear: pe_seg_header, pt_fields2, pt_fvalues2.
          refresh: pt_fields2, pt_fvalues2.
          CALL FUNCTION 'SEGMENT_READ_COMPLETE'
               EXPORTING
                    PI_SEGTYP                 = segname
                    PI_RELEASE                = sap_rel
                    PI_VERSION                = pi_ver
               IMPORTING
                    PE_HEADER                 = pe_seg_header
               TABLES
                    PT_FIELDS                 = pt_fields2
                    PT_FVALUES                = pt_fvalues2
               EXCEPTIONS
                    SEGMENT_UNKNOWN           = 1
                    SEGMENT_STRUCTURE_UNKNOWN = 2
                    OTHERS                    = 3.
          IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          prev_segname = int_edidd-segnam.
        endif.
        read table idoc_struct into idoc_struct_wa with key
                               segment_type = int_edidd-segnam.
        if sy-subrc = 0.
          IF IDOC_STRUCT_WA-SYNTAX_ATTRIB-MUSTFL = 'X'.
            TMP_STR = 'Mandatory'.                  ""Mandatory
          ELSE.
            TMP_STR = 'Optional'.                  ""Optional
          ENDIF.
          if IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-QUALIFIER = 'X'.
            tmp_str3 = 'Qualified'.
          else.
            tmp_str3 = 'Non-Qualified'.
          endif.
          shift IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX
                                     left deleting leading '0'.
          move seg_repeats to tmp_str2.
          condense: IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX, tmp_str2.
          concatenate tmp_str2 'of'  IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX
              into tmp_str2 separated by space.
          write :/ IDOC_STRUCT_wa-SEGMENT_TYPE,
               tmp_str,
               TMP_STR3,
               tmp_str2,
               IDOC_STRUCT_wa-SYNTAX_ATTRIB-HLEVEL,
               IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-plast,
               IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-DESCRP.
          if d_excel = 'X'.
            concatenate 'Segment Name' tab_cr
                        'Mand / Opt ' tab_cr
                        'Qual / non-Qual' tab_cr
                        'Seq of Max' tab_cr
                        'Level' tab_cr
                        'Owner' tab_cr
                        'Description'
                        into excel_tab.
            append excel_tab.
            concatenate IDOC_STRUCT_wa-SEGMENT_TYPE tab_cr
                  tmp_str tab_cr
                  TMP_STR3 tab_cr
                  tmp_str2 tab_cr
                  IDOC_STRUCT_wa-SYNTAX_ATTRIB-HLEVEL tab_cr
                  IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-plast tab_cr
                  IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-DESCRP
                  into excel_tab.
            append excel_tab.
            concatenate tab_cr
                        'Field Nma' tab_cr
                        'Type' tab_cr
                        'Length' tab_cr
                        'Byte From' tab_cr
                        'Byte To' tab_cr
                        'Description' tab_cr
                        'Value' tab_cr
                        'Qualifier Meaning'
                        into excel_tab.
            append excel_tab.
          endif.
        endif.
        sort pt_fields2 by field_pos.
        byte_first = 0.
        loop at pt_fields2.
          clear: field_val.
          byte_last = pt_fields2-EXTLEN.
          write int_edidd-sdata+byte_first(byte_last) to
                field_val left-justified.
          shift pt_fields2-EXTLEN left deleting leading '0'.
          shift pt_fields2-byte_first left deleting leading '0'.
          shift pt_fields2-byte_last left deleting leading '0'.
          write:/ '   ', pt_fields2-fieldname,
                  pt_fields2-datatype,
                  pt_fields2-EXTLEN,
                  pt_fields2-byte_first ,
                  pt_fields2-byte_last,
                  pt_fields2-descrp,
                  field_val.
          read table pt_fvalues2 with key fieldname = pt_fields2-fieldname
                        fldvalue_l = field_val.
          add byte_last to byte_first.
          if sy-subrc = 0.
            write : pt_fvalues2-descrp.
          else.
            clear pt_fvalues2-descrp.
          endif.
          if d_excel = 'X'.
            concatenate tab_cr pt_fields2-fieldname tab_cr
                    pt_fields2-datatype tab_cr
                    pt_fields2-EXTLEN tab_cr
                    pt_fields2-byte_first tab_cr
                    pt_fields2-byte_last tab_cr
                    pt_fields2-descrp tab_cr
                    field_val tab_cr
                    pt_fvalues2-descrp
                    into excel_tab.
            append excel_tab.
          endif.
        endloop.
      endloop.
    ENDFORM.                    "" display_data_records
    FORM read_idoc_structure.
      data: idoctype type LEDID_IDOCTYPE.
      if not idoc_control-cimtyp is initial.
        STRUCT_TYPE = 'E'. ""Extended
        idoctype = idoc_control-cimtyp.
      else.
        STRUCT_TYPE = 'B'. ""Basic
        idoctype = idoc_control-idoctp.
      endif.
      CALL FUNCTION 'IDOC_TYPE_COMPLETE_READ'
           EXPORTING
                RELEASE              = sap_rel
                STRUCT_TYPE          = STRUCT_TYPE
                IDOCTYPE             = idoctype
                VERSION              = pi_ver
          IMPORTING
               IDOC_TYPE            = idoctype
           TABLES
                IDOC_STRUCT          = idoc_struct
                SEGMENTS             = segments
                SEGMENT_STRUCT       = segment_struct
           EXCEPTIONS
                IDOCTYPE_UNKNOWN     = 1
                IDOCSTRUCT_UNKNOWN   = 2
                SEGMENT_DATA_MISSING = 3
                ILLEGAL_STRUCT_TYPE  = 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.
    ENDFORM.                    "" read_idoc_structure
    FORM download_to_excel.
      data: name like RLGRAP-FILENAME.
      shift docnum left deleting leading '0'.
      concatenate docnum '-' idoc_control-idoctp '.xls'
                  into name.
      CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
       EXPORTING
         DATA_NAME                 = name
         DATA_TYPE                 = 'ASC'
         WAIT                      = ' '
       TABLES
         DATA_TAB                  = excel_tab
       EXCEPTIONS
         NO_BATCH                  = 1
         EXCEL_NOT_INSTALLED       = 2
         WRONG_VERSION             = 3
         INTERNAL_ERROR            = 4
         INVALID_TYPE              = 5
         CANCELLED                 = 6
         DOWNLOAD_ERROR            = 7
         OTHERS                    = 8
      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.                    "" download_to_excel
    reward point if helpful.
    thanks
    mrutyun^

  • After upgrading to mountain lion, the movies I create using iDVD periodically stop then resume abruptly when I play them back on my DVD player. Any ideas on correcting this?

    After upgrading to mountain lion, the movies/slideshows I create using iDVD playback in a jolting start/stop manner. This didn't happen with the prior os - playbacks were flawless. Any ideas, short of uninstalling mountain lion, on how to correct?

    I know this is not much help. IDVD and Mountain Lion are working perfectly for me.  I know many others that use Mountain Lion with iDVD also.
    I think your problem lies elsewhere.

  • Can i create more than one attributes for the custom class created using java API

    Hello everyone,
    I have been creating class and its attributes programatically using java APIs, I want to know that is there any way to create multipal attributs for the same class in just one call of API with all the options for each attributes,
    thanks

    You can create a new class and define all of the Attributes at the time the class is created - this is the preferred way of creating classes. Use the addAttributeDefinition() method on ClassObjectDefinition. If you need to add attributes to existing classes, you can only add them one at a time (using the addAttribute() method on ClassObject).
    (dave)

Maybe you are looking for

  • My icloud account has an old e_mail account

    my old e_mail was stollen and password changed now I cannot access my icloud account and on my phone it says if i delete the account it will erase all data from the phone that was saved to the cloud any suggestions on how to change the email to my ne

  • IPhone 4 getting electric shock while charging

    Hi I am getting electric shock while charging my iPhone 4

  • Checks on cash flow report

    Hi ,       When I using cash flow report and have been issued and received a lot of checks, but I cannot seen those at security level - "checks". Why? All of those are belongs to "Cash accounts". Could anyone give me a explanation or example? Thanks

  • Error Messege, Can't Open iTunes.

    I'm still having this problem, so I took it off. But quicktime is still having the same problem. Encountered a problem & needs to close. I can't uninstall is cause when I do try it stops cause theres a fatal error? I can't even repair it.

  • What is the name of the sound card in an early 2011 MacBook Pro laptop?

    What is the name of the sound card in an early 2011 MacBook Pro laptop with Mountain Lion?