在alv報表設計有時候需要根據一定條件將特定的單元顯示成特定的顏色,具體實現步驟如下:
1. 在需要顯示的內錶中新增新的字段,字段型別為lvc_t_scol
2. 根據條件設定顏色資料;
3. 設定layout-coltab_fieldname的資料指定顯示顏色的字段.
**如下:(注意紅色部分)
report z_alv_color.
type-pools: slis.
data: begin of it_flight occurs 0,
carrid like sflight-carrid,
connid like sflight-connid,
fldate like sflight-fldate,
seatsmax like sflight-seatsmax,
seatsocc like sflight-seatsocc,
color type lvc_t_scol,
end of it_flight.
data: it_fieldcat type slis_t_fieldcat_alv,
layout type slis_layout_alv.
call function 'reuse_alv_fieldcatalog_merge'
exporting
i_program_name = sy-repid
i_internal_tabname = 'it_flight'
i_inclname = sy-repid
changing
ct_fieldcat = it_fieldcat
exceptions
inconsistent_inte***ce = 1
program_error = 2.
select carrid
connid
fldate
seatsmax
seatsocc
from sflight
into corresponding fields of table it_flight
up to 20 rows.
data: col type lvc_s_scol,
coltab type lvc_t_scol,
color type lvc_s_colo.
color-col = '6'.
color-int = '0'.
color-inv = '0'.
loop at it_flight.
endif.
endloop.
layout-coltab_fieldname = 'color'.
call function 'reuse_alv_grid_display'
exporting
i_callback_program = sy-repid
is_layout = layout
it_fieldcat = it_fieldcat
tables
t_outtab = it_flight
exceptions
program_error = 1.
如何設定 iphone如何恢復手機出廠設定
下面還說下iphone如何恢復出廠操作,我使用的裝置是iphone5s,作業系統版本ios 11.2.1 設定 通用 下滑至最下面 還原 選擇你要還原的型別,如下圖 手機恢復出廠設定這個動作比較大,還原之前的配置也是一件比較麻煩的事,做之前要做好充分的準備工作,做好手機備份,做好資料可能丟失的準備,...
如何設定字型
private void btnbold click object sender,eventargs e else newfont new font oldfont,oldfont.style fontstyle.bold 設定為粗體字格式 richtextbox1.selectionfont ne...
如何設定PHP cookie
1 如何設定php cookie setcookie a aa setcookie b bb 原意是想設定coolie但是報錯了.以下是錯誤資訊.warning cannot modify header information headers already sent by output start...