Merge cells in reuse alv

Hello gurus.
Please help me with merging cells.
I need to merge some cells in alv grid. To create grid i use reuse_alv FM. For example it is needed to merge all cells in several rows. What should i do ? I think that there should be some manipulations with fieldcatalog but i don't know the correct ones.
Thanks.
regards,
alex.

If you would like to merge cells,  meaning that you want to hide repeating values in a certain column, then you can simply sort by that column. 
report zrich_0004
       no standard page heading.
type-pools slis.
data: fieldcat type slis_t_fieldcat_alv.
data: sort     type slis_t_sortinfo_alv.
data: begin of ivbap occurs 0,
       vbeln type vbap-vbeln,
       kunnr type vbak-kunnr,
       vkorg type vbak-vkorg,
       netwr type vbap-netwr,
      end of ivbap.
* Selection Screen
start-of-selection.
  select vbak~vbeln vbak~kunnr vbak~vkorg vbap~netpr
              into table ivbap
                      from vbak
                         inner join vbap
                            on vbak~vbeln = vbap~vbeln
                                  up to 100 rows.
  perform write_report.
*  WRITE_REPORT
form write_report.
  data: tmp_sort type line of slis_t_sortinfo_alv.
  data: fc_tmp type slis_fieldcat_alv .
* Build feildcat
  clear fc_tmp. refresh fieldcat.
  fc_tmp-reptext_ddic    = 'Sales Org'.
  fc_tmp-fieldname  = 'VKORG'.
  fc_tmp-tabname   = 'IVBAP'.
  fc_tmp-outputlen  = '4'.
  append fc_tmp to fieldcat.
  clear fc_tmp.
  fc_tmp-reptext_ddic    = 'Customer'.
  fc_tmp-fieldname  = 'KUNNR'.
  fc_tmp-tabname   = 'IVBAP'.
  fc_tmp-outputlen  = '10'.
  append fc_tmp to fieldcat.
  clear fc_tmp.
  fc_tmp-reptext_ddic    = 'SD DOC'.
  fc_tmp-fieldname  = 'VBELN'.
  fc_tmp-tabname   = 'IVBAP'.
  fc_tmp-outputlen  = '10'.
  append fc_tmp to fieldcat.
  clear fc_tmp.
  fc_tmp-reptext_ddic    = 'Net'.
  fc_tmp-fieldname  = 'NETWR'.
  fc_tmp-tabname   = 'IVBAP'.
  fc_tmp-outputlen  = '15'.
  fc_tmp-datatype = 'QUAN'.
  append fc_tmp to fieldcat.
* Build sort table
  clear sort. refresh sort.
  clear tmp_sort.
  tmp_sort-fieldname = 'VKORG'.
  tmp_sort-tabname   = 'IALV'.
  tmp_sort-up        = 'X'.
  append tmp_sort to sort.
* CALL ABAP LIST VIEWER (ALV)
  call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            it_sort     = sort
            it_fieldcat = fieldcat
       tables
            t_outtab    = ivbap.
endform.
Regards,
Rich Heilman

