Changing layout of ALV to excel

Hello,
I am developing an ALV report.
I want my data in the excel format, and not in the standard ALV format.
Is there any method to do so?
I have used the CL_GUI_ALV_GRID class, and I found out a method:-
Maintain_Variant.
Also ,there is an attirbute:- MMC_FC_VIEW_EXCEL.
But I am unable to implement them in my program.
Kindly help me.
Points assured for helpful answers.
Thanks and regards,
Prerna

Hi Prerna,
Good .. Check out the example code - Important
<b>Multi-colored output of ALV in EXCEL
There would be many situations where we need to highlight some of the records in bold or different color depending on some value. In this document, we showcase how this can be achieved. Look at the screenshot of an excel sheet with different colors and bold in some cells.
Following is a demo program in achieving the same:
Report ZMULTICOLOR_TEST no standard page heading.
this report demonstrates how to send some ABAP data to an
EXCEL sheet using OLE automation.
include ole2incl.
handles for OLE objects
data: h_excel type ole2_object,        " Excel object
      h_mapl type ole2_object,         " list of workbooks
      h_map type ole2_object,          " workbook
      h_zl type ole2_object,           " cell
      h_f type ole2_object,            " font
      h_c type ole2_object.            " color
DATA: FILENAME LIKE RLGRAP-FILENAME.
tables: spfli.
data  h type i.
table of flights
data: it_spfli like spfli occurs 10 with header line.
*&   Event START-OF-SELECTION
start-of-selection.
read flights
  select * from spfli into table it_spfli.
display header
  uline (61).
  write: /     sy-vline no-gap,
          (3)  'Flg'(001) color col_heading no-gap, sy-vline no-gap,
          (4)  'Nr'(002) color col_heading no-gap, sy-vline no-gap,
          (20) 'Von'(003) color col_heading no-gap, sy-vline no-gap,
          (20) 'Nach'(004) color col_heading no-gap, sy-vline no-gap,
          (8)  'Zeit'(005) color col_heading no-gap, sy-vline no-gap.
  uline /(61).
display flights
  loop at it_spfli.
    write: / sy-vline no-gap,
             it_spfli-carrid color col_key no-gap, sy-vline no-gap,
             it_spfli-connid color col_normal no-gap, sy-vline no-gap,
             it_spfli-cityfrom color col_normal no-gap, sy-vline no-gap,
             it_spfli-cityto color col_normal no-gap, sy-vline no-gap,
             it_spfli-deptime color col_normal no-gap, sy-vline no-gap.
  endloop.
  uline /(61).
tell user what is going on
  call function 'SAPGUI_PROGRESS_INDICATOR'
     exporting
          PERCENTAGE = 0
           text       = text-007
       exceptions
            others     = 1.
start Excel
  create object h_excel 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
  set property of h_excel  'Visible' = 1.
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'  .
PERFORM ERR_HDL.
tell user what is going on
  call function 'SAPGUI_PROGRESS_INDICATOR'
     exporting
          PERCENTAGE = 0
           text       = text-008
       exceptions
            others     = 1.
get list of workbooks, initially empty
  call method of h_excel 'Workbooks' = h_mapl.
  perform err_hdl.
add a new workbook
  call method of h_mapl 'Add' = h_map.
  perform err_hdl.
tell user what is going on
  call function 'SAPGUI_PROGRESS_INDICATOR'
     exporting
          PERCENTAGE = 0
           text       = text-009
       exceptions
            others     = 1.
output column headings to active Excel sheet
  perform fill_cell using 1 1 1 200 'Carrier id'(001).
  perform fill_cell using 1 2 1 200 'Connection id'(002).
  perform fill_cell using 1 3 1 200 'City from'(003).
  perform fill_cell using 1 4 1 200 'City to'(004).
  perform fill_cell using 1 5 1 200 'Dep. Time'(005).
  loop at it_spfli.
