如下圖所示,需要在alv表頭實現下列樣式
所以,在alv function 中設定 i_callback_html_top_of_page = 'html_top_of_page':
call function 'reuse_alv_grid_display'
exporting
i_callback_program = sy-repid
i_callback_pf_status_set = c_pf_status
i_callback_user_command = c_command
i_callback_html_top_of_page = 'html_top_of_page'
* i_html_height_top = 10 " 設定抬頭寬度
* i_html_height_end = 10 " 設定抬頭寬度
i_default = c_x
it_fieldcat = t_fieldcat
* insert
* it_events = it_event
tables
t_outtab = t_head
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type 's' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 display like 'e'.
endif.
然後在form:html_top_of_page 中寫如下**:
form html_top_of_page using document type ref to cl_dd_document.
data: text type sdydo_text_element.
data: m_p type i,
m_buffer type string.
data l_bukrs type t001.
select single *
from t001
into l_bukrs
where bukrs = p_bukrs.
data l_mon type char2.
concatenate '
' into m_buffer. " 居中 設定字型格式
call method document->html_insert
exporting
contents = m_buffer
changing
position = m_p.
l_mon = p_monatt .
concatenate '會企' '02表' into m_buffer .
call method document->html_insert
exporting
contents = m_buffer
changing
position = m_p.
text = l_bukrs-butxt.
data area1 type ref to cl_dd_area.
data area2 type ref to cl_dd_area.
「輸出公司名稱
call method document->add_text exporting text = text.
」把區域一分為二
call method document->vertical_split exporting split_area = document
split_width = '50%'
importing right_area = area2.
「在區域2中輸出文字:日期、單位
concatenate '' p_gjahr p_monatt ' ' ' 單位: 人民幣' into m_buffer .
call method area2->html_insert
exporting
contents = m_buffer
changing
position = m_p.
endform.
ABAP實現多表頭ALV
實現 雙層設定 這句話是關鍵,擴充套件節點 第一層表頭 cns vbap type slis tabname value ty wflist 第二層專案 表頭 l h tbl fieldcat tabname cns vbak.l h tbl fieldcat fieldname instid l ...
ABAP實現ALV表頭動態輸出 日期
data begin of it date occurs 0,lv date like vbak vdatu,endof it date.data begin of it month occurs 0,month 8 type c,end of it month.獲取每個so的所有交貨日期 yyyy...
場景劃分區域
為何要對場景進行區域劃分,這個同樣是為了優化碰撞檢測。因為相對於其他邏輯而言碰撞檢測尤其消耗效能,尤其是對網格類的碰撞體進行碰撞檢測時效能開銷更大。試想一下場景中有1000個物體 如果沒有區域劃分的情況,物體兩兩碰撞檢測的次數是 1000 1000次,而如果遊戲幀率達到60,那麼這個碰撞檢測邏輯就達...