ALV Grid Exporting to Excel - Columns out of order

Hi,
In my ALV grid everything is in order as it is in the structure. When however I export to excel from ALV grid, the columns are out of order. First it lists the string columns, then number columns and lastly date columns. Is there a way to make excel keep the same order as it is in ALV grid?
Thanks,
Sergiy

I am not much of an ABAPer but I was able to set the column position during data declaration with
gs_fcat_line-col_pos = 1, for example.
That would put the column in the first position in ALV as well as the excel export.
Thanks for your inputs.
Sergiy

Similar Messages

  • ALV Grid Download to Excel - Columns in wrong order

    I'm using the object cl_gui_alv_grid to output an ALV grid to the screen.  I've populated the field catalogue as follows:
    wa_alvfieldcat-col_pos = 1.
    wa_alvfieldcat-just = 'L'.
    wa_alvfieldcat-reptext = 'Customer Name'.
    wa_alvfieldcat-scrtext_s = 'Customer'.
    wa_alvfieldcat-scrtext_m = 'Customer'.
    wa_alvfieldcat-scrtext_l = 'Customer Name'.
    wa_alvfieldcat-outputlen = 35.
    wa_alvfieldcat-tabname = 'GTBL_REPORT'.
    wa_alvfieldcat-fieldname = 'CUST_NO'.
    The screen shows the table correctly in the order I've specified using COL_POS.  But when I select the download function from the ALV grid it moves all the date fields to the end instead of using the order I wanted.
    Any ideas?

      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'ZCONTRACT_REPORT'
        CHANGING
          ct_fieldcat      = tbl_alvfieldcat.
    then
      LOOP AT tbl_alvfieldcat INTO wa_alvfieldcat.
        MOVE 'GTBL_REPORT' TO wa_alvfieldcat-tabname.
        CASE wa_alvfieldcat-fieldname.
          WHEN 'DATE_ORDER'.
            wa_alvfieldcat-col_pos = 4.
            wa_alvfieldcat-just = 'L'.
            wa_alvfieldcat-reptext = 'Date Order'.
            wa_alvfieldcat-scrtext_s = 'Date Order'.
            wa_alvfieldcat-scrtext_m = 'Date Order'.
            wa_alvfieldcat-scrtext_l = 'Date Order'.
            wa_alvfieldcat-outputlen = 10.

  • ALV grid export to Excel 2003-f.01

    Hi all,
    I have an issue with ALV grid export to excel 2003 ,when i tried to download with the option as local file > xls file ,the report downloads with page breaks which the user does not want , each break comeswith header .
    With the option of list>export>xml sheet - the report downloads with out page break but with no header information like the name of the report and reporting period .The tcode is f.01 and the system is ECC6.
    Can any one suggest  how to download the report with tiltle of the report with no page break ?
    Thanks
    ske

    Hi
    What happens if you use the export/local file option - does that help at all or can you change the layout? Haven't got access to your release to check.
    Cheers
    David
    Edited by: David Berry on Oct 28, 2010 9:38 PM

  • ALV GRID Export to Excel button Missing

    HI All,
    I am facing some problem with ALV GRID. When excuting the report with my user id I am able to see the 'Export to Local file' button in the ALV GRID where as if i am excuting with another user id which is having less authorisations than the button is greyed out.  I checked by giving all authorisation than we are able to see the button.
    Could anyone please tell me which authorisation object we have to assign to see the buttons.
    Thanks & Regards,
    Murali.

    Hi,
    Before clicking on the Export to Excel button, start the debugging session by placing the command /H in the command prompt.
    Now, put the break point at statement AUTHORITY-CHECK. Now it will trigger all the authorization objects relevant to this.
    check the sy-subrc value gets failed.
    Regards,
    Santhosh.

  • Excel columns out of order

    Hello,
    I have an alv grid that shows some information and when i have to export that information to an excel file, in that file the columns doesn't appear in the same order than in the alv.
    Do you know what does it happen?
    Thanks

    Hello again,
    i have checked my fieldcatalog and my internal table and both have the same order, with the description field in the last position.
    Curiously, when i export the alv to an excel file, the description column doesn't appear in the last position, the amount field (decimal) appears in that position.
    could anyone help me?

  • ALV grid export to Excel

    I have created a dynamic table and it displays fine, problem is when I try to export, it is not exporting all the fields.  The columns all appear in the field catalog but I might have 24 columns and only 11 want to export.  Any one ever had this problem or can give me suggestions on what to do to fix this?

    To download specific columns, you can add a new button on output screen 'OUTPUT'. Disable standard Excel download functionality and code for this new button.
    If user clicks 'DOWNLOAD', download required columns in the excel file to a user specified location.
    You can display a po up to enter which columns user needs to download. You fieldcatalog will have field details. Get this into an internal table. Display a popup with these field names and checkboxes next to it. Whichever columns user need, he will select the same.
    Then you can code to get these details into the file.
    This is just an idea. You may have to work more after reading this and mapping to your requirement.
    Lisa,
    Hopefully this is helpful to you. Just to add a note here (as you are new to SDN), pls follow guidelines for awarding points to the helpful answers.
    Thanks
    ashish
    Message was edited by: Ashish Gundawar

  • ALV GRID - export only columns not faded out

    Hello,
    I hope that this is possible but till now I have no idea.
    The request is to provide a download/export function (moving the export file directly to a specific location the user is not allowed to modify-> so standard function not allowed based on specification) which will only export the columns from the ALV GRID which are not faded out.
    With the standard files download from the menu bar this is possible. 
    But how to do this starting with a self defined button?
    best regards
    Dirk

    hi,
    if u need a custmozied button with all standard ALV fucntions,
    1. goto <b>SE80</b>, under thre <b>function group SALV</b>, there will be <b>GUI_STATUS named as ST</b>ANDARD.
    2. copy that into ur program, and add ur own button in that , then write the code for that by chekcing SY-UCOMM.
    With Rgds,
    S.Barani

  • Leading Zeros Missing - When exporting data from ALV grid display to Excel

    Hi,
    Am exporting the data from ALV GRID DISPLAY to Excel sheet using standard toolbar icon 'Local file'
    the leading zeros displayed in the ALV output is missing in the EXCEL sheet.
    (eg)  in ALV o/p - 0029. 
            in Excel - Only 29 is appearing.
    As per the requiement i have to show the leading zeros in excel also.
    Pls help on this issue.
    Thanks in advance..

    Hi ,
      Please set the property  :
      wa_fieldcat-lzero = 'X' .
    when you are creating field catalog for display alv data .
    your prob will solved .
    Regards ,
    Nilesh Jain

  • Facing problem while downloading ALV grid Output into Excel

    Hi Guys,
    I am facing problem while downloading ALV grid Output into Excel.
    It is downloading into excel, but all character columns first and next all quantity columns it is displaying. But I need columns order as it is in the grid.
    If I take all columns as characters it works fine. But it will be problem for calculating total, subtotals of quantity columns
    Can someone help me regarding this
    thanks for your help

    Hi,
    Open up Excel on your desktop. Goto Tools > Macro > Security.
    Make sure that your security is set to Medium (or less). SAP uses OLE automation to run the Excel instance and in Office 2003 (for example), Microsoft has increased their default security setting to High. With the High setting, the output to Excel fails.
    Was this your problem? Don't forget those points, either.
    check with this wetther it is solved or not.
    Regards,
    sana.

  • Hi iam getting the alv grid data in excel format but iam facing one problem

    hi iam getting the alv grid data in excel format but iam facing one problem ,
    i.e., i want it read only  but iam getting it in edit mode i use layout default in excel iam getting in xl directly but in edit mode but i need it in read only mode
    what i have to do for that  and bdy knows reply me i need it urgently.

    there's always edit-mode if you choose excel-inplace - but noone can modify/rewrite the data
    A.

  • Save ALV grid to local excel-file in background

    Hi,
    i want to save a alv grid to an excel-file on a local fileshare using an background job..
    Does anybody know how this works?
    Thanks ahead

    DATA: file TYPE string VALUE `flights.dat`,
          wa   TYPE spfli.
    FIELD-SYMBOLS TYPE x.
    OPEN DATASET file FOR OUTPUT IN BINARY MODE.
    SELECT *
           FROM spfli
           INTO wa.
      ASSIGN wa TO CASTING.
      TRANSFER TO file.
    ENDSELECT.
    CLOSE DATASET file.
    <b>The binary data from database table SPFLI is transferred to a binary file flights.dat</b>

  • ALV grid with 2 changable columns - need to update a non changable column

    I have an ALV Grid that has 2 columns that are editable (this works fine).  These two add to the total column which is not editable.  I need the total column to get updated when these two are changed.  (I have a pushbutton for the user to hit after the changes are made so it can go through the code). 
    I have check in debug mode and my internal table is getting changed.  Even until the container is check to see if it is build, the value is correct, however, once it goes into CALL METHOD GR_GRID->REFRESH_TABLE_DISPLAY, the old total comes up.  The new data in the two changable fields are there and correct.   I have tried deleting the container but that had not affect on the issue.
    I have tried freeing my table and repopulating it, calling the screen again (after setting screen to zero).  It seems the container has some sort of memory or buffer that it is getting the data from. 
    Any ideas how to make it think it is a new 1st time display?
    Thank you in advance.

    Good day Michelle,
    I had the same senario, but i did not use REFRESH_TABLE_DISPLAY instead
    do one thing that is add a save button to the alv grid and then after you change the
    data copy the changed data to an internal table.
    a sample code.
    METHOD handle_toolbar.
        DATA:
          lw_toolbar TYPE stb_button.
        CLEAR lw_toolbar.
        lw_toolbar-function = 'SAVE'.
        lw_toolbar-icon = 'ICON_DETAIL'.
        lw_toolbar-butn_type = '0'.
        lw_toolbar-text = 'SAVE'.
          APPEND lw_toolbar TO e_object->mt_toolbar.
    ENDMETHOD.
    METHOD handle_user_command.
        CASE e_ucomm.
          WHEN 'DETAIL'.
              IF t_emp1 IS NOT INITIAL.
                UPDATE zemp FROM TABLE t_emp1.
                MESSAGE 'Records changed' TYPE 'S'.
              ELSE.
                MESSAGE 'No records are changed' TYPE 'S'.
              ENDIF.
              REFRESH t_emp1.
            ENDIF.
        ENDCASE.
      ENDMETHOD.                    "handle_user_command
    T_EMP1 IS WHERE YOU STORE THE UPDATED RECORDS.
    Regards and Best wishes.

  • How do I get PDF forms to export to excel in the desired order?

    How do I get PDF forms to export to excel in the desired order?
    Here is what I have done:
    As taken from another post:
    Choose Forms > Manage Form Data > Merge Data Files Into Spreadsheet.
    In the Export Data From Multiple Forms dialog box, click Add Files.
    In the Select file Containing Form Data dialog box, select a file format option in File Of Type option (Acrobat Form Data Files or All Files). Then locate the form files that you want to merge into the spreadsheet, select them, and click Select.
    Repeat the previous step to add form data files that are in other locations, as needed.
    Click Export. Then select a folder and filename for the spreadsheet, and click Save.
    In the Export Progress dialog box, click either View File Now to open the spreadsheet file or Close Dialog to return to Acrobat."
         The problem now is that Adobe populates Excel in ABC order of the form, based off of the name of each box in the form. For example, if my form has three text boxes, named A, B, and C, then Adobe will export to Excel as such:
    Row 1 =         A                              B                              C
    Row 2 =         data entered             data entered              data entered
    where 'data entered' is whatever the user typed into the form boxes. But what if I want a different order for exporting, and I don't want to rename my text boxes? What if I want:
    Row 1 =         C                              B                              A
    Row 2 =         data entered             data entered              data entered   ?
    Is there a way to do this in acrobat x or xi?
    Thanks

    I don't have time to test right now, but there was a change with Acrobat 10 where it exports according to the tab order, which you may have to set manually, so give that a shot. Otherwise, you'll have to process the file after it's exported if you need the fields in a particular order. This wouldn't be too difficult to do with something like a VBS or JS script in Windows.

  • Exporting ALV Grid output to Excel sheet

    Hi All,
           How can i export the output displayed using Grid to an Excel sheet. I tried with default option from list->export->excel sheet/local file but i am not getting complete data and the data which i am getting also notin proper format. Please help me in this regard.
    Best Regards,
    Sunil

    Check out the ALV grid toolbar for export options.
    Regards
    Raja

  • ALV grid to protected Excel sheet

    Hi ABAP gurus,
    I Have developed an ALV report using OO concept and from the application toolbar i am able to change  the GRID output to Excel output using View -> Excel inplace. Belows are my requirement now.
    1. I need to change the standard template with my template for this particular ALV report or Transaction. PLease provide me  with steps details to do it.
    2. The Excel sheet should be in protected  mode and user should be able to only take print out from the excel sheet without modifying any columns .
    If there is no standard way  we can add an additional  appliaction menu and  code it to download  the ALV output into an  Excel sheet and display it .  However again the User should not be able to modify the sheet. please provide me with sample code to do it.
    PLease suggest  solution for this . Point will be awarded for all valuable answers.
    Please it is very urgent for me ...
    Thanks in advance.
    Iftekhar Alam

    Hi ABAP gurus,
    I Have developed an ALV report using OO concept and from the application toolbar i am able to change  the GRID output to Excel output using View -> Excel inplace. Belows are my requirement now.
    1. I need to change the standard template with my template for this particular ALV report or Transaction. PLease provide me  with steps details to do it.
    2. The Excel sheet should be in protected  mode and user should be able to only take print out from the excel sheet without modifying any columns .
    If there is no standard way  we can add an additional  appliaction menu and  code it to download  the ALV output into an  Excel sheet and display it .  However again the User should not be able to modify the sheet. please provide me with sample code to do it.
    PLease suggest  solution for this . Point will be awarded for all valuable answers.
    Please it is very urgent for me ...
    Thanks in advance.
    Iftekhar Alam

