Any way to export table to excel file with leading 0s?

I have to export about 50 excel files from different tables.  Some tables contain leading 0s in the columns.  If I use bcp to export to xls file, the leading 0s will be missing.  If bcp to csv or txt file, there will be no issue at all.  But I have to export to xls file in order to let client update that xls file and reload to tables again.
Is there any other ways to do this task?
Thanks in advance.

Ok,  I played with it and fixed it on mine to work.
Here is what you do.  Create a blank Excel file in Excel with a single header row with your column names in it, and then set the datatypes for each column in Excel to match your export type.  For the below, create an Excel file and in column A1, put "Name" and change the column to Type Text.  Then in B1 type Date and set it to type Date, then save the file as c:\Test.xls.  Then close the file in Excel.
In SSMS execute the following:
Code Snippet
INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test.xls;HDR=YES',
'SELECT Name, Date FROM [Sheet1$]')
SELECT [Name], GETDATE() FROM msdb.dbo.sysjobs
GO
 It worked perfectly in my environment.  Don't bother with BCP, just create a formated Excel File with a header row with your output column names and then save it.

Similar Messages

  • Download records to EXCEL file with  Leading Zero's for numbers

    Hi All,
    I am able to download the data to EXCEL file on the presentation server.
    There are few fields (Plant,SalesOrder Number ..with Leading Zero's) in the record.
    These values are downloaded with out Leading Zero's to excel( EX: 0000004122 as 4122).
    Please help me to download the data to EXCEL file with leading zero's.
    Thanks and Regards,
    KC

    >
    Krishna Chaitanya  G wrote:
    > The excel file which is to be downloaded..will be used by some other program..to upload the values to the sap.
    > It matters there....
    > KC
    HI KC,
    then no need to download the zeros,
    after uploading, loop at that uploaded internal table and use CONVERSION_EXIT_APLHA_INPUT and pass the vbeln(without zeros) to this FM, it will return the value with added zeros.
    hope this solves your query
    a small example
    Loop at itab into is.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    INPUT = is-vbeln "(  this is without zeros)
    IMPORTING
    OUTPUT = is-vbeln. "( this is with leading zeros)
    modify itab from is.
    endloop.
    Edited by: Soumyaprakash Mishra on Oct 6, 2009 2:16 AM

  • Any way to export just an audio file?

    Hi All
    Is there any way to copy part of a larger audio file, paste it in another track (or open it in the file editor) process it in some way and then export just that file? Been reading manual and books, but this one has me stumped. Only see tracks and busses for export.
    Thanks
    John

    If anyone is interested, and it seems not, a helpful person another list answered my question: copy snippet from one file onto another track; solo new track; select just snippet; save. Finally I can add time-based effects to parts of a larger audio file!

  • Any way to make markup on pdf file with optical pen

    I am looking for some way to make markups on pdf files by using a optical pen to avoid printing and then making markup with normal pen or by making them onscreen using a regular mouse.
    there are optical pens in market which can make markups on new documents but i am looking to work on pdf files.

    I have exactly the same quesiton. 

  • Is there any way to open an iMovie HD file with iMovie 4?

    Subject said it all. My daughter did her iMovie homework on our home computer. When she took the iMovie HD file to school it wouldn't open with their older version of iMovie.
    Any suggestions?
    Thanks,
    lw

    Hi Lanny
    install iM04 on your home computer :-/ (you can run both apps on one machine, but I recommend to install a second account for your daughter…)
    because iM05 has a totally different system to handle the clips ("non-distructive editing") plus a different file-system (.pkg instead of files+folders) there's no way from 5>>4
    (except, you export the project as a .dv and import that into the other app… but you loose the whole projects info as clips, transitions etc,)
    no, 5+5, 4+4, or 4+5… you can import iM4 projects into iM5… once, single shot only
    besides: great, your kids do such projects!! over here in Germany, we still use chalk and blackboards…

  • Project Server 2010: Is there any way to export to excel the Graph part of a view?

    We need the graphical part of a project center view in a file, is there any way to export this to excel?
    Thanks in advance.

    Hi EPM Quest,
    Unfortunately the Gantt chart of the project center views cannot be exported as is in Excel.
    But based on projects data, you can build a Gantt chart in Excel. See Office article below:
    http://office.microsoft.com/en-us/excel-help/create-a-gantt-chart-in-excel-HA001034605.aspx
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • How to export data from a Dynpro table to Excel file?

    Hi
    Here I go again. I read the post <b>Looking for example to export data from a DynPro table to Excel file</b> and put the code lines into a Web Dynpro Project where we need to export a dynpro table to Excel file but exactly at line 23 it doesn't recognize <b>workBook = new HSSFWorkbook();</b>
    1     //Declare this in the end between the Begin others block.
    2     
    3     private FileOutputStream out = null;
    4     private HSSFWorkbook workBook = null;
    5     private HSSFSheet hsSheet = null;
    6     private HSSFRow row = null;
    7     private HSSFCell cell = null;
    8     private HSSFCellStyle cs = null;
    9     private HSSFCellStyle cs1 = null;
    10     private HSSFCellStyle cs2 = null;
    11     private HSSFDataFormat dataFormat = null;
    12     private HSSFFont f = null;
    13     private HSSFFont f1 = null;
    14     
    15     //Code to create the Excel.
    16     
    17     public void onActionExportToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
    18     {
    19     //@@begin onActionExportToExcel(ServerEvent)
    20     try
    21     {
    22     out = new FileOutputStream("C:/mydirectory/myfiles/testexcel.xls");
    23     workBook = new HSSFWorkbook();
    24     hsSheet = workBook.createSheet("My Sheet");
    25     cs = workBook.createCellStyle();
    26     cs1 = workBook.createCellStyle();
    27     cs2 = workBook.createCellStyle();
    28     dataFormat = workBook.createDataFormat();
    29     f = workBook.createFont();
    30     f1 = workBook.createFont();
    31     f.setFontHeightInPoints((short) 12);
    32     // make it blue
    33     f.setColor( (short)HSSFFont.COLOR_NORMAL );
    34     // make it bold
    35     // arial is the default font
    36     f.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    37     
    38     // set font 2 to 10 point type
    39     f1.setFontHeightInPoints((short) 10);
    40     // make it red
    41     f1.setColor( (short)HSSFFont.COLOR_RED );
    42     // make it bold
    43     f1.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    44     f1.setStrikeout(true);
    45     cs.setFont(f);
    46     cs.setDataFormat(dataFormat.getFormat("#,##0.0"));
    47     
    48     // set a thick border
    49     cs2.setBorderBottom(cs2.BORDER_THICK);
    50     
    51     // fill w fg fill color
    52     cs2.setFillPattern((short) HSSFCellStyle.SOLID_FOREGROUND);
    53     cs2.setFillBackgroundColor((short)HSSFCellStyle.SOLID_FOREGROUND);
    54     // set the cell format to text see HSSFDataFormat for a full list
    55     cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text"));
    56     cs2.setFont(f1);
    57     cs2.setLocked(true);
    58     cs2.setWrapText(true);
    59     row = hsSheet.createRow(0);
    60     hsSheet.createFreezePane(0,1,1,1);
    61     for(int i=1; i<10;i++)
    62     {
    63     cell = row.createCell((short)i);
    64     cell.setCellValue("Excel Column "+i);
    65     cell.setCellStyle(cs2);
    66     }
    67     workBook.write(out);
    68     out.close();
    69     
    70     //Read the file that was created.
    71     
    72     FileInputStream fin = new FileInputStream("C:/mydirectory/myfiles/testexcel.xls");
    73     byte b[] = new byte[fin.available()];
    74     fin.read(b,0,b.length);
    75     fin.close();
    76     
    77     wdContext.currentContextElement().setDataContent(b);
    78     }
    79     catch(Exception e)
    80     {
    81     wdComponentAPI.getComponent().getMessageManager().reportException("Exception while reading file "+e,true);
    82     }
    83     //@@end
    84     }
    I don't know why this happen? Any information I will appreciate it.
    Thanks in advance!!!
    Tokio Franco Chang

    After test the code lines appears this error stacktrace:
    [code]
    java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook
         at com.sap.tc.webdynpro.progmodel.api.iwdcustomevent.ExportToExcel.onActionAct1(ExportToExcel.java:232)
         at com.sap.tc.webdynpro.progmodel.api.iwdcustomevent.wdp.InternalExportToExcel.wdInvokeEventHandler(InternalExportToExcel.java:147)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
         at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:252)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:392)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:345)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:323)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:865)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:240)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:159)
    Thanks in advance!!!
    Tokio Franco Chang
    [/code]

  • Any way to export to specified file size?

    Is there any way to export images so they are sized to fit within certain dimensions AND a specified file size? Similar to 'image processor' in Bridge/CS3 or the older Doc Brown's image processor.
    Example: (processing images for web use)
    I want to export a batch of RAW files to jpg,
    Size them to fit within 800px x 800px,
    And have them be a consistent file size of around 100kb
    (This has been possible to do in Adobe Bridge for years)
    I know I can edit Aperture's export preferences and adjust the image quality slider but final images have a range of file sizes and I find myself having to re-export some images over again after adjusting image quality to reach the desired size. This is a trial and error process each time.
    Another workaround is to export the images as .tif files, then open in Adobe Bridge and process into jpg's using 'image processor' to reach the desired size. But that effectively negates the use of Aperture in the first place for batch processing files for size. In this case, it'd be more efficient to take Aperture out of my workflow completely and do everything in Adobe Bridge.
    Has anyone found a plug-in or less tedious workaround for this?
    Cheers,
    J

    James, you said "my website provider places an upper limit on file size and dimensions per image."
    Aperture does take care of half of that, the pixel dimensions. If it was me, I would test out a few images at various levels of jpg quality (5, 6, 7 etc.) and see where both the file size ends up and how the quality looks. Then, just go with one your favorite combinations. Images with more detail will be larger and images with less will be smaller. In the long run, it should even out. If you had the ability to request a certain size, some of your images may look good and others bad. Personally, I would be more concerned with quality than a few k of pixels.

  • Is there any way to export all of my parameters to a text file at once?

    I need my parameter for another report and i don't wan tot create same parameter again, i can export and import the parameters one by one but there are many parameter and i don't want to do this procedure for each of my parameter separately!
    My question is, is there any way to export all of my parameters to a text file at once?
    Thank you

    hi, Jamie Wiseman
    I think my question wasn't clear.
    what i am asking for i want to copy parameters itself as parameter to another report , not just parameter field name.
    I put some picture about where i want please check attached.
    As you see there is export function inside of export but i dont want to do this procedure of each of my parameters , i want to export them at once.
    SO do you have any idea for this

  • Any way to export from iPhoto and have the file date be the photo date?

    I can't deal with iPhoto any longer. I just imported photos from the last few days and they ended up being associated with some "Event" from Jul 19, 2007. So now I have an event that spans Jul 19, 2007 to Feb 21, 2009!!! I'd like to just display, sort, view all photos in my library by date (I am meticulous about dates on all my devices) but apparently that's not possible anymore. "Events" is the worse thing to ever happen to my photo library...
    So I'd like to export them all and just use the Finder. It actually works the way I'd like. However there does not seem to be any way to export the photos so that the file creation or the file modification date is the actual date the photo was taken as shown in the information box in iPhoto. Does anyone know how to to this? Or is this just the iPhoto engineers screwing with people like me who have gotten disgusted with their product?
    Thanks!

    Yes, I know what the Finder is... The cool thing is it actually does know about the contents of the file. For example it can display thumbnails of the images contained within.
    Even better the files can be sorted any way you want, are not hidden in some odd proprietary package, can be backed up, restored at will and can easily be programmatically changed using AppleScript. The file system for an OS is generally bullet-proof and as such doesn't screw with dates like iPhoto did (the events stuff screwed with all our dates and has been a disaster for us and the 40,000 or so pictures we had in our library).
    iPhoto has just gotten too modal, too bloated, and too proprietary while not providing the basics like a way for my wife and I to have a single library for all our photos. On the other hand using just the file system and some network storage this is easy.
    For the recored most pros I consulted with have moved to the file system and Finder as their primary means of managing their photos. I'm just looking for an easy way to get my stuff out of iPhoto so I can do the same.

  • Any FM or other ways to open the Excel file with data

    Please provide some Help, where I need to open the excel File  with some static  data (header data) from the Selection screen application Toolbar on clicking the button
    Thanks
    Ravindra

    Hi here is good example.
    Satish
    Reads an existing Idoc and dispays the contents in a spreadsheet format
    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

  • Export tables to excel

    I had the free trial of Acrobat 9 pro and I was able to export tables to Excel without any issues. Bought Acrobat 9 and now I am not able to get the tables exported. Does anybody have any suggestions? Is pro that much better for exporting  tables?

    The trial and full version are identical except for the licensing aspect. General export to Excel was not available until AA XI, so I am not quite sure how you were exporting. In XI, it is simply going to File>Save As>SpreadSheet. In AA 9, the typical process was to select the columns desired with the select tool (use the alt key to allow the selection) and copy the columns to Excel. Adobe has not sold AA 9 for over 4 years as I recall. I did finally get AA 9 to come up on a machine and they did have a save as/export to XML (spreadsheet). However, the use of the alt key with the select also worked. As I recall, there was a way to copy in multiple columns too, but I am too rusty with 9 to remember.
    The problem may be the format of what you are trying to export. You did not indicate what the problem of the export was and so it is hard to judge. What specifically is happening when you try to export a table. A screen shot might help.

  • Export table to excel

    Hi
    plesae see example that I send , its export data from table to excel file and save the excel file in c:
    the main problem I have number with 20 digit and other number with 15 digit , when I save and open in using excel the number look as
    8.9972E+19 and other number is 3.596e+14
    I need to see the number in full format as its look in the table
    89972010311041561435
    359628040266996
    how can I do that
    Thanks 
    Attachments:
    Untitled 4.vi ‏13 KB
    13_10_2014_23_26.xls ‏1 KB

    Elyan_wisam wrote:
    Hi
    I want to do it in labview code , is there option that way
    thanks
    Sure there is a way. Learn ActiveX. There are examples that ship with LabVIEW.
    You'll need to read the relevant sections of the Excel Developer Reference for the version of Excel you have.
    I have linked to Excel 2013 version http://msdn.microsoft.com/en-us/library/office/ee861528%28v=office.15%29.aspx

  • Is there any way to export complete PR as an XML?

    hI,
    Please help me to know if there is any way to export Complete PR as an XML...if its der,then how we can do it?
    Also, if data is already der in database table then is it feasible to create a PR(reverse case)?
    Kindly Help.
    Thanks,
    Lina

    Hi
    You have the opton in PR to export to XML. But I am not sure whether it suits your requirment.
    Go to ME53N>Click on Export Button>Spread Sheet>Click the radion Button All Available formats>Select from Drop down SAP XML format
    Hope it helps
    Karthik

  • Best ways to view/display PDF/Excel files stored in the Database

    What are best ways to display/view PDF/Excel files stored in the Database? thanks L

    Thanks tom, sorry let me explain. Currently we have oracle forms screen, using webutil to store/view files into DB. client won't like the interface, they want us to make it more friendly, drag and drop if possible, load multiple files, as possible.. So I am exploring different ways to improve may be java (or jdev/any any other), different screen designs, different features for fileupload/download/view options.

Maybe you are looking for