SAPALV.docx
- 文档编号:11155991
- 上传时间:2023-02-25
- 格式:DOCX
- 页数:11
- 大小:18.75KB
SAPALV.docx
《SAPALV.docx》由会员分享,可在线阅读,更多相关《SAPALV.docx(11页珍藏版)》请在冰豆网上搜索。
SAPALV
调用功能模块:
CALLFUNCTION'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_interface_check ='' 接口一致性检查
i_callback_program =sy-repid 当前程序名
is_layout =layout 输出样式
it_fieldcat =fieldcat[] 字段定义描述表
i_callback_pf_status_set='PF_STATUS_SET' 触发事件调用子程序
i_callback_user_command ='USER_COMMAND' 鼠标事件操作子程序
it_events =i_events[] 出口程序触发事件
i_callback_html_top_of_page ='ALV_TOP_OF_PAGE' ALV输出表头设置
i_grid_settings=wl_lvc_s_glay 打印表头设置
it_sort=sortable[] 排序设置
TABLES
t_outtab =ig_out
EXCEPTIONS
program_error =1
OTHERS =2.
常用属性:
(赋值''中内容必须为大写)
1. Fieldcat
data:
fieldcattypeslis_t_fieldcat_alvwithheaderline.
it_fieldcat =fieldcat[]
属性(用来定义表单中的各个列的相关信息)
Fieldcat-col_pos=n. 输出列
Fieldcat-tabname='FIELDNAME'. 对应的内表字段名
Fieldcat-seltext_s/m/l='列名'. 输出列文本(_s:
短文本_l:
长文本)
Fieldcat-emphasize='CX10'. 带有颜色的高亮列(其中X=(1-7)颜色同format)
Fieldcat-hotspot='X'. 作为热点显示可触发鼠标触发事件
Fieldcat-currency='CURRKEY'. 表TCURX中的货币名称
Fieldcat-quantity(3) 计量单位
Fieldcat-qfieldname 参考计量单位的字段名称
Fieldcat-round=n. 四舍五入至小数位数下n位
Fieldcat-exponent=n. 浮点数的幂指数为n
Fieldcat-key='X'. 关键字段
Fieldcat-icon='X'. 作为图标输出
Fieldcat-symbol='X'. 输出作为符号
Fieldcat-checkbox='X'. 作为复选框输出
Fieldcat-just=SPACE,'R','L','C'. 对齐方式
Fieldcat-lzero='X'. 输出前导零
Fieldcat-no_sign='X'. 输出抑制符号
Fieldcat-no_zero='X'. 为输出隐藏零
Fieldcat-edit_mask=SPACE,mask.. 输出为mask的模式
Fieldcat-fix_column='X'. 固定列
Fieldcat-do_sum='X'. 总计列值总和
Fieldcat-no_out='X'. 列不输出
Fieldcat-tech='X'. 该字段为技术字段
Fieldcat-outputlen=n 列的字符宽度为n
Fieldcat-decimals_out=n 能控制小数点的位数为n
Fieldcat-datatype=C,I,N… 定义数据类型
2. Layout
data:
layouttypeslis_layout_alv.
is_layout =layout
属性(用于定义ALV表单的相关格式、属性)
info_fieldname='LINE_COLOR'. 设置特殊行颜色
(将LINE_COLOR增加到内表字段,写'CX10'到特殊行的LINE_COLOR,X为颜色值)
colwidth_optimize='X'. 优化列宽设置
no_colhead='X'. 不显示列名
no_vline='X'. 不显示列间竖线
zebra
f2code='&ETA'. 设置触发弹出详细信息窗口的功能码,这里是双击
no_vline 这个用来设置列间隔线
detail_initial_lines
detail_popup 是否弹出详细信息窗口
detail_titlebar 设置弹出窗口的标题栏
totals_text
totals_only
group_change_edit
header_text
三:
FIELDCAT属性
FIELDCAT:
types:
beginofslis_fieldcat_main,
row_pos likesy-curow,"outputinrow
col_pos likesy-cucol,"positionofthecolumn
fieldname typeslis_fieldname,
tabname typeslis_tabname,
ref_fieldname likedd03p-fieldname,
ref_tabname likedd03p-tabname,
currency(5) typec,
cfieldname typeslis_fieldname,"fieldwithcurrencyunit
ctabname typeslis_tabname, "andtable
quantity(3) typec,
qfieldname typeslis_fieldname,"fieldwithquantityunit
qtabname typeslis_tabname, "andtable
roundfieldnametypeslis_fieldname,
roundtabname typeslis_tabname,
round typei, "roundinwritestatement
decimalsfieldnametypeslis_fieldname,
decimalstabname typeslis_tabname,
decimals_out(6) typec, "decimalsinwritestatement
text_fieldnametypeslis_fieldname,
exponent(3) typec, "exponentforfloats
key
(1) typec, "columnwithkey-color
icon
(1) typec, "asicon
symbol
(1) typec, "assymbol
checkbox
(1) typec, "ascheckbox
just
(1) typec, "(R)ight(L)eft(C)ent.
lzero
(1) typec, "leadingzero
no_sign
(1) typec, "writeno-sign
no_zero
(1) typec, "writeno-zero
edit_mask typeslis_edit_mask, "
emphasize(4) typec, "emphasize
fix_column
(1) typec, "Spaltefixieren
do_sum
(1) typec, "sumup
no_out
(1) typec, "(O)blig.(X)noout
tech
(1) typec, "technicalfield
outputlen likedd03p-outputlen,
offset typedd03p-intlen, "offset
seltext_l likedd03p-scrtext_l,"longkeyword
seltext_m likedd03p-scrtext_m,"middlekeyword
seltext_s likedd03p-scrtext_s,"shortkeyword
reptext_ddic likedd03p-reptext, "heading(ddic)
ddictxt
(1) typec, "(S)hort(M)iddle(L)ong
rollname likedd03p-rollname,
* domname likedd03p-domname, "Domnamef黵Checkbox
datatype likedd03p-datatype,
inttype likedd03p-inttype,
ddic_outputlenlikedd03p-outputlen,
intlen likedd03p-intlen,
lowercase likedd03p-lowercase,
endofslis_fieldcat_main.
types:
beginofslis_fieldcat_alv_spec,
key_sel
(1) typec, "fieldnotobligatory
no_sum
(1) typec, "donotsumup
sp_group(4) typec, "groupspecification
reprep
(1) typec, "selectionforrep/rep
input
(1) typec, "input
hotspot
(1) typec, "hotspot
endofslis_fieldcat_alv_spec.
以上是fieldcat的属性
部分解释
col_pos 输出列
tabname 标签名称
currency(5) 货币单位
quantity(3) 计量单位
qfieldname 参考计量单位的字段名称
round ROUND值
exponent(3) 流动表示的指数
key
(1) 关键字段
icon
(1) 作为图标输出
symbol
(1) 输出作为符号
checkbox
(1) 作为复选框输出
just
(1) 对齐
lzero
(1) 输出前导零
no_sign
(1) 输出抑制符号
no_zero
(1) 为输出隐藏零
edit_mask 为输出编辑掩码
emphasize(4) 带有颜色的高亮列
fix_column
(1) 固定列
do_sum
(1) 总计列值
no_out
(1) 列没有输出
tech
(1) 技术字段
outputlen 列的字符宽度
decimals_out(6) =0不会有小数点了
***********************************************************
***********************************************************
LAYOUT:
定义部分:
DATA:
W_LAYOUTTYPESLIS_LAYOUT_ALV.
SLIS_LAYOUT_ALV构造如下:
types:
beginofslis_layout_main,
dummy,
endofslis_layout_main.
定义部分:
DATA:
W_LAYOUTTYPESLIS_LAYOUT_ALV.
SLIS_LAYOUT_ALV构造如下:
types:
beginofslis_layout_main,
dummy,
endofslis_layout_main.
types:
beginofslis_layout_alv_spec0,
no_colhead
(1)typec,"noheadings没有标题
no_hotspot
(1)typec,"headingsnotashotspot标题不作为hotspot
zebra
(1)typec,"stripedpattern镶边样式
no_vline
(1)typec,"columnsseparatedbyspace行由空间隔
no_hline
(1)typec,"rowsseparatedbyspaceB20K8A0N5D列由空间分隔
cell_merge
(1)typec,"notsuppressfieldreplication不压制领域复制
edit
(1)typec,"forgridonly仅为grid
edit_mode
(1)typec,"forgridonly仅为grid
numc_sum
(1)typec,"totalsforNUMC-Fieldspossib.数字型字段可集计
no_input
(1)typec,"onlydisplayfields仅显示
f2codelikesy-ucomm,"
reprep
(1)typec,"reportreportinterfaceactive报告接口激活
no_keyfix
(1)typec,"donotfixkeycolumns不固定关键字列
expand_all
(1)typec,"Expandallpositions扩展所有位置
no_author
(1)typec,"Nostandardauthoritycheck没有标准用户检查
*PF-status菜单项
def_status
(1)typec,"defaultstatusspaceor'A'缺省状态空间或'A'
item_text(20)typec,"Textforitembutton文本为项目按钮
countfnametypelvc_fname,
endofslis_layout_alv_spec0.
types:
beginofslis_layout_alv_spec1,
*Displayoptions显示属性
colwidth_optimize
(1)typec,
no_min_linesize
(1)typec,"linesize=widthofthelist
min_linesizelikesy-linsz,"ifinitialmin_linesize=80
max_linesizelikesy-linsz,"Default250
window_titlebarlikesy-title,
no_uline_hs
(1)typec,
*Exceptions扩展
lights_fieldnametypeslis_fieldname,"fieldnameforexception扩展字段名
lights_tabnametypeslis_tabname,"fieldnameforexception扩展字段名
lights_rollnamelikedfies-rollname,"rollnamef.exceptiondocu
lights_condense
(1)typec,"fieldnameforexception扩展字段名
*Sums合计
no_sumchoice
(1)typec,"nochoiceforsummingup无可选择总计
no_totalline
(1)typec,"nototalline没有合计行
no_subchoice
(1)typec,"nochoiceforsubtotals无可选择子合计
no_subtotals
(1)typec,"nosubtotalspossible没有子合计
no_unit_splittingtypec,"nosep.tot.linesbyinh.units
totals_before_itemstypec,"diplaytotalsbeforetheitems在明细前显示合计
totals_only
(1)typec,"showonlytotals只显示合计
totals_text(60)typec,"textfor1stcol.intotalline合计行第一列文本
subtotals_text(60)typec,"textfor1stcol.insubtotals子合计行第一列文本
*Interaction继承
box_fieldnametypeslis_fieldname,"fieldnameforcheckbox
box_tabnametypeslis_tabname,"tabnameforcheckbox
box_rollnamelikedd03p-rollname,"rollnameforcheckbox
expand_fieldnametypeslis_fieldname,"fieldnameflag'expand'
hotspot_fieldnametypeslis_fieldname,"fieldnameflaghotspot
confirmation_prompt,"confirm.promptwhenleaving
key_hotspot
(1)typec,"keysashotspot"K_KEYHOT
flexible_key
(1)typec,"keycolumnsmovable,...
group_buttons
(1)typec,"buttonsforCOL1-COL5
get_selinfos
(1)typec,"readselectionscreen
group_change_edit
(1)typec,"Settingsbyuserfornewgroup
no_scrolling
(1)typec,"noscrolling
*Detailedscreen屏幕详细
detail_popup
(1)typec,"showdetailinpopup弹出显示明细
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- SAP ALV