screen的ALV的制作Word文档下载推荐.docx
- 文档编号:21085958
- 上传时间:2023-01-27
- 格式:DOCX
- 页数:16
- 大小:19.24KB
screen的ALV的制作Word文档下载推荐.docx
《screen的ALV的制作Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《screen的ALV的制作Word文档下载推荐.docx(16页珍藏版)》请在冰豆网上搜索。
TABLES:
ZTCAT.
INCLUDE<
icon>
.
DATA:
IT_MY_ZTCATLIKEZTCAT.
IT_ZTCATLIKETABLEOFIT_MY_ZTCATWITHHEADERLINE.
*ALV_________定义
DATAg_containerTYPEREFTOcl_gui_custom_container."
______
g_gridTYPEREFTOcl_gui_alv_grid,
it_fieldcatTYPElvc_t_fcat,
it_excludeTYPEui_functions,
is_layoutTYPElvc_s_layo.
x_save,"
forParameterI_SAVE
ls_layoutTYPEdisvariant."
forparameterIS_VARIANT
**f_titleTYPELVC_TITLE."
ALV______标题
CLASSlcl_alv_receiverDEFINITIONDEFERRED.
g_alv_applicationTYPEREFTOlcl_alv_receiver."
________
alv的见面创建和事件定义处理
***********************************SCREEN
SELECTION-SCREENBEGINOFBLOCKradio
WITHFRAMETITLEtext-005.__
PARAMETERS:
SE_PERIDLIKEZTCAT-PERIDOBLIGATORYMEMORYIDzperid.
SELECT-OPTIONSSE_BOOKCFORZTCAT-BOOKC.
SELECTION-SCREENENDOFBLOCKradio.
Z_YW_SCREEN_ALV_CLASS
____Z_YW_SCREEN_ALV_CLASS*
CLASSlcl_ALV_receiverDEFINITION."
PUBLICSECTION.
METHODS:
handle_double"
双击
FOREVENTdouble_clickOFcl_gui_alv_grid
IMPORTINGe_rowe_columnes_row_no,
handle_toolbar
FOREVENTtoolbarOFcl_gui_alv_grid"
TOOLBAR
IMPORTINGe_objecte_interactive,
handle_user_command"
____toolbar__UCOMM
FOREVENTuser_commandOFcl_gui_alv_grid
IMPORTINGe_ucomm,
handle_menu_button“子菜单
FOREVENTmenu_buttonOFcl_gui_alv_grid
IMPORTINGe_objecte_ucomm,
handle_data_changed“数据改变
foreventdata_changedofcl_gui_alv_grid
importinger_data_changed.
ENDCLASS."
lcl_event_receiverDEFINITION
Class(Implementation)lcl_event_receiver
*Text
*----------------------------------------------------------------------*
CLASSlcl_ALV_receiverIMPLEMENTATION."
__________
*-----------------------------------------------------------------
METHODhandle_double.
*ifsy-dynnr='
0100'
*READTABLEit_MAININTOit_MAININDEXe_row-index.
*IFsy-subrc=0.
*PERFORMDETAIL_DATA.
*PERFORMDISPLAY_DETAIL_ALV.
*ENDIF.
*elseifsy-dynnr='
0200'
*readtableit_double_clickintoit_double_clickINDEXe_row-index.
*ifsy-subrc=0.
*CLEAR:
F_PERID,F_KNORD.
*f_perid=p_perid.
*f_knord=it_double_click-knord.
*setparameterid'
ZPERID'
FIELDF_PERID.
*SETPARAMETERID'
ZORDER'
FIELDF_KNORD.
*CALLTRANSACTION'
ZBD002_03'
ANDSKIPFIRSTSCREEN.
*endif.
ENDMETHOD."
HANDLE_double
*-----------------------TOOLBAR------------------------------------*
METHODhandle_toolbar.
*?
2.IneventhandlermethodforeventTOOLBAR:
Appendownfunctions
*byusingeventparameterE_OBJECT.
DATA:
ls_toolbarTYPEstb_button.
*....................................................................
*E_OBJECTofeventTOOLBARisoftypeREFTOCL_ALV_EVENT_TOOLBAR_SET.
*Thisclasshasgotoneattribute,namlyMT_TOOLBAR,which
*isatableoftypeTTB_BUTTON.Onelineofthistableis
*definedbytheStructureSTB_BUTTON(seedatadeklarationabove).
*
*AremarktotheflagE_INTERACTIVE:
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*'
e_interactive'
isset,ifthiseventisraiseddueto
*thecallof'
set_toolbar_interactive'
bytheuser.
*Youcandistinguishthiswayiftheeventwasraised
*byyourselforbyALV
*(e.g.inmethod'
refresh_table_display'
).
*Anapplicationofthisfeatureisstillunknown...:
-)
*____________________
*__________ALV____
把需要的引掉
*DELETEe_object->
mt_toolbarWHEREFUNCTION='
&
MB_SUM'
MB_SUBTOT'
DELETEe_object->
SEP05'
PRINT_BACK'
MB_VIEW'
COL0'
SEP06'
GRAPH'
SEP07'
INFO'
'
SEP00'
CHECK'
LOCAL&
CUT'
COPY'
PASTE'
APPEND'
INSERT_ROW'
DELETE_ROW'
UNDO'
COPY_ROW'
.
REFRESH'
____________________________________________
*IFSY-TCODE<
>
'
ZBD002_22'
ANDSY-TCODE<
ZBD002_23'
**________
*CLEARls_toolbar.
*MOVE3TOls_toolbar-butn_type.
*APPENDls_toolbarTOe_object->
mt_toolbar.
*MOVE'
A_AVERAGE'
TOls_toolbar-function.
*MOVEicon_used_relationTOls_toolbar-icon.
____________________________'
(114)TOls_toolbar-quickinfo.
*MOVE1TOls_toolbar-butn_type.
TOls_toolbar-disabled.
*________alv________按钮
DEFINEset_toolbar.“宏定义
clearls_toolbar.
move&
1tols_toolbar-function.
2tols_toolbar-icon.
3tols_toolbar-butn_type."
_____________按钮类型‘‘则不为父菜单
4tols_toolbar-quickinfo.
move'
tols_toolbar-disabled.
appendls_toolbartoe_object->
END-OF-DEFINITION.
CLEARls_toolbar."
MOVE'
MOVE3TOls_toolbar-butn_type.
APPENDls_toolbarTOe_object->
*____________按钮1
set_toolbar'
CDOE_1'
icon_mass_change1'
MENU1'
*____________按钮2
CODE_2'
icon_create2'
MENU2'
*____________按钮3
SEP08'
3'
______”分隔符
*____________按钮4
icon_employee'
MENU4'
.
handle_toolbar
*---------------user_command-----------------------------------*
__________________________________________________
METHODhandle_user_command.
3.IneventhandlermethodforeventUSER_COMMAND:
Queryyour
*functioncodesdefinedinstep2andreactaccordingly.
*DATA:
lt_rowsTYPElvc_t_row.
f_linesTYPEi.
F_rcTYPEI.
*CASEe_ucomm.
*WHEN'
AVERAGE'
***1____________
F_TEMP_MENGE(5).
*PERFORMGET_SCREEN_MENGE.
*F_TEMP_MENGE=F_ALL_MENGE.
*CONCATENATE'
________________'
F_TEMP_MENGE'
________'
*INTOF_TEXT2.
*F_KJ_TEXT=F_TEXT2.
*PERFORMGET_AVERAGE.
*CALLMETHODcl_gui_cfw=>
set_new_ok_code"
________PBO__PAI
*EXPORTING
*new_code='
*IMPORTING
*rc=F_rc.
*INTOF_TEXT1.
*F_KJ_TEXT=F_TEXT1.
*PERFORMGET_A_AVERAGE.
set_new_ok_code
ALL_LINES_BFB'
*F_KJ_TEXT=F_TEXT4.
*PERFORMSUB_ALL_BFB.
ALL_LINES'
*F_KJ_TEXT=F_TEXT3.
*PERFORMSUB_ALL."
________________,____________________
*ENDCASE.
lcl_event_receiver
*-------------------------------------------------------------------
METHODhandle_menu_button.
"
3.AteventMENU_BUTTONqueryyourfunctioncodeanddefinea
*menuinthesamewayasacontextmenu.
*..........
*PartII:
Evaluate'
e_ucomm'
toseewhichmenubuttonofthetoolbar
*hasbeenclickedon.
*Definethenthecorrespondingmenu.
*Themenucontainsfunctioncodesthatareevaluated
*in'
handle_user_command'
*...........
*querye_ucommtofindoutwhichmenubuttonhasbeenclickedon
**1____________
***
F_TEMP_MENGE(5).
*IFe_ucomm='
____________'
INTO
*F_TEXT1.
*CALLMETHODe_object->
add_function
*EXPOR
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- screen ALV 制作