DOWNLOAD into EXCEL -URGENT

Hi,
I am downloading data to excel file.
Some fields has data like 0013, but when it goes to excel cell, it becomes 13 instead of 0013. So, while uploading, it is a problem.... That to the field has check table and it looks for only 0013 and not 13.
If it had been numeric field, then i could have made 0013 by assignment. But it is a character field.
This object is on variant download/upload functionlaity. So, this program can be used for any report program to know its variants. I cannot know i am getting char/numc type of parameters.
Please suggest me whether i can handle somehow while downloading the data on to excel itself.
Can i have some function modules which will control the cell FORMATTING capabilities.
Regards,
Manjunatha.T.S

Hey MTS!!
This might actually sound very silly at the first look.
But if u can be sure that nothing will be done with the data in the file till the time it gets uploaded back into sap then u can probably do this.
u can't store 0015 as 0015 in excel.
but u can store it as OO15 (english character 'O')
now when u retrieve the data back, retrieve it in a type n variable of the requisite length....it will then be retrieved as 0015(zero zero one five)...
does that make a bit of sense....i know this is too weird...but i tested it works...may b it can help u too...
u can try this sample code...
types : begin of n_c,
n1(4) type n,
end of n_c.
types : begin of t_c,
c1(4) type c,
end of t_c.
data : itab type table of t_c with header line,
    ntab type table of n_c with header line.
itab-c1 = 'oo12'.
append itab.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename                        = 'C:\num.txt'
   FILETYPE                        = 'ASC'
   WRITE_FIELD_SEPARATOR           = ' '
  tables
    data_tab                        = itab
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.
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename                      = 'C:\num.txt'
   FILETYPE                      = 'ASC'
   HAS_FIELD_SEPARATOR           = ' '
  tables
    data_tab                      = ntab
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.
loop at ntab.
  write :/ ntab-n1.
endloop.
once u have this data back in ur table, then u can convert it again to character and proceed with ur logic...
rgds,
PJ
Message was edited by: Priyank Jain
Message was edited by: Priyank Jain