copy flights to active EXCEL sheet
    h = sy-tabix + 1.
    if it_spfli-carrid cs 'AA'.
      perform fill_cell using h 1 0 000255000 it_spfli-carrid.
    elseif it_spfli-carrid cs 'AZ'.
      perform fill_cell using h 1 0 168000000 it_spfli-carrid.
    elseif it_spfli-carrid cs 'JL'.
      perform fill_cell using h 1 0 168168000 it_spfli-carrid.
    elseif it_spfli-carrid cs 'LH'.
      perform fill_cell using h 1 0 111111111 it_spfli-carrid.
    elseif it_spfli-carrid cs 'SQ'.
      perform fill_cell using h 1 0 100100100 it_spfli-carrid.
    else.
      perform fill_cell using h 1 0 000145000 it_spfli-carrid.
    endif.
    if it_spfli-connid lt 400.
      perform fill_cell using h 2 0 255000255 it_spfli-connid.
    elseif it_spfli-connid lt 800.
      perform fill_cell using h 2 0 077099088 it_spfli-connid.
    else.
      perform fill_cell using h 2 0 246156138 it_spfli-connid.
    endif.
    if it_spfli-cityfrom cp 'S*'.
      perform fill_cell using h 3 0 155155155 it_spfli-cityfrom.
    elseif it_spfli-cityfrom cp 'N*'.
      perform fill_cell using h 3 0 189111222 it_spfli-cityfrom.
    else.
      perform fill_cell using h 3 0 111230222 it_spfli-cityfrom.
    endif.
    if it_spfli-cityto cp 'S*'.
      perform fill_cell using h 4 0 200200200 it_spfli-cityto.
    elseif it_spfli-cityto cp 'N*'.
      perform fill_cell using h 4 0 000111222 it_spfli-cityto.
    else.
      perform fill_cell using h 4 0 130230230 it_spfli-cityto.
    endif.
    if it_spfli-deptime lt '020000'.
      perform fill_cell using h 5 0 145145145 it_spfli-deptime.
    elseif it_spfli-deptime lt '120000' .
      perform fill_cell using h 5 0 015215205 it_spfli-deptime.
    elseif it_spfli-deptime lt '180000' .
      perform fill_cell using h 5 0 000215205 it_spfli-deptime.
    else.
      perform fill_cell using h 5 0 115115105 it_spfli-deptime.
    endif.
  endloop.
EXCEL FILENAME
  CONCATENATE SY-REPID '_' SY-DATUM6(2) '_' SY-DATUM4(2) '_'
              SY-DATUM(4) '_' SY-UZEIT '.XLS' INTO FILENAME.
  CALL METHOD OF H_MAP 'SAVEAS' EXPORTING #1 = FILENAME.
  free object h_excel.
  perform err_hdl.
      FORM FILL_CELL                                                *
      sets cell at coordinates i,j to value val boldtype bold       *
form fill_cell using i j bold col val.
  call method of h_excel 'Cells' = h_zl
    exporting
      #1 = i
      #2 = j.
  perform err_hdl.
  set property of h_zl 'Value' = val .
  perform err_hdl.
  get property of h_zl 'Font' = h_f.
  perform err_hdl.
  set property of h_f 'Bold' = bold .
  perform err_hdl.
  set property of h_f 'Color' = col.
  perform err_hdl.
endform.                    "FILL_CELL
*&      Form  ERR_HDL
      outputs OLE error if any                                       *
-->  p1        text
<--  p2        text
form err_hdl.
  if sy-subrc <> 0.
    write: / 'OLE-Automation Error:'(010), sy-subrc.
    stop.
  endif.
endform.                    " ERR_HDL</b>
Good Luck and thanks
AK

