ABAP--如何在REUSE_ALV_GRID_DISPLAY标识不同行用不同的颜色
来源:互联网 发布:美工笔记本 编辑:程序博客网 时间:2024/06/05 20:21
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将单元或行标识不同的颜色的处理收集
- ios tableView中在不同行中显示不同的颜色
- 根据条件,DBGrid不同行显示不同的颜色
- ABAP--如何将REUSE_ALV_GRID_DISPLAY的题头自适应居中显示
- ABAP--如何将REUSE_ALV_GRID_DISPLAY的题头自适应居中显示
- ListView Custom Draw - 不同行(列)显示不同的颜色
- 如何设置'REUSE_ALV_GRID_DISPLAY'的单个单元格的颜色
- 如何设置'REUSE_ALV_GRID_DISPLAY'的单个单元格的颜色
- 如何设置'REUSE_ALV_GRID_DISPLAY'的单个单元格的颜色
- 如何设置'REUSE_ALV_GRID_DISPLAY'的单个单元格的颜色
- 如何使DataGrid(Web)的不同行根据不同的条件有不同的显示格式?
- freemarker实现杂色显示(不同行颜色不同)
- sapui5 表格不同行的颜色控制
- ABAP--处理'REUSE_ALV_GRID_DISPLAY'的双击事件
- 将EXCEL文件上传到SAP AS的内表
- ABAP--如何创建动态结构的报表
- ABAP--如何限制自己开发的耗时报表在sap系统中运行的个数,以保证正常业务的进行
- ABAP--将数字金额转换为人民币大写字符串
- FI--SAP财务成本知识库
- ABAP--如何在REUSE_ALV_GRID_DISPLAY标识不同行用不同的颜色
- FI--R/3 功能详解----财务会计
- 使用'SAPGUI_SET_PROPERTY'函数是GUI屏幕可见和不可见
- ABAP--SAP的SYSTEM的函数列表和代码示例
- ABAP--在SAP中设计自动刷新的报表代码
- 利用RVV05ivb更新SD的单据索引器
- SD的信用控制增强
- SAP的BOM删除和维护
- Windows内核资源列表