Similar Messages

  • Downloading into excel file , the is alignment is out

    The  reports when downloading into excel file is not what we usually getting. The alignment is out.

    Hi Basavaraj,
    When you are creating dynamic internal table(itab1) and fields of internal table, at the same time in the same way  create one more internal table(itab2) resrict this up to 10 columns.
    now
    DATA : num type i,
           FNAME(255) TYPE C
               VALUE '/data/sapdata/filename'.
    CONSTANTS : C_COMMA TYPE C VALUE ','.
    DATA : BEGIN OF I_DISPLAY OCCURS 0,
            REC(400),
           END OF I_DISPLAY.
    loop at itab1
    num = num + 1.
      if num le 100.
       move-corresponding fields to itab2
      else.
        exit.
      endif.
    endloop.
      Give column headings
            itab2-col1 =  'name1'
            itab2-col2 =  'name2'
            itab2-col3 =  'name3'
            itab2-col4 =  'name4'
            itab2-col5 =  'name5'
            itab2-col6 =  'name6'
            itab2-col7 =  'name7'
            itab2-col8 =  'name8'
            itab2-col9 =  'name9'
            itab2-col10 =  'name10'
          INSERT itab2 INDEX 1.
          CLEAR itab2.
    loop itab2.
       CONCATENATE
            itab2-col1
            itab2-col2
            itab2-col3
            itab2-col4
            itab2-col5
            itab2-col6
            itab2-col7
            itab2-col8
            itab2-col9
            itab2-col10
               into I_DISPLAY-REC SEPARATED BY C_COMMA.
         APPEND I_DISPLAY.
         CLEAR I_DISPLAY.
      ENDLOOP.
    OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE.
          LOOP AT I_DISPLAY.
            TRANSFER I_DISPLAY TO  FNAME.
          ENDLOOP.
        CLOSE DATASET FNAME.
    endloop.

  • WUO-712 : Webutil Error while downloading into Excel

    Hello Everyone,
    I have installed oracle Application server 10g (10.1.2.0.2) with webutill.
    But while downloading data into Excel sheet it's through an error WUO-712 randomly due to which some of the data is missed out.
    We have installed webutil 10.5 with forms and reports 10g.
    Please suggest some solution for the same.
    Please revert for the same ASAP.
    Thanks in advance
    Regards,
    Ajinkya
    Edited by: Ajinkya on Nov 3, 2009 10:45 PM

    Please reply for this thread.......:)

  • Internal table to be downloaded into excel is empty

    Hi everybody,
    I created a page where I'm displaying in a table all the records. OnInitialization, I set my RFC needed to get the data from the Prod.Server and so far is displaying fine the data when I test it.
    Now, I want to download that table into excel so I created a buttom in the Layout and in the same page OnInputProcessing I'm checking the event (IF event_id = CL_HTMLB_MANAGER=>EVENT_ID) to check if the new button was trigered. Next, I copied the solution given by Thomas in the weblogs "BSP Download to Excel in Unicode Format" but when I check my table already displayed and needed by the function 'SCMS_STRING_TO_XSTRING', now is empty.
    I set the Automatic Page Attribute for my table ON but still is empty.
    Do I have to set something else to retain or get my table OnInputProcessing?
    Thanks in advance for your quick answer.
    Juan

    Thanks everybody for your quick answers.
    You are all rights, when I set my page Stateful it solve my problem and I'm getting my table with Data.
    Now, I'm having a second problem.
    As I told you before, I only have one page where in OnInitialization I'm displaying a table, that's fine. I include a button to download the table into excel and I copied the Thomas code into the same page OnInputProcessing Event. I test it in debug mode and it's going fine thrue all the statements: executing the Funtion 'SCMS_STRING_TO_XSTRING' and executing the following statements response->set_header_field and so on..
    The problem is when getting the last statement:
    response->set_data( data = l_xstring
    length = l_len ).
    navigation->response_complete( ).
    My current page becomes blank with no dialog to download the file.
    Here is my code from OnInputProcessing event, sorry for the long message.
    CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
    DATA: WA LIKE LINE OF ZIMSLOC.
    DATA: UNRESTQ(17) TYPE C,
          KLABS(17) TYPE C.
    data: name(60) type C,
          l_string type STRING,
          l_xstring type XSTRING,
          l_len type I,
          APP_TYPE(60) type C.
    DATA: response TYPE REF TO if_http_response.
    create object response type cl_http_response exporting add_c_msg = 1.
    constants: crlf type string value cl_abap_char_utilities=>cr_lf,
               tab type string value cl_abap_char_utilities=>horizontal_tab.
    Optional: test that this is an event from HTMLB library.
    IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
    See if download is triggered from button
      DATA: event TYPE REF TO CL_HTMLB_EVENT.
      event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
      IF event->name = 'button' AND event->event_type = 'click'.
        DATA: button_event TYPE REF TO CL_HTMLB_EVENT_BUTTON.
        button_event ?= event.
      ENDIF.
      CASE event->id.
        WHEN 'download'.
          LOOP AT zimsloc INTO WA.
            UNRESTQ = WA-UNRESTRICTEDQ.
            KLABS = WA-KLABS.
            CONCATENATE l_string
            WA-WERKS tab
            WA-MATNR tab
            WA-CHARG tab
            WA-LICHA tab
            WA-MAKTX tab
            KLABS tab
            UNRESTQ tab
            WA-SOBKZ tab
            WA-SONUM tab
            WA-MEINS tab
            crlf
            INTO l_string SEPARATED BY SPACE.
          ENDLOOP.
          APP_TYPE = 'APPLICATION/MSEXCEL; charset=utf-16le'.
          call function 'SCMS_STRING_TO_XSTRING'
            EXPORTING
              text     = l_string
              MIMETYPE = APP_TYPE
            IMPORTING
              BUFFER   = l_xstring.
    Add the Byte Order Mark - UTF-16 Little Endian
          concatenate  cl_abap_char_utilities=>byte_order_mark_little
                       l_xstring
                       into l_xstring in byte mode.
          response->set_header_field( name = 'content-type'
          value = 'APPLICATION/MSEXCEL; charset=utf-16le' ).
    some Browsers have caching problems when loading Excel format
          response->delete_header_field( name =
          if_http_header_fields=>cache_control ).
          response->delete_header_field( name =
          if_http_header_fields=>expires ).
          response->delete_header_field( name =
          if_http_header_fields=>pragma ).
    start Excel viewer either in the Browser or as a separate window
          response->set_header_field( name = 'content-disposition' value =
    'attachment; filename=webforms.xls' ).
    finally display Excel format in Browser
          l_len = xstrlen( l_xstring ).
          response->set_data( data = l_xstring
          length = l_len ).
          navigation->response_complete( ).
        WHEN others.
      ENDCASE.
    ENDIF.
    Thanks againg for your help.
    Juan

  • Reg. Reports download into excel

    Hello Everyone,
    I have installed oracle Application server 10g (10.1.2.0.2) with webutill.
    But while downloading data into Excel sheet it's through an error WUO-712 randomly due to which some of the data is missed out.
    We have installed webutil 10.5 with forms and reports 10g.
    Please suggest some solution for the same.
    Please revert for the same ASAP.
    Thanks in advance
    Regards,
    Ajinkya

    in report we are using local currency and parallel currency. one colum local currency and another colum parallel currency shwoing in report, but i transfer to excel shwoig following format.
    account no     local currency     account no     paraelll currency
    we need following format in excel
    account no    local currency       parellel currency
    regards
    JK Rao

  • Download into excel

    Hi all,
    is there any function module which i can download the excel sheet into internal table.
    I have requirement like this way.
    i have two records in excel file like
    a   b   c   10 100
    a   b   c   20 100
    I have to copy into internal table these values as it is and then I want to do calculations based on 10 & 20.
    I am trying to do it with Field symbols but not able to do so.
       LOOP AT INTERN1.
         IF   KZHEADER = 'X'
          AND INTERN1-ROW = 1.
            CONTINUE.
         ENDIF.
         TIND = INTERN1-COL.
         CONCATENATE 'DATA_TAB-VALUE_' TIND INTO ZWFELD.
         ASSIGN (ZWFELD) TO <fs1>.
         <fs1> = INTERN1-VALUE.
         AT END OF ROW.
           APPEND DATA_TAB.
           CLEAR DATA_TAB.
         ENDAT.
       ENDLOOP.
    Any suggetions are really appreciatable.
    shylesh

    Hi,
    FM : 'SXPG_COMMAND_EXECUTE'
    For full program code check the following link:
    http://www.sap-img.com/abap/download-in-background-in-excel-format.htm
    Regards,
    Bhaskar

  • Chinese char disorder from SAP download into Excel

    Hi all,
    I used t_code PA30 to input one person name and the name is '&#29130;'. But when I use customizing report to display and download the person information into Excel,
    the display is ordinary and the person name is disorder in the downloaded excel.
    the '&#29130;' changed the interrogation mark.
    But I use the customizing report to download the other information, that is ordinary.
    I don't know the reason, and I hope everybody help me to resolve the error.
    Thanks
    Ma Chao

    Hi,
    1. WS_DOWNLOAD is obsolete. use fm GUI_DOWNLOAD
    For search and replace a character in string please check this code , may this will be useful to you
    DATA : find(33) TYPE c VALUE 'xx_aa_yy_zz_xx_yy_yyb_yy_yybyy_1',
    len LIKE sy-fdpos.
    len = 1.
    WRITE:/ find.
    WHILE sy-subrc = 0.
    SEARCH find FOR 'yy_' STARTING AT len.
    CHECK sy-subrc = 0.
    len = len + sy-fdpos + 1.
    REPLACE '_' WITH '*' INTO find+len(1).
    ENDWHILE.
    WRITE:/ find.
    aRs

  • ChartView and FilterView are overlapping whenever I download into Excel

    Hi,
    I have a report with chart view as well as filterview resides at the bottom of the chart.
    Whenever am trying to download the report into Excel the Filterview is over lapping on the Chart View.
    Can you guys please suggest how can i overcome this.
    Thanks in advance,
    Pramod

    This an extract from Oracle metalink..
    This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.
    Applies to:
    Answers, Interactive Dashboard - Version: 10.1.3.4.1 [1900] - Release: 10g
    Information in this document applies to any platform.
    Symptoms
    When downloading reports that have multiple charts into Excel, the charts appear overlapping. The downloaded report(excel file) looks different from what it displayed in a dashboard.
    Cause
    There is a defect around downloading a request to excel that has multiple views on the report
    This is as per a number of bugs already raised around this issue:
    Bug 8825314: TABLE VIEW OVERLAPPED WITH CHART VIEW IN THE EXCEL SHEET
    Bug 8478529: DOWNLOADED EXCEL SHEET HAS VIEWS THAT OVERLAP EACH OTHER
    Bug 7700214: DOWNLOADING TO EXCEL OVERLAPS THE CHART WITH THE TABLE VIEW
    Bug 7501223: DOWNLOADING TO EXCEL OVERLAPS THE CHART WITH THE PIVOT TABLE
    Solution
    The following bugs already raised to address this issue:
    Bug 8825314: TABLE VIEW OVERLAPPED WITH CHART VIEW IN THE EXCEL SHEET
    Bug 8478529: DOWNLOADED EXCEL SHEET HAS VIEWS THAT OVERLAP EACH OTHER
    Bug 7700214: DOWNLOADING TO EXCEL OVERLAPS THE CHART WITH THE TABLE VIEW
    Bug 7501223: DOWNLOADING TO EXCEL OVERLAPS THE CHART WITH THE PIVOT TABLE
    Workaround at this stage would be to use download to html/powerpoint.
    Hope this helps!
    Regards..

  • Change font size when download into Excel spreadsheet

    Dear all,
    When the users export the Web report into Excel spreadsheet, how can we smaller font size and removal of bold. Use the font size 10 instead of font 19.
    Thanks in advance,
    Kenps

    take reference of this doc: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e02729a3-34bd-2a10-6594-b618617f6d57

  • MM60 Download into Excel (not required)

    Hi,
    I would like to run the above report for a particular material type and whilst a colleague can run the report, mine goes into Excel automatically and does not generate anything.
    I assume this is a set-up/user profile problem but I would like to know how to turn the Excel bit off so that I can get a list of the information that I require.
    Thanks
    Keeley

    You make one query through SQVI using table join MARA , MARC  , MBEW , MAKT
    Vijay Vadgaonkar

  • Download into excel sheet

    Hi All,
    In a ALV report, i would like to donwload the final internal table into an excel sheet.
    The requirement is that the data should be filled from 8th row of excel sheet.
    I am using GUI_DOWNLOAD and it makes the data to dump from first line of excel sheet itself.
    How to incorprate the logic for these requirements?
    Your help will be sincerely appreciated.
    Thanks in Advance,
    Pavan
    Edited by: Pavan Sanganal on Dec 16, 2008 10:51 AM

    Hello Pavan,
    I think you have written a separate sub-routine for this. Use another internal table IT_XLS which has a similar structure as the int. table for ALV display (IT_ALV, say).
    Now try this piece of code:
    DO 8 TIMES.
      APPEND WA_XLS TO IT_XLS. "Populate 8 blank rows in the table
    ENDDO.
    LOOP AT IT_ALV INTO WA_ALV.
      WA_XLS = WA_ALV.
      APPEND WA_XLS TO IT_XLS.
      CLEAR WA_XLS.
    ENDLOOP.
    Use GUI_DOWNLOAD to download IT_XLS. Can you please tell what do you want to populate in these 8 blank rows?
    BR,
    Suhas

  • Function module to download into excel sheet in crm

    Hi,
            Needed the Function module to download the data from internal table into the excel sheet in the CRM
    <b></b>

    use
    FM :- GUI_DOWNLOAD
    Example Code.
    lv_file_name = 'c:abcd.xls'
    *----Load Detail Report Data to Excel File
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename                = lv_file_name
            filetype                = 'DAT'
            write_field_separator   = 'X'
            codepage                = '4103'
          TABLES
            data_tab                = lt_det_report
          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.
      ENDIF.
      IF sy-subrc <> 0.
    *   202 : Error Occurred while writing data to the file.
        MESSAGE e202(zusm_gen) .
        EXIT.
      ELSE.
        WRITE :/ text-042 , lv_file_name.
      ENDIF.
    :- lt_det_report---> is table for storing data .
                         it can be any type
    <b>Please Reward Points & Mark Helpful Answers</b>
    To mark Helpful Answers ;click radio Button next to the post.
    RadioButtons
    <b>o</b> Helpful Answer
    <b>o</b> Very helpful Answer
    <b>o</b> Problem Solved.
    Click any of the above button next to the post; as per the anwers
    <b>To close the thread; Click Probelm solved Radio Button next to the post , which u feel is best possible answers</b>

  • Taking download into excel from ALV Grid - header is printing in two lines

    Hi All,
    I have a scenario where I am taking the download from ALV grid to an excel sheet. Now the header of the ALV (column names) is appearing in two lines in the downloaded excel sheet while items (records of the ALV table) are getting displayed in a single line.
    This download is taken from the standard download to local file (spreadsheet) button provided by SAP for ALVs.
    I am using function module "Reuse_alv_grid_display" for the purpose.
    Can somebody provide an idea how I can avoid the header printing in two lines and keep the length as it is.
    Thanks in Advance,
    Chandan

    Hi..
    1. Pass header name in internal table appned first line.
    2. after that pass u r data .
    3. Use  FM. WS_DOWNLOAD 
    Salil ......
    Edited by: salil chavan on Nov 26, 2008 11:07 AM

  • Help remittance does not download into excel fully!

    Hi  have purchased the PDF to excel converter for business purposes. I often receive remittances that are in excess of 400 lines that I spend a great deal of time trying to reconcile. Why oh why does the converter only download half a page of each remittance for me instead of the whole page and all the data.
    The frustrating thing is it does a specific amount of lines and hen jumps to the next page I wold rather it did not do any at all at least I would know then that it is just not possible.
    Ay input would make my life a hell of a lot easier and lessen he speed of the grey hairs am beginning to grow with all the stress of this programme.
    Many thanks

    What is the exact name of your product? This forum is for Acrobat that can do the conversion, though not necessarily well -- depends a lot on how the PDF was created. It may be that you are not talking about an Adobe product.

  • Download into excel file

    Dear experts,
    While iam downloading the data into .xls file iam getting one extra emptly column. How can i avoid it?
    Thanks in advance
    kaki

    DO NOT use the suggested function modules mentioned here, they are not unicode enabled.
    If you have to choose another download funtion use the methods in class cl_gui_frontend_servives.

