Excel Download of ALV with one column containing leading zeros

Hello Experts,
I have the requirement in which the first column is of type company code (T001-BUKRS). So if the company code is '0061', then on the ALV display its displayed as '0061', but when it is downloaded to Excel sheet, it shows '61' in place of '0061'.
Is there any way we can display in the downloaded Excel as 0061?
Any pointers could help.
Regards,
Mansi.

Hi Mansi,
I think its because of excel property.You can format cell of excel to category 'special'.
regards
vivek

Similar Messages

  • Returning two rows with one column containing only one place

    Dear all;
    I have a query that returns two rows similar to this below
    ID      PLACE            PROGRAM
    A       NEWYORK      PROGRAM A
    A       NEWYORK      PROGRAM B
    I would like this instead
    ID      PLACE             PROGRAM
    A       NEWYORK       PROGRAM A
                                   PROGRAM  B
    All help is appreciated. Thank you.Edited by: user13328581 on Mar 22, 2011 11:52 AM

    user13328581 wrote:
    WOW...THanks a lot Solomon, I have never used partitions and row_number in such a manner...can you please explain your logic.Sure:
    row_number() over(partition by id order by place,program)This will take all rows returned by the query andsplit them into buckets (partitions) by id. Inside each bucket it will order rows by place and program and assign them row numbers. So for each ID row number 1 will be row with first (alphabetically) place first programt. And this is the row where we want ID to show up. That is why we wrap the above analytic function in CASE statement which will do exactly that. Now:
    row_number() over(partition by id,place order by program)does pretty much the same just bucket is ID and PLACE combination. So for each such combination we want to show only for the first (alphabetically) programt.
    Now notice in ORDER BY clause I prefix ID and PLACE with table alias. You must do it since otherwise query alias ID and PLACE will take precedence resulting in wrong sort order (remember we nulled all ID and PLACE except for row number 1).
    SY.

  • Excel download from ALV not working inproduction

    Hi all,
    I am using "set_table_for_first_display" for alv display. the excel download from alv is woking fine in development and quality stystem but in production only first 3-4 rows are getting downloaded. Other rows donot appear in excel.
    Any Idea !!!
    Thanks
    Madhu

    Hi Experts,
    I have noticed that same problem is occuring in development system also with same set of data . The ascii file created has some missing rows. I guess its due to some special characters though i am not able to see any special character . Any solution for this.
    Regs
    madhu

  • In ALV  maintain  one column as color Green

    Hi ,
    In ALV  maintain  one column as color Green
    Thanks,
    Asha

    There are options in ALV grid to color whole row or cell, you want column (bad luck) so you will have to color cells.
    1-Add a field of type LVC_T_SCOL to the internal table.
    2-Fill the internal table with your application data.
    3-Loop once again at the table, add one record into the LVC_T_SCOL field, with the fieldname of the column and the color you want, update every record.
    4-In the layout of the grid, give the extra field name to subfield CTAB_FNAME.
    - Réf: Coloring Cells in ALV Grid Control (BC-SRV-ALV)
    - Sample: Program to color columns , rows and cells of an alv grid(oops)
    Regards,
    Raymond

  • Facing problem with the code for sending an .xls attachment via email, a field value contains leading zeros but excel automatically removes these from display i.e. (00444 with be displayed as 444).kindly guide .

    Facing problem with the code for sending an .xls attachment via email, a field value contains leading zeros but excel automatically removes these from display i.e. (00444 with be displayed as 444).kindly guide .

    Hi Chhayank,
    the problem is not the exported xls. If you have a look inside with Notepad or something like that, you will see that your leading zeros are exported correct.Excel-settings occurs this problem, it is all about how to open the document. If you use the import-assistant you will have no problems because there are options available how to handle the different columns.
    Another solution might be to get familiar with ABAP2XLS-Project. I got in my mind, that there is a method implemented, that will help you solving this problem. But that is not a five minute job
    ~Florian

  • Convert a table with one column to panelList with outputText

    Hi,
    I have a table with one column, I would like to change it to use panelList to present it instead. What will be the syntax for panelList?
    <af:table value="#{bindings.ItasUiRuleParamsVO2.collectionModel}"
    var="row"
    rows="#{bindings.ItasUiRuleParamsVO2.rangeSize}"
    emptyText="#{bindings.ItasUiRuleParamsVO2.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.ItasUiRuleParamsVO2.rangeSize}"
    rowBandingInterval="0"
    selectedRowKeys="#{bindings.ItasUiRuleParamsVO2.collectionModel.selectedRow}"
    selectionListener="#{bindings.ItasUiRuleParamsVO2.collectionModel.makeCurrent}"
    rowSelection="single" id="t2"
    partialTriggers="::t1">
    <af:column sortProperty="RuleName" sortable="true"
    headerText="#{bindings.ItasUiRuleParamsVO2.hints.RuleName.label}"
    id="c11">
    <af:outputText value="#{row.RuleName}"
    id="ot11"/>
    </af:column>
    </af:table>
    I tried this:
    <af:panelList id="pl1">
    <af:forEach items="#{bindings.ItasUiRuleParamsVO2.collectionModel}">
    <af:outputText value="#{item.RuleName}" id="ot14"/>
    </af:forEach>
    </af:panelList>
    but the error say:
    javax.servlet.jsp.JspException: "items" must point to a List or array
         at org.apache.myfaces.trinidadinternal.taglib.ForEachTag.doStartTag(ForEachTag.java:136)
    Any ideas?
    Thanks
    -Mina

    <af:forEach items="#{bindings.ItasUiRuleParamsVO2.collectionModel}" var="row">
    <af:outputText value="#{row.RuleName}" />
    </af:forEach>
    and make sure the table binding is still in place in your pagedef (or binding tab)

  • If I own a Macbook pro and an iMac can I have final cut pro downloaded to both with one purchase?

    If I own a Macbook pro and an iMac can I have final cut pro downloaded to both with one purchase?

    If you purchase Final Cut Pro X at the Mac App Store, you can install it in all your Macs free of charge as many times as you want. The same applies for all the applications you purchase at the Mac App Store

  • Excel Download to ALV report

    Hi Guys,
    I’m facing a peculiar problem.
    When I try to download an ALV report in excel format using (list ->export -> local file-> soread sheet )I’m not able to download complete set of records.
    Same is happening with ws_download,  even though the internal table contains all the record; the number of downloaded records are not same.
    Any one faced same problem. Pls. help me out.
    Regards,
    Sumit

    looks strange!!!!!!!!!!!
    change these in excel sheet and check out if it works
    Change the macro settngs in your excel sheet and checkout if it works
    Open empty excel sheet
    In menu Tools>Macros>Security , change the radiobutton to medium
    And also
    In the Same popup , goto the second tab Trusted Publishers and check the checkbox Trust access to visual basic Project

  • Problem in excel download of ALV report

    Hi All,
    I have created an ALV report with 87 fields in it. Whenever I am trying to download that report into excel the number of column breaks into 2 rows. In this case, The downloaded file contains 57 Columns in 1 row and remaining 29 Columns in second row. Can anyone please help me in understanding why this is happening while downloading this report into excel file and what will be the solution to correct it.
    To download the file I am using the icon placed at application toolbar or ( Cntrl + Shift + F9 ).
    Waiting for your response.
    Regards.
    Pravesh

    HI Parvesh,
          If you want to download the ALV result to you local file however you can follow the below coding.
    DATA:  l_filename    TYPE string,
           l_filen       TYPE string,
           l_path        TYPE string,
           l_fullpath    TYPE string,
           l_usr_act     TYPE I.
    l_filename = SPACE.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
      EXPORTING
        DEFAULT_FILE_NAME    = l_filename
      CHANGING
        FILENAME                     = l_filen
        PATH                 = l_path
        FULLPATH             = l_fullpath
        USER_ACTION          = l_usr_act
      EXCEPTIONS
        CNTL_ERROR           = 1
        ERROR_NO_GUI         = 2
        NOT_SUPPORTED_BY_GUI = 3
        others               = 4.
    IF sy-subrc = 0
          AND l_usr_act <>
          CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        FILENAME                        = l_fullpath
       FILETYPE                        = 'ASC'
      TABLES
        DATA_TAB                        = T_DOWNL
    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.

  • Excel download from ALV grid, for characters more than 1020

    Hi,
    When i am trying to download the report which is having character more than 1020, it is coming in two rows. I want all fields in one row. Please give solutions.
    I am using below field catalog.
    Car Eligibility
      CLEAR lw_fieldcat.
      lw_fieldcat-fieldname = text-001.
      lw_fieldcat-reptext_ddic = text-011.
      lw_fieldcat-tabname = text-021
      APPEND lw_fieldcat TO gt_fieldcat.
    I am using below FM.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          is_layout          = gt_layout
          it_fieldcat        = gt_fieldcat[]
          it_sort            = gt_sort[]
          it_events          = gt_events[]
        TABLES
          t_outtab           = gt_data
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    Thanks in Advance,
    Ravi Kumar

    ravi,
    its not about how you have used your field catalog or how you called ALV FM. its excel download functionality,
    what you need to do is:
    set pf-status '<<some value>>' -> you can find where to pass in ALV FM call.
    then add a application toolbar button though this pf status.
    then at  use_command event, check sy-ucomm and if its the same as your new icons fcode then use the method to download it in excel.

  • ALV with dynamic columns and description labels in header titles

    Hi everybody,
    I have to implement an ALV whose columns are not defined until runtime. Is it possible to do that in some simple way? Is it necessary to use objects to define this kind of ALV's?
    And another one query, is it possible to add description labels to column headers so that when the user points with the cursor in them he/she gets a little explanation about the detail of the column (for example, description name of the product hierarchy when pointing to the column named with one of the existing hierarchies, i.e 010102102)
    Thanks in advance,

    for your first question check this
    Just check this sample from one of the SAP site
    ABAP Code Sample for Dynamic Table for ALV with Cell Coloring
    Applies To:
    ABAP / ALV Grid
    Article Summary
    ABAP Code Sample that uses dynamic programming techniques to build a dynamic internal table for display in an ALV Grid with Cell Coloring.
    Code Sample
    REPORT zcdf_dynamic_table.
    * Dynamic ALV Grid with Cell Coloring.
    * Build a field catalog dynamically and provide the ability to color
    * the cells.
    * To test, copy this code to any program name and create screen 100
    * as described in the comments. After the screen is displayed, hit
    * enter to exit the screen.
    * Tested in 4.6C and 6.20
    * Charles Folwell - [email protected] - Feb 2, 2005
    DATA:
    r_dyn_table TYPE REF TO data,
    r_wa_dyn_table TYPE REF TO data,
    r_dock_ctnr TYPE REF TO cl_gui_docking_container,
    r_alv_grid TYPE REF TO cl_gui_alv_grid,
    t_fieldcat1 TYPE lvc_t_fcat, "with cell color
    t_fieldcat2 TYPE lvc_t_fcat, "without cell color
    wa_fieldcat LIKE LINE OF t_fieldcat1,
    wa_cellcolors TYPE LINE OF lvc_t_scol,
    wa_is_layout TYPE lvc_s_layo.
    FIELD-SYMBOLS:
    <t_dyn_table> TYPE STANDARD TABLE,
    <wa_dyn_table> TYPE ANY,
    <t_cellcolors> TYPE lvc_t_scol,
    <w_field> TYPE ANY.
    START-OF-SELECTION.
    * Build field catalog based on your criteria.
    wa_fieldcat-fieldname = 'FIELD1'.
    wa_fieldcat-inttype = 'C'.
    wa_fieldcat-outputlen = '10'.
    wa_fieldcat-coltext = 'My Field 1'.
    wa_fieldcat-seltext = wa_fieldcat-coltext.
    APPEND wa_fieldcat TO t_fieldcat1.
    wa_fieldcat-fieldname = 'FIELD2'.
    wa_fieldcat-inttype = 'C'.
    wa_fieldcat-outputlen = '10'.
    wa_fieldcat-coltext = 'My Field 2'.
    wa_fieldcat-seltext = wa_fieldcat-coltext.
    APPEND wa_fieldcat TO t_fieldcat1.
    * Before adding cell color table, save fieldcatalog to pass
    * to ALV call. The ALV call needs a fieldcatalog without
    * the internal table for cell coloring.
    t_fieldcat2[] = t_fieldcat1[].
    * Add cell color table.
    * CALENDAR_TYPE is a structure in the dictionary with a
    * field called COLTAB of type LVC_T_SCOL. You can use
    * any structure and field that has the type LVC_T_SCOL.
    wa_fieldcat-fieldname = 'T_CELLCOLORS'.
    wa_fieldcat-ref_field = 'COLTAB'.
    wa_fieldcat-ref_table = 'CALENDAR_TYPE'.
    APPEND wa_fieldcat TO t_fieldcat1.
    * Create dynamic table including the internal table
    * for cell coloring.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
    it_fieldcatalog = t_fieldcat1
    IMPORTING
    ep_table = r_dyn_table
    EXCEPTIONS
    generate_subpool_dir_full = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * Get access to new table using field symbol.
    ASSIGN r_dyn_table->* TO <t_dyn_table>.
    * Create work area for new table.
    CREATE DATA r_wa_dyn_table LIKE LINE OF <t_dyn_table>.
    * Get access to new work area using field symbol.
    ASSIGN r_wa_dyn_table->* TO <wa_dyn_table>.
    * Get data into table from somewhere. Field names are
    * known at this point because field catalog is already
    * built. Read field names from the field catalog or use
    * COMPONENT <number> in a DO loop to access the fields. A
    * simpler hard coded approach is used here.
    ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'ABC'.
    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'XYZ'.
    APPEND <wa_dyn_table> TO <t_dyn_table>.
    ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'TUV'.
    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    <w_field> = 'DEF'.
    APPEND <wa_dyn_table> TO <t_dyn_table>.
    * Color cells based on your criteria. In this example, a test on
    * FIELD2 is used to decide on color.
    LOOP AT <t_dyn_table> INTO <wa_dyn_table>.
    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table> TO <w_field>.
    * Get access to internal table used to color cells.
    ASSIGN COMPONENT 'T_CELLCOLORS'
    OF STRUCTURE <wa_dyn_table> TO <t_cellcolors>.
    CLEAR wa_cellcolors.
    wa_cellcolors-fname = 'FIELD2'.
    IF <w_field> = 'DEF'.
    wa_cellcolors-color-col = '7'.
    ELSE.
    wa_cellcolors-color-col = '5'.
    ENDIF.
    APPEND wa_cellcolors TO <t_cellcolors>.
    MODIFY <t_dyn_table> FROM <wa_dyn_table>.
    ENDLOOP.
    * Display screen. Define screen 100 as empty, with next screen
    * set to 0 and flow logic of:
    * PROCESS BEFORE OUTPUT.
    * MODULE initialization.
    * PROCESS AFTER INPUT.
    CALL SCREEN 100.
    * MODULE initialization OUTPUT
    MODULE initialization OUTPUT.
    * Set up for ALV display.
    IF r_dock_ctnr IS INITIAL.
    CREATE OBJECT r_dock_ctnr
    EXPORTING
    side = cl_gui_docking_container=>dock_at_left
    ratio = '90'.
    CREATE OBJECT r_alv_grid
    EXPORTING i_parent = r_dock_ctnr.
    * Set ALV controls for cell coloring table.
    wa_is_layout-ctab_fname = 'T_CELLCOLORS'.
    * Display.
    CALL METHOD r_alv_grid->set_table_for_first_display
    EXPORTING
    is_layout = wa_is_layout
    CHANGING
    it_outtab = <t_dyn_table>
    it_fieldcatalog = t_fieldcat2.
    ELSE. "grid already prepared
    * Refresh display.
    CALL METHOD r_alv_grid->refresh_table_display
    EXPORTING
    i_soft_refresh = ' '
    EXCEPTIONS
    finished = 1
    OTHERS = 2.
    ENDIF.
    ENDMODULE. " initialization OUTPUT

  • ALV with variable columns

    Hi All,
    I have to do a ALV with variable no. of columns. i.e Depending on the data , the columns should get populated.
    Thanks in advance.
    Dnyanesh

    Hi Dnyanesh,
        If you know the no. of columns to be used in the ALV before hand then you can change the field catalog.
    but if you dont know the no. of columns then you can create dynamic table.
    eg:
    1. Create your field catalog either manually or automatically using the function module, LVC_FIELDCATALOG_MERGE. Add more rows to the field catalog table (T_FIELDCAT) at run time.
    2. Use the field catalog to create a table dynamically using the method below.
    DATA: T_OUTPUT TYPE REF TO DATA
    FIELD-SYMBOLS: <T_OUTPUT> TYPE TABLE
    Call Method CL_ALV_TABLE_CREATE->CREATE_DYNAMIC_TABLE
    Exporting
    IT_FIELDCATALOG = T_FIELDCAT
    Importing
    EP_TABLE = T_OUTPUT
    ASSIGN T_OUTPUT->* TO <T_OUTPUT>.
    Now the field symbol <T_OUTPUT> is pointing to an output table of the structure that contains the fields which were determined at runtime. Now fill this table with the data and pass <T_OUTPUT> to the method SET_TABLE_FOR_FIRST_DISPLAY and the ALV grid should show the data properly.
    Example:
    *the content of itab will be fields of the new table
    loop at itab1 into wa1.
      Gs_FIELDCAT-TABNAME     = 'itab2'.
      GS_FIELDCAT-FIELDNAME = wa1-packid.
      GS_FIELDCAT-OUTPUTLEN = 2.
      GS_FIELDCAT-KEY         = space.
      GS_FIELDCAT-SELTEXT_L = wa1-packid.
      GS_FIELDCAT-COL_POS     =  1.
      GS_FIELDCAT-JUST        = 'L'.
      APPEND GS_FIELDCAT TO GT_FIELDCAT.
    endloop.
    LOOP AT GT_FIELDCAT INTO GS_FIELDCAT.
         MOVE-CORRESPONDING GS_FIELDCAT TO ls_fcat.
         APPEND ls_fcat TO lt_fieldcat.
    ENDLOOP.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
                 EXPORTING it_fieldcatalog = lt_fieldcat
                          IMPORTING ep_table = t_output.
    you can refer the following link also.
    ALV grid
    hope this helps.
    do get back if you need further clarification.
    Regards,
    Kinshuk

  • Issue in Excel download from ALV output

    Dear Experts,
    I have generated an ALV Output using FM "REUSE_ALV_GRID_DISPLAY". When i try to download the ALV Output in Excel spreadsheet, I am not getting the data in Excel sheet. Kindly help me in this regard.
    Thanks in advance,
    Regards,
    Ramesh Manoharan

    hi ramesh,
    Please try below options.
    after getting the ALV disply , Go to Menu  LIST->Export->Spreadsheet.or microsoft excel view (Cntrl + Shift + F7)
    It will give some options to see the data in spread sheet format, hope you can save this to local desktop also.
    or
    please check the extension, it should be .XLS not .XLSX  .some times .XLSX format wont be supported
    regards,
    pradeep
    Edited by: Pradeep Kandgal on Aug 4, 2010 6:54 PM
    Edited by: Pradeep Kandgal on Aug 4, 2010 6:54 PM

  • Trigger event of Excel download in ALV

    From my menu bar on the screen can i trigger the alv
    excel download feature.

    Hi Kaushik,
    Check out the function module ALV_XXL_CALL.
    Srinivas

  • Problem with One column Unordered list.

    Help me out !!!
    I have a "one column unordered list" as my report template. The query will return atleast 5 rows at any given point of time. The page shows only 3 records. I tried modifying "Number of Rows" attributes etc., nothing works.
    Let me know what I'm doing wrong or how to fix it.
    Thanks
    - Richard

    Thanks for replying, Scott
    Here is the app http://htmldb.oracle.com/pls/otn/f?p=19793:1
    I want to display only 4 rows (table has around 10 rows). I couldn't display more than 2. If I change the template, then everything works fine. Its just with the "One Column Unordered List" template that is not working.
    Thanks.
    - Richard.

Maybe you are looking for

  • Validation of G/L account during ME51n

    Dear Sir, Using Me51n , We are creating PR having Item-Category as "D" and we need to validate the G/L code before saving of PR to ensure that correct G/L is mentioned . To perform the desired validation , I request the forum members to guide me abou

  • Is there a plug in for nuance pdf reader?

    I have stopped using Adobe Reader and started using Nuance PDF Reader. It is much more efficient and a much smaller footprint. My problem is that it will not open pdf documents imbeded in a web page. Example, I am trying to read my messages from Veri

  • How to remove 'Change to Text Mode' link on 'richTextEditor' item

    Hi, Now I'm using 'richTextEditor' item on my page. But above it, there is a link named 'Change to Text Mode'. How can I remove it? From profile, if I change the profile, it will be Text Mode only. But I want to use rich text mode, not use text mode.

  • How to call Function through Soap Action

    Hi all, I have a Receiver communication channel in PI that sends data to from the interface to Oracle Webservice. At that moment a function should be called with two constant parameters and the third one is the xml with all the data. updateExchangeRa

  • Business Service in Computers View

    Hello all, I would like to prepare one view where i will show all Computers which have related business service. It is easy to create view where Business service is empty or when containst to one Service but i would like to show service as a separate