12-11-2007 5:50 AM
Hi:
Is there any method through which we can apply the mergecell funcitonality in ALV like similarly we do in MS-Excel.
12-11-2007 5:52 AM
hI
In order to display an ALV report with specific columns already sorted by default you will need to build a
sort catalogue. This is fairly straight forward and is done in the following way:
Step 1. Add data declaration for sort catalogue
Step 2. Add code to build sort catalogue table
Step 3. Update 'gd_tree->set_table_for_first_display' method call to include parameter 'it_sort'
ALV data declarations
data: it_sortcat type LVC_T_SORT,
it_sortcatdb type LVC_T_SORT.
perform build_sortcat.
&----
*& Form build_sortcat
&----
Build Sort catalog
----
FORM build_sortcat .
wa_sort-spos = 1.
wa_sort-fieldname = 'EBELN'.
wa_sort-SUBTOT = 'X'. "subtotals any totals column by this field
gd_sortcat-tabname
APPEND wa_sort TO it_sortcat.
wa_sort-spos = 2.
wa_sort-fieldname = 'EBELP'.
gd_sortcat-tabname
APPEND wa_sort TO it_sortcat.
ENDFORM. " build_sortcat
CALL METHOD gd_tree->set_table_for_first_display
EXPORTING
is_layout = gd_layout
CHANGING
it_fieldcatalog = gd_fieldcat
it_sort = it_sortcat
it_outtab = it_report.
12-11-2007 6:12 AM
Hi Naresh;
Thanks. Your answer was eally helpful. I need one more functionality in it. When it'll sort, it'll will remove the extra lines with blank contents. I've a requirement that those line should not disappear.
e.g. current functionality...
a
-
a
-
a
-
b
-
b
-
c
-
it'll be like
a
b
c
but I want like
a
-
-
-
b
-
c
Please suggest