在ALV中合并单元格和单元格格式

时间:2014-11-18 17:10:57

标签: sap abap styling alv

我们正在尝试操作alv网格类以获得Sap Agenda(SSC1 tcode)中的结果,即合并列和行。

我们发现使用方法cl_calendar_control_schedule的类display处理这个问题,我们正在努力了解此方法的内容及其参数。

我们发现lvc_t_data类型的internat表处理单元格的水平和/或垂直合并(每个单元格的内部表格的一行),但我很难理解如何编码单元格样式,例如,如果我想擦拭底部边框或左边框。什么是不同颜色的样式,不同的粗体样式,强调......?

我们发现除了这个变量之外还有lvc_t_info类型的参数,它的用途是什么?

由于

1 个答案:

答案 0 :(得分:2)

我找到了答案。谢谢大家:

您必须包含cl_alv_contol,并且可以提供所需的所有样式,例如alv_style_color_background + alv_style_font_bold,并且代码是此包含中的常量。

***INCLUDE <CL_ALV_CONTROL> .
CONSTANTS:
* Style 1
 ALV_STYLE_COLOR_BACKGROUND(4)                  TYPE X VALUE '00000001',
 ALV_STYLE_COLOR_HEADING(4)                     TYPE X VALUE '00000002',
 ALV_STYLE_COLOR_NORMAL(4)                      TYPE X VALUE '00000003',
 ALV_STYLE_COLOR_TOTAL(4)                       TYPE X VALUE '00000004',
 ALV_STYLE_COLOR_KEY(4)                         TYPE X VALUE '00000005',
 ALV_STYLE_COLOR_POSITIVE(4)                    TYPE X VALUE '00000006',
 ALV_STYLE_COLOR_NEGATIVE(4)                    TYPE X VALUE '00000007',
 ALV_STYLE_COLOR_GROUP(4)                       TYPE X VALUE '00000008',
 ALV_STYLE_COLOR_INT_BACKGROUND(4)              TYPE X VALUE '00000009',
 ALV_STYLE_COLOR_INT_HEADING(4)                 TYPE X VALUE '0000000A',
 ALV_STYLE_COLOR_INT_NORMAL(4)                  TYPE X VALUE '0000000B',
 ALV_STYLE_COLOR_INT_TOTAL(4)                   TYPE X VALUE '0000000C',
 ALV_STYLE_COLOR_INT_KEY(4)                     TYPE X VALUE '0000000D',
 ALV_STYLE_COLOR_INT_POSITIVE(4)                TYPE X VALUE '0000000E',
 ALV_STYLE_COLOR_INT_NEGATIVE(4)                TYPE X VALUE '0000000F',
 ALV_STYLE_COLOR_INT_GROUP(4)                   TYPE X VALUE '00000010',
 ALV_STYLE_COLOR_INV_BACKGROUND(4)              TYPE X VALUE '00000011',
 ALV_STYLE_COLOR_INV_HEADING(4)                 TYPE X VALUE '00000012',
 ALV_STYLE_COLOR_INV_NORMAL(4)                  TYPE X VALUE '00000013',
 ALV_STYLE_COLOR_INV_TOTAL(4)                   TYPE X VALUE '00000014',
 ALV_STYLE_COLOR_INV_KEY(4)                     TYPE X VALUE '00000015',
 ALV_STYLE_COLOR_INV_POSITIVE(4)                TYPE X VALUE '00000016',
 ALV_STYLE_COLOR_INV_NEGATIVE(4)                TYPE X VALUE '00000017',
 ALV_STYLE_COLOR_INV_GROUP(4)                   TYPE X VALUE '00000018',

 ALV_STYLE_FONT_BOLD(4)                         TYPE X VALUE '00000020',
 ALV_STYLE_FONT_BOLD_NO(4)                      TYPE X VALUE '00000040',

 ALV_STYLE_FONT_ITALIC(4)                       TYPE X VALUE '00000080',
 ALV_STYLE_FONT_ITALIC_NO(4)                    TYPE X VALUE '00000100',

 ALV_STYLE_FONT_UNDERLINED(4)                   TYPE X VALUE '00000200',
 ALV_STYLE_FONT_UNDERLINED_NO(4)                TYPE X VALUE '00000400',

 ALV_STYLE_ALIGN_LEFT_TOP(4)                    TYPE X VALUE '00000800',
 ALV_STYLE_ALIGN_CENTER_TOP(4)                  TYPE X VALUE '00001000',
 ALV_STYLE_ALIGN_RIGHT_TOP(4)                   TYPE X VALUE '00001800',
 ALV_STYLE_ALIGN_LEFT_CENTER(4)                 TYPE X VALUE '00002000',
 ALV_STYLE_ALIGN_CENTER_CENTER(4)               TYPE X VALUE '00002800',
 ALV_STYLE_ALIGN_RIGHT_CENTER(4)                TYPE X VALUE '00003000',
 ALV_STYLE_ALIGN_LEFT_BOTTOM(4)                 TYPE X VALUE '00003800',
 ALV_STYLE_ALIGN_CENTER_BOTTOM(4)               TYPE X VALUE '00004000',
 ALV_STYLE_ALIGN_RIGHT_BOTTOM(4)                TYPE X VALUE '00004800',

 ALV_STYLE_FONT_SYMBOL(4)                       TYPE X VALUE '00008000',
 ALV_STYLE_FONT_SYMBOL_NO(4)                    TYPE X VALUE '00010000',

 ALV_STYLE_CHECKBOX_NOT_CHECKED(4)              TYPE X VALUE '00020000',
 ALV_STYLE_CHECKBOX_CHECKED(4)                  TYPE X VALUE '00040000',
 ALV_STYLE_CHECKBOX_NO(4)                       TYPE X VALUE '00060000',

 ALV_STYLE_ENABLED(4)                           TYPE X VALUE '00080000',
 ALV_STYLE_DISABLED(4)                          TYPE X VALUE '00100000',

 ALV_STYLE_SINGLE_CLK_EVENT(4)                  TYPE X VALUE '00200000',
 ALV_STYLE_SINGLE_CLK_EVENT_NO(4)               TYPE X VALUE '00400000',

 ALV_STYLE_RADIO_NOT_CHECKED(4)                 TYPE X VALUE '00800000',
 ALV_STYLE_RADIO_CHECKED(4)                     TYPE X VALUE '01000000',
 ALV_STYLE_RADIO_NO(4)                          TYPE X VALUE '01800000',

 ALV_STYLE_F4(4)                                TYPE X VALUE '02000000',
 ALV_STYLE_F4_NO(4)                             TYPE X VALUE '04000000',

 ALV_STYLE_IMAGE(4)                             TYPE X VALUE '08000000',

 ALV_STYLE_NO_DELETE_ROW(4)                     TYPE X VALUE '10000000',

 ALV_STYLE_BUTTON(4)                            TYPE X VALUE '20000000',
 ALV_STYLE_BUTTON_NO(4)                         TYPE X VALUE '40000000',


