ABAP--如何在REUSE_ALV_GRID_DISPLAY标识不同行用不同的颜色
2007-12-14 11:13
871 查看
2006年09月08日 17:40:00
1 在内表中加入颜色字段
.............................
color(4) type c,
................................
2 在内表添加记录是通过条件设置颜色字段值
wa_customerinfo-color = 'C110'.
3 设置颜色控制内表 slis_layout_alv 的颜色字段为内表增加的颜色字段
data g_slis_layo type slis_layout_alv. "定义Grid输出颜色控制内表
g_slis_layo-info_fieldname = 'COLOR'.
4 输出记录
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = g_repid
is_layout = g_slis_layo
it_fieldcat = g_field[]
it_sort = g_sort[]
it_events = event_top_of_page[]
tables
t_outtab = i_customerinfo.
以下为显示表头的代码
data event_top_of_page type slis_alv_event occurs 0 with header line.
perform event_top_of_page tables event_top_of_page.
form event_top_of_page tables rt_event type slis_t_event.
refresh rt_event.
clear rt_event.
rt_event-name = slis_ev_top_of_page.
rt_event-form = 'WRITE_TOP_OF_PAGE'.
append rt_event.
endform. "event_top_of_page
form write_top_of_page.
data: hline type slis_listheader,
text(60) type c,
text10(10) type c,
text5(5) type c,
percent type p decimals 2.
refresh head.
clear head.
clear: hline, text.
hline-typ = 'S'.
write: '时间:', g_curdate to text.
hline-info = text.
append hline to head.
write: '客户状态:绿色-老呆死客户,红色-新呆死客户,兰色-超信用额度客户'
to text.
hline-info = text.
write: g_countkunnr to text5.
append hline to head.
concatenate '往来单位:' text5 '个.' into text.
hline-info = text.
append hline to head.
write: g_oldbad_count to text5.
concatenate '老呆死帐单位:' text5 '个,占' into text.
percent = g_oldbad_count * 100 / g_countkunnr.
write: percent to text5.
concatenate text5 '%' into text+23.
write: g_newbad_count to text5.
concatenate '新呆死单位:' text5 '个,占' into text+30.
percent = g_newbad_count * 100 / g_countkunnr.
write: percent to text5.
concatenate text5 '%' into text+53.
* CONDENSE text.
hline-info = text.
append hline to head.
clear text.
percent = g_ccdebit_count / 10000.
write: percent to text10.
concatenate '应收帐款:' text10 '万元' into text.
percent = g_webtr_count / 10000.
write: percent to text10.
concatenate '认可呆死帐:' text10 '万元.' into text+30.
hline-info = text.
append hline to head.
percent = g_oldbad_money / 10000.
write: percent to text10.
concatenate '老呆死帐款:' text10 '万元,' into text.
percent = g_oldbad_money * 100 / g_ccdebit_count.
write: percent to text5.
concatenate '占' text5 '%' into text+30.
hline-info = text.
append hline to head.
percent = g_newbad_money / 10000.
write: percent to text10.
concatenate '新呆死帐款:' text10 '万元,' into text.
percent = g_newbad_money * 100 / g_ccdebit_count.
write: percent to text5.
concatenate '占' text5 '%' into text+30.
hline-info = text.
append hline to head.
write: g_over_count to text5.
concatenate '超安全额度单位:' text5 '个,' into text.
percent = g_over_count * 100 / g_countkunnr.
write: percent to text5.
concatenate '占' text5 '%' into text+24.
percent = g_over_money / 10000.
write: percent to text10.
concatenate '超安全额度:' text10 '万元.' into text+30.
hline-info = text.
append hline to head.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = head.
endform. "write_top_of_page
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1195672
1 在内表中加入颜色字段
.............................
color(4) type c,
................................
2 在内表添加记录是通过条件设置颜色字段值
wa_customerinfo-color = 'C110'.
3 设置颜色控制内表 slis_layout_alv 的颜色字段为内表增加的颜色字段
data g_slis_layo type slis_layout_alv. "定义Grid输出颜色控制内表
g_slis_layo-info_fieldname = 'COLOR'.
4 输出记录
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = g_repid
is_layout = g_slis_layo
it_fieldcat = g_field[]
it_sort = g_sort[]
it_events = event_top_of_page[]
tables
t_outtab = i_customerinfo.
以下为显示表头的代码
data event_top_of_page type slis_alv_event occurs 0 with header line.
perform event_top_of_page tables event_top_of_page.
form event_top_of_page tables rt_event type slis_t_event.
refresh rt_event.
clear rt_event.
rt_event-name = slis_ev_top_of_page.
rt_event-form = 'WRITE_TOP_OF_PAGE'.
append rt_event.
endform. "event_top_of_page
form write_top_of_page.
data: hline type slis_listheader,
text(60) type c,
text10(10) type c,
text5(5) type c,
percent type p decimals 2.
refresh head.
clear head.
clear: hline, text.
hline-typ = 'S'.
write: '时间:', g_curdate to text.
hline-info = text.
append hline to head.
write: '客户状态:绿色-老呆死客户,红色-新呆死客户,兰色-超信用额度客户'
to text.
hline-info = text.
write: g_countkunnr to text5.
append hline to head.
concatenate '往来单位:' text5 '个.' into text.
hline-info = text.
append hline to head.
write: g_oldbad_count to text5.
concatenate '老呆死帐单位:' text5 '个,占' into text.
percent = g_oldbad_count * 100 / g_countkunnr.
write: percent to text5.
concatenate text5 '%' into text+23.
write: g_newbad_count to text5.
concatenate '新呆死单位:' text5 '个,占' into text+30.
percent = g_newbad_count * 100 / g_countkunnr.
write: percent to text5.
concatenate text5 '%' into text+53.
* CONDENSE text.
hline-info = text.
append hline to head.
clear text.
percent = g_ccdebit_count / 10000.
write: percent to text10.
concatenate '应收帐款:' text10 '万元' into text.
percent = g_webtr_count / 10000.
write: percent to text10.
concatenate '认可呆死帐:' text10 '万元.' into text+30.
hline-info = text.
append hline to head.
percent = g_oldbad_money / 10000.
write: percent to text10.
concatenate '老呆死帐款:' text10 '万元,' into text.
percent = g_oldbad_money * 100 / g_ccdebit_count.
write: percent to text5.
concatenate '占' text5 '%' into text+30.
hline-info = text.
append hline to head.
percent = g_newbad_money / 10000.
write: percent to text10.
concatenate '新呆死帐款:' text10 '万元,' into text.
percent = g_newbad_money * 100 / g_ccdebit_count.
write: percent to text5.
concatenate '占' text5 '%' into text+30.
hline-info = text.
append hline to head.
write: g_over_count to text5.
concatenate '超安全额度单位:' text5 '个,' into text.
percent = g_over_count * 100 / g_countkunnr.
write: percent to text5.
concatenate '占' text5 '%' into text+24.
percent = g_over_money / 10000.
write: percent to text10.
concatenate '超安全额度:' text10 '万元.' into text+30.
hline-info = text.
append hline to head.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = head.
endform. "write_top_of_page
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1195672
相关文章推荐
- ABAP--如何在REUSE_ALV_GRID_DISPLAY标识不同行用不同的颜色
- ABAP--如何在REUSE_ALV_GRID_DISPLAY标识不同行用不同的颜色
- ABAP--如何在REUSE_ALV_GRID_DISPLAY标识不同行用不同的颜色
- ABAP--如何在REUSE_ALV_GRID_DISPLAY标识不同行用不同的颜色
- ABAP--如何在REUSE_ALV_GRID_DISPLAY标识不同行用不同的颜色
- abap--关于在REUSE_ALV_GRID_DISPLAY将单元或行标识不同的颜色的处理收集
- abap--关于在REUSE_ALV_GRID_DISPLAY将单元或行标识不同的颜色的处理收集
- abap--关于在REUSE_ALV_GRID_DISPLAY将单元或行标识不同的颜色的处理收集
- abap--关于在REUSE_ALV_GRID_DISPLAY将单元或行标识不同的颜色的处理收集
- abap--关于在REUSE_ALV_GRID_DISPLAY将单元或行标识不同的颜色的处理收集
- ABAP--如何将REUSE_ALV_GRID_DISPLAY的题头自适应居中显示
- ABAP–如何在’REUSE_ALV_GRID_DISPLAY’使用自定义F4帮助,返回多个字段以及计算修改其他字段
- 如何设置'REUSE_ALV_GRID_DISPLAY'的单个单元格的颜色
- ABAP--如何限制REUSE_ALV_GRID_DISPLAY_LVC函数的某行某列的编辑(代码样例)
- ABAP--如何在'REUSE_ALV_GRID_DISPLAY'使用自定义F4帮助,返回多个字段以及计算修改其他字段
- ABAP--如何限制REUSE_ALV_GRID_DISPLAY_LVC函数的某行某列的编辑(代码样例)
- 如何设置'REUSE_ALV_GRID_DISPLAY'的单个单元格的颜色
- ABAP--如何限制REUSE_ALV_GRID_DISPLAY_LVC函数的某行某列的编辑(代码样例)
- ABAP--如何限制REUSE_ALV_GRID_DISPLAY_LVC函数的某行某列的编辑(代码样例)
- 如何设置'REUSE_ALV_GRID_DISPLAY'的单个单元格的颜色