Maybe you are looking for

  • Adobe X Printing page ranges in pdf's with multiple sections

    I'm trying to print a page range in a document that is divided into sections that start over with page 1 or page i, and using an absolute page range doesn't work.  For example, the document has an initial cover page up to the Contents page numbered i

  • SOAP validation error

    hi all, I am trying to validate a simple soap message against soap schema and the xml message part against my own schema. I am getting the following error: Envelope unmarshalled :[Attributes={}] [Header=null] [Body=[Attributes={}] [Body Entries= [(0)

  • Can make manually but not via PKGBUILD

    I'm trying to install exonerate from the AUR, where it is now an orphan. When I run makepkg -s, it fails. The PKGBUILD looked a little bit funny (just old?) so I attempted to expand and modify the build section as follows. build() { cd "$pkgname-$pkg

  • Compounded Problems after updating to 10.5.8

    I am desparate. Since upgrading my systems, including to 10.5.8, Safari 4 and iTunes 9 I now cannot print, cannot connect to iTunes Store (says no internet connection), cannot run AutoUpdate (also no internet connection) and now iTunes will not login

  • Getting ORA-01401for NVARCHAR2 greater than 1000 chars.

    I have a table with column PATTERN NVARCHAR2(1024). When I try to insert 1024 chars I get an error - INSERT INTO test VALUES('AAA..1024times') ERROR at line 1: ORA-01401: inserted value too large for column but INSERT INTO test VALUES(N'AAA..1024time