* Style 2
 ALV_STYLE2_NO_BORDER_LEFT(4)                   TYPE X VALUE '00010000',
 ALV_STYLE2_NO_BORDER_RIGHT(4)                  TYPE X VALUE '00020000',
 ALV_STYLE2_NO_BORDER_TOP(4)                    TYPE X VALUE '00040000',
 ALV_STYLE2_NO_BORDER_BOTTOM(4)                 TYPE X VALUE '00080000',

* Style 3 ( WEBSTYLES ).


* Style 4
 ALV_STYLE4_ZEBRA_ROW(4)                        TYPE X VALUE '00000001',
 ALV_STYLE4_STOP_MERGE(4)                       TYPE X VALUE '00000002',

 ALV_STYLE4_LINK(4)                             TYPE X VALUE '00000004',
 ALV_STYLE4_LINK_NO(4)                          TYPE X VALUE '00000008',


* Column Styles
ALV_COL_STYLE_SORT_UP(4)                        TYPE X VALUE '00000001',
ALV_COL_STYLE_SORT_DOWN(4)                      TYPE X VALUE '00000002',
ALV_COL_STYLE_FILTER(4)                         TYPE X VALUE '00000004',
ALV_COL_STYLE_TOTAL(4)                          TYPE X VALUE '00000008',
ALV_COL_STYLE_SUBTOTAL(4)                       TYPE X VALUE '00000010',
ALV_COL_STYLE_CHARACTERISTIC(4)                 TYPE X VALUE '00000020',
ALV_COL_STYLE_KEYFIGURE(4)                      TYPE X VALUE '00000040',
ALV_COL_STYLE_KEY(4)                            TYPE X VALUE '00000080',
ALV_COL_STYLE_EXCEPTION(4)                      TYPE X VALUE '00000100',
ALV_COL_STYLE_SIGNED_KEYFIGURE(4)               TYPE X VALUE '00000200',
ALV_COL_STYLE_MERGE(4)                          TYPE X VALUE '00000400',
ALV_COL_STYLE_FIXED(4)                          TYPE X VALUE '00000800',
ALV_COL_STYLE_AUTO_VALUE(4)                     TYPE X VALUE '00001000',
ALV_COL_STYLE_NO_DISP(4)                        TYPE X VALUE '00002000',
ALV_COL_STYLE_HASREF(4)                         TYPE X VALUE '00004000',
ALV_COL_STYLE_AVERAGE(4)                        TYPE X VALUE '00008000',
ALV_COL_STYLE_MIN(4)                            TYPE X VALUE '00010000',
ALV_COL_STYLE_MAX(4)                            TYPE X VALUE '00020000'.