Similar Messages

  • Print ALV with merged cells

    Hi all,
    I have a requirement to print an ALV grid display exactly in the same format as we see in output. That is, if the cells are merged in ALV then in Print also they should come as merged.
    But when I am printing the ALV output it does not give merged cells. I am using OO ALV.
    Is my requirement feasible. If yes, Please help me to proceed?
    Thanks,
    Daya

    Hi Daya,
    In the ALV grid control print or print preview, cells that have identical content are not merged.  This is necessary in order to be able to distinguish between blank cells and cells that only become blank after merging.  The standard behaviour for the different ALV lists is described in Note 447055.
    Regards,
    Md Ziauddin

  • ABAP WD: ALV merge cells

    Hello,
    I have a hierarchical ALV. I need to merge some cells in it.
    For instance, there is a column name: Brand Name. There are multiple rows that have same brand name, let's say SONY.
    Is it possible to merge these cells that have same brand name? If so what should I use?
    Thank you.
    Best Regards,
    Georgy Norkin

    Hi,
    Go through the links,
    Merging cells of a table in Webdynpro
    merging cells in table
    Regards,
    Azaz.

  • Reuse alv merge

    what is the use of function module reuse alv field catalog merge

    Field catalog with field descriptions
    2.7.1. Description
    Field catalog containing descriptions of the list output fields (usually a subset of the internal output table fields). A field catalog is required for every ALV list output.
    The field catalog for the output table is built-up in the caller's coding. The build-up can be completely or partially automated by calling the REUSE_ALV_FIELDCATALOG_MERGE module
    See also the documentation of the function module REUSE_ALV_FIELDCATALOG_MERGE.
    The minimal field catalog is documented under 'default'. The caller can use the other optional parameters to assign output attributes to a field which differ from the default.
    A field catalog need not be built-up and passed explicitly only under the following conditions:
    • The internal table to be output has the same structure as a Data Dictionary structure which is referred to in the internal table declaration using LIKE or INCLUDE STRUCTURE.
    • all fields in this structure are to be output
    • the structure name is passed to ALV in the parameter I_STRUCTURE_NAME.
    See also the documentation of the IMPORTING paramter I_STRUCTURE_NAME.
    more info
    DEFININING OUTPUT CHARACTERISTICS: PREPARING DISPLAY FIELDS CATALOG
    A field catalog is prepared using the internal table (I_FIELDCAT) of type SLIS_T_FIELDCAT_ALV. Field catalog containing descriptions of the list output fields (usually a subset of the internal output table fields).
    A field catalog is required for every ALV list output to add desired functionality (i.e. Key, Hotspot, Specific headings, Justify, Col. position etc) to certain fields of the output. If not mentioned specifically, then the defaults are taken. The possible values and defaults are listed below.
    The field catalog for the output table is built-up in the caller's coding. The build-up can be completely or partially automated by calling the REUSE_ALV_FIELDCATALOG_MERGE module.
    The minimal field catalog is documented below. This can be done in a routine using a local variable. The user can use the other optional parameters to assign output attributes to different fields in the output, which differ from the default.
    Check...
    Re: What is the use of REUSE_ALV_FIELDCATALOG_MERGE?
    Re: FM: REUSE_ALV_GRID_DISPLAY and  REUSE_ALV_FIELDCATALOG_MERGE
    award points and try to close threads...
    Message was edited by:
            Ramesh Babu Chirumamilla

  • Excel export are merging cells for data on multiple lines !

    Hello,
    I'm using Crystal Report XI R2, when we are doing an export to Excel with have an unexpected formatting.
    For example the value of the name is on 2 lines:
    => So, on Excel the result is on 2 lines but merged. We want to have this result only on one cells.
    Remark: if we delete the 2nd lines, because cells are merged we obtain the expected result.
    Proposal A:
    Are they any set-up available concerning the formatting of Excel ?
    Proposal B:
    Could we run some VBA when we click on Export button to make queries on the Excel ?

    When they introduced Unicode support in Crystal 9 (I believe), they had to completely re-write the export routines. At that time, they made a decision to change the functionality of the excel export. Crystal is attempting to remain absolutely faithful to the graphical layout of the report as you see it in the viewer. So it creates merged cell sections, empty columns between columns, and empty rows to give you as close to exactly what you see in the viewer as possible. Unfortunately, the result is typically less than useful. Iu2019ve had several conversations with Business Objects (now SAP) with regards to this when they changed it between versions 8.5 and 10, and they have no intention of changing the functionality as it now exists.
    There is a document which is now likely somewhere on the SAP portal that explains what you need to do to obtain the best results when exporting to excel.
    The jist of it is this:
    Line up all of the columns detail data with thier headers, and make sure that data fields are the same size as thier headers. 
    Line up all rows (headers and detail rows). (ie: select everything in the row, right click, align tops, and make the same height)
    cram everything as close together as possible. zero space in the report translates to zero extra collumns and rows in the export.
    the other option is to use the export to data only functionality, but that may not be what you're looking for either.

  • ALV Report row grey-out (disable) dynamically -- REUSE ALV!!!

    Hello All,
    Well again a quick question...
    Am using REUSE ALV method to display the ALV report.
    Dynamically by selecting a row in the list (using the checkbox) and by pressing a button on application tool bar, the selected row should be greyed-out(disabled), that is it should not be anymore editable!
    How is it possible?
    Any kind of inputs regarding this will be damn damn helpful.
    Thanks in advance!
    Cheers, Sundar.

    Hi,
    The above solution 1 will be only applicable if using OO ALV!
    above solution 2 will disable the entire column, and then again i need to call the "REUSE ALV"... which i don't want to.. as it opens another screen above the same screen and i have to close it twice!
    I know it is possible to grey out the selected row using OO ALV... i want to know if it is possible in REUSE ALV???
    Keep shooting please....
    Thanks!
    Regards,
    Sundar

  • Excel Merge Cells.vi throws an undefined error in Excel 2013?

    Basically, I can't write text into an Excel spreadshoot using the Report Generation tools.
    Using LabVIEW 2013 (SP1) I am writing to individual cells in an Excel (2013) template.
    The error is coming from the Report Generation Toolkit>Excel Specific>Excel Easy Text.vi.>Excel Merge Cells.vi.
    Inside of the "Excel Merge Cells.vi" is an "Invoke Node.Range". When the program hits this point, it throws out an undefined error.
    My code has been running on multiple platforms in multiple programs with no problems using Office 2010.
    NASA upgraded our Office Suit to 2013. I am now throwing an undefined error ( -2146827284).
    I've got a service request in and have talked to an engineer. THey are looking at the problem. However, I thought I would throw it out here and see if anyone had seen this particular problem.
    Bryan Alexander

    Problem found, workaround implemented.
    When you use the "New Report.vi", you have to wire in one of four choices for the state of the window. "Maximized", "Minimized", "Normal" and "No Change". If you use the "Excel Easy Text.vi" to insert data into an Excel 2013 Spreadsheet, it will generate an error if you opened the Excel file in "Minimized" mode. The other three states work fine.

  • Smartview 11.1.2.1.103 problem: Merged cell in HFM workspace is unmerged in smartview

    I have an error here in smartview 11.1.2.1.103. In HFM workspace, the form I designed has merged cell in row1. But I open the same form in smartview, row1 is not longer merged. Does anyone have the same problem?
    PS: I've already set the option: excel formatting in smartview.

    Hi,
    thanks for your answers. From all I could find out from Oracle support, I'll have to wait until 11.1.2.1 is GA and then try again :-(
    Or will there be a patch for 11.1.2.0 as well?
    Best regards,
    Markus

  • Takes a Long time to merge cells

    Why does it take me forever to merge 4 cells in a table that
    has over 100 rows. Is there anything that I can do to speed up the
    process?

    Never merge cells? I rarely do this (of course I rarely use
    tables, too) -
    instead, I will stack tables vertically when I need a new
    cell
    configuration.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "PamVa" <[email protected]> wrote in message
    news:f30u4t$o7u$[email protected]..
    > Why does it take me forever to merge 4 cells in a table
    that has over 100
    > rows. Is there anything that I can do to speed up the
    process?

  • Is there a way of merging cells (not columns) in a Flex Datagrid?

    Hello everyone!
    I'm new to Flex and I have been searching for a solution to this problem for two days now, so any help would be really appreciated!
    I have a datagrid of, lets say x columns of fixed size, with the ability to add or remove rows dynamically. When adding a row o popup comes up and lets the user determine the positions(order) and widths of the desired cells of the row. So what I want to do is to be able to merge cells of the new Datagrid row appropriately, to satisfy the user's choices. Thats the general idea.
    Is there a way to have a Datagrid (or other similar component) with different cell number and widths for each row in Flex? I need a component similar to the Datagrid because I want to be able to select rows and process their data.
    Any idea would be very helpful as I'm pressed for time and I could use someone's experience to search in the right direction and not loose time.
    Thanks in advance!

    Thank you very much for your response. I finally did what I wanted without using a Datagrid. I used a Table Flex Component (which extends Flex Grid) that I found here:
    http://code.google.com/p/flex-table/#Demo
    I downloaded the source and changed some things to make it work as I need.

  • [CS3/CS4 JS] How can you get the associatedXMLElement of a merged cell in a table?

    Hi!
    Inserting a table, and autotagging it, I get a table with a number of cell elements in the XML Structure.
    Selecting an item in the table, I can find the associated XML by the following line of code:
    app.selection[0].associatedXMLElement
    My problems begin when cells are merged. Then the associatedXMLElement for the cell returns null.
    How can I find the associatedXMLElement for a merged cell?
    Using the getElements makes no difference.
    app.selection[0].getElements()[0].associatedXMLElement
    (returns null)
    In the XML structure I can see that the merged cell is still associated to an XML Element, which becomes underlined and also referrs back to the cell, selecting it when double clicking the XML Element link in the structure.
    Is there no way to get to the xml element of a merged cell?
    I have tested in CS3 and CS4 as well, and they act in the same way.
    I also found a similar, unanswered, question from Anne-Laure Jallon in the "With CS3, some things have changed" ( http://forums.adobe.com/message/1105813#1105813 ):
    Hello,
    I'm working with VBscript.
    Is there a difference between cell.associatedXmlElement in CS2 and CS3?
    All my cells in CS2 had an associatedXmlElement.
    In CS3, my table has an associatedXmlElement, but all its cells don't (The value is Nothing)
    Is this a bug? Is it linked with XML evolution?   Thanks Anne Laure
    Adding some more info:
    I made a test, by selecting the XMLElement in the structure, and from that object finding the cell, and finding back to the assiciatedXMLElement:
    app.selection[0].getElements()[0].cells[0].associatedXMLElement
    Result: [object XMLElement]
    So that kind of "chain" works.
    But with the merged cell as only reference, I can't find its associatedXMLElement. Any ideas would be appreciated.
    Best regards,
    Andreas Jansson
    Message was edited by: Andreas Jansson

    In my opinion, locate a cell according to his content is not so effortable. What happens if contents of more than two cells are equals?
    I take xml elements of associated xml element of table and put them into an array.
    This array contains associated xml elements of every cell ordered by cell positions into table.
    Now, locate associated xml element of a cell based on its array position (index) is more reliable:
    var myCell_cell = app.selection[0];
    var myElement = myCell.associateXMLElement
    if (!myElement || !myElement.isValid)  {
         var table =  myCell.parent;
         var xml_tab = table.associatedXMLElement;
         var xml_cells_arr = xml_tab.xmlElements.everyItem().getElements();
         var idx = myCell.index;
         myElement = xml_cells_arr[idx];
    Alex ;-)

  • I need to convert PDF to Excel, however, columns and tabs make many merged cells and many blank columns. In addition to not separate the columns correctly, I see many not separate lines together in the same cell. I'm even thinking that Adobe Acrobat Pro D

    I need to convert PDF to Excel, however, columns and tabs make many merged cells and many blank columns. In addition to not separate the columns correctly, I see many not separate lines together in the same cell. I'm even thinking that Adobe Acrobat Pro DC has limitations. There is no way to define what points in columns to force break column? Nor create many columns that are useless? How does text to column in Excel, fixed size when we import text, and define where the breaks have columns?
    Google Tradutor para empresas:Google Toolkit de tradução para appsTradutor de sitesGlobal Market Finder
    Desativar tradução instantâneaSobre o Google TradutorCelularComunidadePrivacidade e TermosAjudaEnviar feedback

    PDF does not contain columns, rows, formats, styles, or other aspects of word processing or spreadsheet file formats.
    This is because PDF is decidedly not a word processing or spreadsheet file format or something "like" one of those.
    (see ISO 32000 for what PDF "is")
    What can optimize the export of PDF page content is to start with a well-formed tagged PDF (ISO 14289-1, PDF/UA-1 compliant).
    Without that export is what it is and one performs whatever content cleanup is needed using the native application for the export file (MS Word or Excel).
    Be well...

  • Problem in cell content of alv grid ...

    hi all,
         i want to get the cell content of alv grid in the handle method of event data_changed of cl_gui_alv_grid,
    i using the following code ...
    METHOD on_data_changed.
    DATA : lv_value(30) TYPE c.
    CALL METHOD ER_DATA_CHANGED->GET_CELL_VALUE
      EXPORTING
        I_ROW_ID    = 3
       I_TABIX     =
        I_FIELDNAME = 'cname'                                                                                "" my column table
      IMPORTING
        E_VALUE     = lv_value.
    MESSAGE lv_value TYPE 'I'.
        ENDMETHOD.
    endclass.           
    but i cant get the value of cell content
    Edited by: parashuram on Oct 21, 2011 3:49 PM

    Try this way
        method handle_data_changed.
          perform handle_data_changed using er_data_changed.
        endmethod.
    form handle_data_changed using p_data_changed type ref to
                                   cl_alv_changed_data_protocol.
      data: ls_mod_cell  type lvc_s_modi,
              lv_value_dni type lvc_value.
      loop at p_data_changed->mt_mod_cells into ls_mod_cell.
        call method p_data_changed->get_cell_value
          exporting
            i_row_id    = ls_mod_cell-row_id
            i_fieldname = 'FINI_SUST' <== Your field
          importing
            e_value     = lv_value_dni .
      endloop.
    endform.

  • [CS2/CS3 JS] Merged Cell Problem...

    Hi,
    Below is a part of my script that has been giving me a problem with merged cells:
    if (myTable.cells.item(h).bottomEdgeStrokeWeight > 0.5) {
    myTable.cells.item(h).bottomEdgeStrokeWeight = 2;
    myTable.cells.item(h).bottomEdgeStrokeType = "Thick - Thick";}
    Everytime the script passes on a merged cell, it quits and it only do changes on the first cell of the merged cells. Once I run my script again, it quits with error because the first cell of the merged cells now has a different stroke weight than the rest of the merged cells.
    Is there a way to apply stroke on merged cells? And what is the parameter for UNMERGE? Thanks.

    Hi Joaquin,
    Here are a few examples – hope it helps.
    Kasyan
    // lets assume myTable has 4 rows and 4 columns
    myTable = app.activeDocument.stories[0].tables[0];
    myStartCell = myTable.cells.item("0:0"); // cell in the 1st column and 1st row
    myEndCell = myTable.cells.item("0:3");  // cell in the 1st column and 4th row
    myStartCell.merge(myEndCell);
    // now merged cells have become the cell in the 1st column and 1st row
    myMergedCell = myTable.cells.item("0:0");
    myMergedCell.unmerge();
    // merge/unmerge the last row
    myTable.cells.item("0:3").merge(myTable.rows.item(-1));
    myTable.cells.item("0:3").unmerge();
    // merge/unmerge the last column
    myTable.columns.item(-1).cells.item(0).merge(myTable.columns.item(-1).cells.item(-1));
    myTable.columns.item(-1).cells.item(0).unmerge();

  • How to handle merge cells in the excel sheet while uploading

    Hi guys,
    I have a requirement where i need to upload the excel sheet. The data is given below.
    field1     field2     field3     field4
    a     x     1     1
              2     2
              3     3
         y1     4     4
         y2     5     5
         y3          6
    The output must be
    a     x     1     1
    a     x     2     2
    a     x     3     3
    a     y1     4     4
    a     y2     5     5
    a     y3     5     6
    Here the field1 column is merged.
    Please let me know if you guys have sample code to handle the merge cells in the excel sheet, that would be of gereat help.
    Regards,
    Karthik

    Hi guys,
    I have a requirement where i need to upload the excel sheet. The data is given below.
    field1     field2     field3     field4
    a     x     1     1
              2     2
              3     3
         y1     4     4
         y2     5     5
         y3          6
    The output must be
    a     x     1     1
    a     x     2     2
    a     x     3     3
    a     y1     4     4
    a     y2     5     5
    a     y3     5     6
    Here the field1 column is merged.
    Please let me know if you guys have sample code to handle the merge cells in the excel sheet, that would be of gereat help.
    Regards,
    Karthik

Maybe you are looking for