Maybe you are looking for

  • Animated Texts in Demoversion don't seem to work properly

    Hey there, I am quite interested in buying and working with Adobe Premiere Elements (12). I do quite some hobby film editing, and have some experiences on the field with other free programmes (like Avidemux, Movie Maker, etc.), but I have some spare

  • I can't rename folders in Launchpad anymore

    I'm running OS 10.7.3 When I first installed, I could rename folders (I know how to do this). Now, I can no longer change the folder names. I searched these discussion topics and found some posts about quitting the Dock process and trashing Dock pref

  • Magic Mouse -- two finger swipe problem

    I have the wireless mouse. Twice now, I have had to unplug my iMac to get the mouse to work with the two fingered swipe. Anybody else experiencing this inability to perform the two finger swipe? Cheers,

  • Acrobat XI Pro flickers when Editing forms

    Hello, I am using Acrobat to create documents which can contain quiet a decent amount of fields (like 90 or more). Acrobat flickers on a regular basis when I start to edit these fields (meaning the fields are loaded again and again from top to bottom

  • Halt VI when Wait Untill Done.VI is waiting

    This program is for digitally triggered analog acquisition - N samples, N channels. There are 2 loops, one for the acquisition and one for user controls for the graphs. When the user presses the STOP button the VI will not stop because the WaitUntilD