Similar Messages

  • Changing layout of ALV to excel and displaying the data there

    Dear All,
    My requirement is that I have to develop an ALV report, and also plot the graphs for the same.
    I need different types of graphs, so I have searched on SDN, and I found out a blg:-
    "Report with a Graph.. An Approach!"
    Here is what the person has done:-
    I developed a simple ABAP report using ALV and just dumped all my data on it.
    After this I downloaded the Standard Excel template available in the ALV.
    Defined my own worksheets in this template, wrote some macros to pick up the data from the “RawHeader” sheet, which is available by default and will contain the ALV data.
    I inserted 1 chart in this Excel template. In this chart I used the same chart type as was being used by the user for his graph. Just right clicked on the Graph area and made the changes in the source data and made it point to the sheet containing the final data.
    That’s it my job is almost done.
    After this uploaded this template back into the report output through
    the layout settings->Change Layout Tab.
    Save it as a variant and made it a default. (Do not default it if you have more than 1 user and more than 1 template…. Select the appropriate variant for the appropriate user and then display)
    Well, this also was not that easy as I had thought. I landed up into 1 trouble.
    In my report the number of columns displayed was not constant and kept changing based on the input. This fact was taken care by designing a variable field catalogue. But now I had gone past the simple ALV display and was giving the output in an Excel sheet using a pre-defined template. Well, I immediately found a solution to this with the set_frontend_fieldcatalogue method of CL_GUI_ALV_GRID class and fixed the field catalogue every time after calling the set_table_for_first_display method. This solved most of my problems, which were not many though.
    Now here are my issues:-
    I have developed the ALV report, and I have also changed the layout to excel.
    But, I am unable to get the ALV Report data in the RawHeader Sheet, which is available by default.
    Could anyone please guide me through this method??
    It is urgent.
    Points are assured for helpful answers.
    Thanks and regards,
    Prerna

    Hi Satya Priya,
    Do I have to create my own template, or the Standard ones available will do?
    HEre is what I do:-
    Once I get my ALV output, I goto Change LAyout->View tab.->Prefered view->Microsoft Excel.
    Here I get a list of available excel templates There are 2:-
    sap_mm.xls, and sap_om.xls
    I select one of these, and the excel spreadsheet is displayed on the ALV screen.
    But the re is another button, "Upload Document to BDS".
    Do I have to upload one of the above templated to BDS?
    And please tell me in detail, what is BDS???
    Thanks for your help, and waiting for reply,
    Prerna

  • Problem in changing layout of ALV to excel

    Hello everyone,
    I have developed an ALV program, wherein I need to show the graphs for the same.
    For this, I need my data in excel format, so that I can write some macros ,and do the further processing on it(I am using an appraoch I found on SDN, "Report with graph").
    I got to know, that I need <b>SAP R/3: Add On:Interactive Excel</b>.
    I asked the BASIS guys to install it, but even after installing it, I am unable to view the data in Excel layout, when I do Change LAyout->View->Microsoft Excel.
    Could anyone let me know if there is any other setting which is required to view the data in excel?On the excel side, we can change the security level(Tools->Macro->Security) to either low, medium or high.
    Is there any such provision in SAP?
    Kindly suggest your answers, as it is important for me to get the data in excel.
    Points will be rewarded.
    Thanks and regards,
    Prerna

    Hi,
    I have already tried what you have just mentioned.
    I searched the entire SDN, for this, and this was one of the replies   
    But still we don't get the data(Even you didn't get it, right?).
    when we change the layout to excel(Excel Inplace), there are 2 sheets by default:-
    Rawheader and Rawdata.The data comes in RAwheader sheet.
    But there is some setting on the BASIS side, which need to be done, in order for it to work.
    I have asked my BASIS colleagues and some of my senior consultants to look into the same.
    They will let me know.
    I would also suggest you try your program on another PC.
    I will let you know as soon as I get any replies from my colleagues.
    Thanks and regards,
    Prerna

  • Save Changed layout of ALV

    Hello All,
    I am using the class 'cl_salv_table' to create an ALV. In the application toolbar I have the option to change the layout displayed in tha ALV but I am not able to save my changed layout. Please suggest how do I enable the save layout button in the toolbar.
    Thanks,
    Anju

    This demo example creates a PF status for displaying the buttons, Can  I not get the buttons using the standard functions available with the ALV. I am getting the change layout on its own I am not reqd to create a PF status for it. Can I not enable the button save layout also. Also if I create the PF status I would have to add all the buttons reqd in the ALV in the PF status manually
    thanks,
    Anju

  • Create Change Layout in ALV list report

    Hi,
    i have create my own change layout button at my alv list report, my problem is i don't know what coding can be used to activate the change layout function in my own button. Who have sample programming for this function please share it....
    tq.

    Hi,
    By default if you're using the ALV List Display function module, there's no need for you to code the 'Change Layout' function, the standard function will be there, unless there's something you want and the standard 'Change Layout' function could not provide.
    Go to Abap Editor and look for program with 'BALV*'. You'll get a whole list of DEMO program on ALV.

  • From where can we give the details of change layout in alv

    Hi,
    I am executing an ALV Grid report, and output is coming fine , if i see the print preview for some particular fields some digits or missing
    so i used the button change layout there i can see that length is not sufficient i have changed that and its working fine but each and every
    time i need to change the layout  and then take the print............if i wanted to save my changes in chnage layout or else pls tell me from where we are getting all those details in change layout so that i can go there and change.........
    thanks

    Hi,
    You can save the changes done in the layout.
    First you change the layout , then save it by giving a name. Use / as first character if you want to make the changes global, otherwise for a user specific layout save it with A-Z as first character. Make it default so you need not have to change/choose the layout each time you print.
    Regards,
    Alok

  • Change Layout in ALV

    HI,
    In my alv report(developed using ABAP OO), i need to exclude few buttons .
    Here i need to exclude Change Layout button.
    Can anyone pls help whats the attribut for change layout icon.
    Like for Print we have MC_FC_PRINT?.  what will be for "Change Layout"?
    Pls help
    Thanks

    Hi,
    Check the constants in the public attributes of the class ..where you can find the focde for the change layout button..
    Thanks
    Naren

  • Download dynamic fields (based on changed layout) from ALV

    Hello All,
    Currently i am displaying 28 firelds in my ALV output.
    I have created my own button for downloading the contents displayed using GUI_DOWNLOAD.
    Say if user changes the layout and say now we have 35 fields in the layout.
    Now when we click the DOWNLOAD button, i want to download these 35 fields instead of 28 fields.
    Can anyone please help me on this...
    Thanks in advance....
    Regards,
    Tarun

    Hi Tarun,
    As the frontend layout is directly connected to this output table, standard excel download would work here (because it already knows which column to display and download).
    But as you want custom solution I think the following might work:
    - get fieldcatalog using GET_FRONTEND_FIELDCATALOG
    - loop through it and check if field is in displayed mode ( NO_OUT ne 'X' ).
    - create (or just copy above entries) to new fieldcatalog table
    - use class CL_ALV_TABLE_CREATE to generate dynamic table with structure of displayed fields only (based on that new fieldcatalog)
    - loop through output table and copy corresponding fields to your dynamic table appending to it
    - download dynamic table using GUI_DOWNLOAD (parameter DATA_TAB here is generic so you can pass any table structure).
    Regards
    Marcin

  • How to automate ALV to Excel View selection?

    How to automate ALV to Excel View selection?
    I'd like to view ALV data in Excel sheet. The standard way is to select "View" tab in "Change Layout" window, then click "Excel" radio button, then I should select document template from list, then I should select it again, then I need to press "Copy" button.
    This is very long way! Is it possible to do it automatically, without multiple selection and pressing lots of buttons.

    Hello Vladimir,
    Use FM 'XXL_SIMPLE_API ' or XXL_FULL_API .
    Also go thru the link :
    http://www.sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm

  • How to Keep Default Layout of ALV

    I changed layout of ALV, then pressed button "Enter" but not "Save". But when I entered the screen again, the layout was changed to the setting which I changed last time, not default setting.
    Source code is shown below.
         DATA lt_acc_bal_fcat TYPE lvc_t_fcat.
         DATA lt_trans_dtl_fcat TYPE lvc_t_fcat.
         CLEAR gt_copc_bal.
         APPEND LINES OF it_copc_bal TO gt_copc_bal.
         CLEAR gt_trans_detail.
         APPEND LINES OF it_trans_detail TO gt_trans_detail.
         _adjust_data_for_display( ).
         IF gv_grid_inited NE abap_true.
           CLEAR gs_grid_variant.
           CLEAR gs_grid_variant_detail.
           CLEAR gt_trans_dtl_fcat.
           gs_grid_layout-no_rowmark  = abap_true.
    "      gs_grid_layout-sel_mode    = 'A'.
           gs_grid_layout-stylefname  = 'FLD_STYL'.
           gs_grid_variant-report     = sy-repid.
           gs_grid_variant-username   = sy-uname.
           gs_grid_variant-log_group  = '001'.
           "load account balance data to ALV
           CREATE OBJECT go_acc_bal_container
             EXPORTING
               container_name = 'ACC_BAL_CONTAIN'.
           CREATE OBJECT go_acc_bal_grid
             EXPORTING
               i_appl_events = abap_true
               i_parent      = go_acc_bal_container.
           CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
             EXPORTING
               i_structure_name = 'EPIC_S_COPC_BAL'
             CHANGING
               ct_fieldcat      = lt_acc_bal_fcat.
           DATA lt_acc_bal_fcat_a TYPE lvc_t_fcat.
           _adjust_bal_alv_dsp(
             EXPORTING
               it_fcat = lt_acc_bal_fcat    " Field Catalog for List Viewer Control
             IMPORTING
               et_fcat = lt_acc_bal_fcat_a   " Field Catalog for List Viewer Control
           go_acc_bal_grid->set_table_for_first_display(
             EXPORTING
                 is_layout            = gs_grid_layout
                 is_variant           = gs_grid_variant
                 i_save               = 'A'
               CHANGING
                 it_outtab            = gt_copc_bal
                 it_fieldcatalog      = lt_acc_bal_fcat_a
           "load trasaction detail data to ALV
           CREATE OBJECT go_acc_trans_dtl_container
             EXPORTING
               container_name = 'TRANS_DTL_CONTAIN'.
           CREATE OBJECT go_acc_trans_dtl_grid
             EXPORTING
               i_appl_events = abap_true
               i_parent      = go_acc_trans_dtl_container.
           CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
             EXPORTING
               i_structure_name = 'COPC_S_TRANS_DETAIL'
             CHANGING
               ct_fieldcat      = lt_trans_dtl_fcat.
           DATA lt_trans_dtl_fcat_a TYPE lvc_t_fcat.
           _adjust_detail_alv_dsp(
             EXPORTING
               it_fcat = lt_trans_dtl_fcat    " Field Catalog for List Viewer Control
             IMPORTING
               et_fcat = gt_trans_dtl_fcat   " Field Catalog for List Viewer Control
           gs_grid_variant_detail = gs_grid_variant.
           gs_grid_variant_detail-log_group = '002'.
           go_acc_trans_dtl_grid->set_table_for_first_display(
             EXPORTING
                 is_layout            = gs_grid_layout
                 is_variant           = gs_grid_variant_detail
                 i_save               = 'A'
               CHANGING
                 it_outtab            = gt_trans_detail
                 it_fieldcatalog      = gt_trans_dtl_fcat
           gv_grid_inited = abap_true.
         ENDIF.
         go_acc_bal_grid->refresh_table_display( ).
         go_acc_trans_dtl_grid->refresh_table_display( ).
    I want to keep layout of ALV default setting when I enters screen each time. Please help me solve this problem.

    Hi,
    are you refreshing ALV when pressing enter? maybe you should not refresh when pressing enter, or provide the right variant when refreshing.
    regards
    Stefan Seeburger

  • Using Change Layout Tab on ALV to Export to Excel

    Hi Forms!
    I have an ALV grid that I export to excel to allow users to manipulate the data exported further.
    i do this by clicking change layout -> View -> 'Microsoft Excel' -> click on the template you want to use and click the check mark to export.
    My problem is I have a header on the ALV that display's the user selection screen options... all my data shows in excel correctly except that my selection screen header which I would expect in the 'Raw Header' Tab in excel.
    If I export to excel using excel export button the header shows up, however this does not help as we like using the pivot table setup from the change layout option.
    thank you,
    Here is my code for producing the header...
    ATA: lo_header  TYPE REF TO cl_salv_form_layout_grid,
            lo_h_label TYPE REF TO cl_salv_form_label,
            lo_h_flow  TYPE REF TO cl_salv_form_layout_flow,
            lv_i TYPE i,
            lv_mtart LIKE LINE OF s_mtart,
            lv_auart LIKE LINE OF s_auart,
            lv_bkbez LIKE LINE OF s_bkbez,
            lv_lines TYPE i.
    *   header object
      CREATE OBJECT lo_header.
      lo_header->set_column_count( 10 ).
      lo_h_label = lo_header->create_label( row = 1 column = 1 ).
      lo_h_label->set_text( 'Selection Screen Values' ).
    *   information in tabular format
      CONCATENATE 'Dates: ' s_date-low  ' ' ' to ' s_date-high ' ' INTO l_text RESPECTING BLANKS.
      lo_h_flow = lo_header->create_flow( row = 2  column = 1 ).
      lo_h_flow->create_text( text = l_text ).
      CONCATENATE 'Plant: ' p_werks ' ' INTO l_text RESPECTING BLANKS.
      lo_h_flow = lo_header->create_flow( row = 3  column = 1 ).
      lo_h_flow->create_text( text = l_text ).
      CONCATENATE 'Costing Variant: ' p_klvar INTO l_text RESPECTING BLANKS.
      lo_h_flow = lo_header->create_flow( row = 4  column = 1 ).
      lo_h_flow->create_text( text = l_text ).
      CONCATENATE 'Costing Version: ' p_tvers INTO l_text RESPECTING BLANKS.
      lo_h_flow = lo_header->create_flow( row = 5  column = 1 ).
      lo_h_flow->create_text( text = l_text ).
    *there can be 1 or many Material Types need to check
      DESCRIBE TABLE s_mtart LINES lv_i.
      IF lv_i > 1.
        lv_lines = 1.
        CONCATENATE 'Material Type(s): ' s_mtart-low INTO l_text RESPECTING BLANKS.
        lo_h_flow = lo_header->create_flow( row = 6  column = lv_lines ).
        lo_h_flow->create_text( text = l_text ).
        LOOP AT s_mtart INTO lv_mtart .
          IF lv_lines > 1.
            lo_h_flow = lo_header->create_flow( row = 6  column = lv_lines ).
            lo_h_flow->create_text( text = lv_mtart-low ).
          ENDIF.
          lv_lines = lv_lines + 1.
        ENDLOOP.
      ELSE.
        CONCATENATE 'Material Type(s): ' s_mtart-low INTO l_text RESPECTING BLANKS.
        lo_h_flow = lo_header->create_flow( row = 6  column = 1 ).
        lo_h_flow->create_text( text = l_text ).
      ENDIF.
    *   set the top of list using the header for Online.
      cr_content = lo_header.

    Hello Re_flex....thanks again but I am missing a step here as I was able to hide the column by right-clicking but when I click on the layout there is no layout that I can select. Do you know if these layouts are set in config or not as my layout setting displays 'X' user specific or 'A' ALL but when I select these nothing is displays and when I save I get a message back 'No selection'

  • Changing layout into excel sheet.

    Hi experts's,
    In a ALV report (not OOP's concept) i want to display changing layout fields in EXCEL sheet. please send if you have sample program.
    please suggest how to solve this problem.
    Thanks and regard
    pavan.

    Hi experts's,
    In a ALV report (not OOP's concept) i want to display changing layout fields in EXCEL sheet. please send if you have sample program.
    please suggest how to solve this problem.
    Thanks and regard
    pavan.

  • The Visible attribute on alv grid column is not changed after Change Layout

    Setup:
    I have a program that displays output in an ALV grid (using cl_salv_table).
    The ALV grid is displayed within a custom control on a subscreen.
    I have 4 subscreens being used on a tabstrip control.  So I have 4 ALV grids total (one on each subscreen).
    On each ALV grid, I have set the set_layout_change function to true so that the user can hide and unhide columns etc. on each grid via the button on the alv grid toolbar.
    I also allow the user to dowload the contents of all 4 grids to excel.  To do this I have a custom button that when clicked goes to each ALV grid - gets the column metadata (via cl_salv_columns_table-get() ) and checks the visibility to determine if the column should be downloaded or not (via cl_salv_column-is_visible() ) to excel.
    The Problem:
    As I said I have 4 grids being displayed via a tab control.  Let's say the user is on tab 1 and unhides some columns on the alv grid 1 via the Change Layout... button.  And then the user navigates to tab 2.  If they click the download button at that point - when the download code is run and it checks the visibility of the columns on alv grid 1 - the changes that were made via the Change Layout... button have not synchronized yet.  When I call is_visible() for a column that was unhid it still comes back as false. 
    The only way I have found to remedy this is to make the user click on a button on the alv grid's toolbar before navigating to a different tab to force the synchronization between the changes made and the backend column metadata.  However, this is not the best option and requires training for the user that they have to do this for the download to work correctly. 
    The Question:
    1) why is the Change Layout... button not automatically synchronizing the changes it made to the back end?  Is there a way to make it do this?
    2) OR, is there a way that I can force the synchronization within the code and not force the user to click a button on the alv grid?  If there is a way to force the synchronization - where do I put that code?  As far as I can tell, when I switch between tabs - I am unable to catch that action in my PAI events.
    Thanks in advance for any help.

    I was able to resolve this issue with a satisfactory solution.
    In my program I had a local class definition to handle the grids' events.  When the synchronization wasn't working I only had two events defined: for link_click and added_functions. 
    I created another definition for event after_salv_function:
                   on_after_salv_function for event after_salv_function of cl_salv_events importing e_salv_function
    There is no code in the method implementation - but adding this event handler now causes a synchronization to occur after the Change Layout is done.

  • Hide Change Layout Button in ALV report o/p for MB52 Tcode

    Hi,
    Is it possible to Hide Change Layout Button in ALV output for Report MB52 using authoriztaion.
    We have created a layout in which we are hiding some coloumns which the user should not see.
    But if the change layout button is active then the user can add those coloumns to output.
    Is this possible through authorizations. I want to avoid doing any chnages to the std sap program.
    Thanks & Regards,
    Fawaz

    Check the object S_ALV_LAYO

  • How to add Change Layout, savelayout, select layout Button to ALV Toolba

    How to add Change Layout, savelayout, select layout Button to ALV Toolbar?
    Moderator message: please (re)search yourself before asking.
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    locked by: Thomas Zloch on Sep 10, 2010 10:57 AM

    Variant
    CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                is_variant          = gs_variant
                i_save              = c_save
              it_default_fieldcat =
           IMPORTING
                e_exit              = gf_exit
                es_variant          = gs_variant
           EXCEPTIONS
                not_found = 2.
      IF sy-subrc = 2.
        MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        IF gf_exit = space.
          cf_varia = gs_variant-variant.
        ENDIF.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save        = c_save
        CHANGING
          cs_variant    = gs_variant
        EXCEPTIONS
          wrong_input   = 1
          not_found     = 2
          program_error = 3
          OTHERS        = 4.
      IF sy-subrc NE 0.
        cf_subrc = sy-subrc.
      ENDIF.
    Change Layout, savelayout, select layout Button  pass the value which is in BOLD
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                =  gd_repid
         i_callback_user_command           =  'U_COMMAND'
         i_callback_top_of_page            = 'TOP-OF-PAGE'
                         is_layout                    =  fld_lay
           it_fieldcat                  =  fieldcatalog[]
                       IT_EXCLUDING                  =
                       IT_SPECIAL_GROUPS             =
                       IT_SORT                        =  it_sort[]
         i_default                      = 'X'
         i_save                         = 'A'
         is_variant                     = gs_variant
         it_events                      =  it_event[]
        TABLES
          t_outtab                      =    it_sales
                     EXCEPTIONS
                       PROGRAM_ERROR                     = 1
                       OTHERS                            = 2
    Annasaheb

Maybe you are looking for

  • T540 keyboard

    My trusty 5yo T500 is operating without the deafening and now failed fan, without hinges, with a broken display frame, without top bezel and pad, with a loose battery, and without a touchpad.  All mechanical parts have failed on me, except the keyboa

  • To get line number for xml file.

    how do u get th line number of a particular node i parse. is it possible only when error comes the line number and mesage can be displayed. is it possible when i use xpath expression for a particular node and if that xpath returns boolean false then

  • Can someone explain this !!

    Really it's amazing ! When I bought my E71 about 4 months ths ago ,and as I was upgrading from S40 series ,I found it a little bit slow , of couse compared to other N series like N73 it was much faster. For some issues , I decided to hard reset the d

  • Ur mount point have not more space and ur system table space is full how u

    ur mount point have not more space and ur system table space is full how u resize or add file . u have not other mount point .what steps u follow

  • Multiple Speaker box shows a locked Apple TV speaker option.

    In my Multiple Speaker box under iTunes my Apple TV icon has a small image of a "Lock" in the locked position.  I think this is the reason I can't play music through the speakers connected to my Apple TV.  How do I unlock this?