您好,欢迎访问三七文档
1.权限字段检查AUTHORITY-CHECKOBJECT'YMFIAVKORG'ID'YMFIVKORG'FIELDGS_USERINFOS-VKORG.METHODauthority_check.AUTHORITY-CHECKOBJECT'S_ALV_LAYO'ID'ACTVT'FIELD'23'.IFsy-subrc0.IFNOThandleISINITIAL.IFNOTlog_groupISINITIAL.AUTHORITY-CHECKOBJECT'S_ALV_LAYR'ID'ACTVT'FIELD'23'ID'REPORT'FIELDreportID'HANDLE'FIELDhandleID'LOG_GROUP'FIELDlog_group.ELSE.AUTHORITY-CHECKOBJECT'S_ALV_LAYR'ID'ACTVT'FIELD'23'ID'REPORT'FIELDreportID'HANDLE'FIELDhandleID'LOG_GROUP'DUMMY.ENDIF.ELSE.IFNOTlog_groupISINITIAL.AUTHORITY-CHECKOBJECT'S_ALV_LAYR'ID'ACTVT'FIELD'23'ID'REPORT'FIELDreportID'HANDLE'DUMMYID'LOG_GROUP'FIELDlog_group.ELSE.AUTHORITY-CHECKOBJECT'S_ALV_LAYR'ID'ACTVT'FIELD'23'ID'REPORT'FIELDreportID'HANDLE'DUMMYID'LOG_GROUP'DUMMY.ENDIF.ENDIF.ENDIF.rc=sy-subrc.dummycheckforSU22trace(needsnote1587228)IFcl_su2x_tools=get_status_su22_trace()='X'.IFNOThandleISINITIAL.IFNOTlog_groupISINITIAL.AUTHORITY-CHECKOBJECT'S_ALV_LAYR'ID'ACTVT'FIELD'23'ID'REPORT'FIELDreportID'HANDLE'FIELDhandleID'LOG_GROUP'FIELDlog_group.ELSE.AUTHORITY-CHECKOBJECT'S_ALV_LAYR'ID'ACTVT'FIELD'23'ID'REPORT'FIELDreportID'HANDLE'FIELDhandleID'LOG_GROUP'DUMMY.ENDIF.ELSE.IFNOTlog_groupISINITIAL.AUTHORITY-CHECKOBJECT'S_ALV_LAYR'ID'ACTVT'FIELD'23'ID'REPORT'FIELDreportID'HANDLE'DUMMYID'LOG_GROUP'FIELDlog_group.ELSE.AUTHORITY-CHECKOBJECT'S_ALV_LAYR'ID'ACTVT'FIELD'23'ID'REPORT'FIELDreportID'HANDLE'DUMMYID'LOG_GROUP'DUMMY.ENDIF.ENDIF.IFsy-subrc=0.theresultisnotneededhereRETURN.ENDIF.ENDIF.ENDMETHOD.2.宏+指针结合操作数据METHODCOV_VALUE_RAN.DATA:LO_DATATYPEREFTODATA.FIELD-SYMBOLS:FS_RANGETYPEANY,FV_VALUETYPEANY.DEFINELMACRO_SET_RANGE.IFNOT&1ISINITIALANDNOT&2ISINITIAL.ASSIGNCOMPONENT&1OFSTRUCTUREFS_RANGETOFV_VALUE..IFFV_VALUEISASSIGNED.FV_VALUE=&2.UNASSIGNFV_VALUE.ENDIF.ENDIF.END-OF-DEFINITION.CHECKNOTIV_VALUEISINITIAL.TRY.CREATEDATALO_DATALIKELINEOFER_RANGE.ASSIGNLO_DATA-*TOFS_RANGE.IFFS_RANGEISASSIGNED.LMACRO_SET_RANGE'SIGN''I'.LMACRO_SET_RANGE'OPTION''EQ'.LMACRO_SET_RANGE'LOW'IV_VALUE.LMACRO_SET_RANGE'SIGN''I'.APPENDFS_RANGETOER_RANGE.UNASSIGNFS_RANGE.ENDIF.CATCHCX_ROOT.ENDTRY.ENDMETHOD.3.设置标准按钮的移除功能METHODSET_EXC_0100.DATA:LT_INCTYPETABLEOFUI_FUNC.APPENDCL_GUI_ALV_GRID=MC_FC_DETAILTOLT_INC.APPENDCL_GUI_ALV_GRID=MC_FC_SORT_ASCTOLT_INC.APPENDCL_GUI_ALV_GRID=MC_FC_SORT_DSCTOLT_INC.APPENDCL_GUI_ALV_GRID=MC_FC_FINDTOLT_INC.APPENDCL_GUI_ALV_GRID=MC_FC_FILTERTOLT_INC.APPENDCL_GUI_ALV_GRID=MC_MB_EXPORTTOLT_INC.APPENDCL_GUI_ALV_GRID=MC_MB_SUMTOLT_INC.APPENDCL_GUI_ALV_GRID=MC_FC_CURRENT_VARIANTTOLT_INC.APPENDCL_GUI_ALV_GRID=MC_FC_VIEWSTOLT_INC.“使用按钮的移除功能CALLMETHODYMCL_FI_STKGZ_ACTION=FUCTION_EXCEXPORTINGIT_INC=LT_INCIMPORTINGET_EXC=ET_EXC.ENDMETHOD.4.回车监听事件CALLMETHODPO_GRID-GET_FILTERED_ENTRIESIMPORTINGET_FILTERED_ENTRIES=LT_FILT.5.创建树的基本操作DATA:GO_TREE_DOCKINGTYPEREFTOCL_GUI_DOCKING_CONTAINER,GO_TREETYPEREFTOCL_GUI_SIMPLE_TREE,GV_TREE_0100_VISTYPECVALUE'',GT_ADD_NODESLIKESTANDARDTABLEOFMTREESNODE.6.更新屏幕界面LOOPATSCREEN.IFSCREEN-NAME='P_WBST1'.SCREEN-INPUT=0.MODIFYSCREEN.ENDIF.IFSCREEN-NAME='P_FQWBST'.SCREEN-INPUT=0.MODIFYSCREEN.ENDIF.7.设置基本事件操作*注册编辑作用方式光标离开启作用CALLMETHODGO_GRID_0100-REGISTER_EDIT_EVENTEXPORTINGI_EVENT_ID=CL_GUI_ALV_GRID=MC_EVT_MODIFIEDEXCEPTIONSERROR=1OTHERS=2.IFSY-SUBRC0.*MESSAGEIDSY-MSGIDTYPESY-MSGTYNUMBERSY-MSGNO*WITHSY-MSGV1SY-MSGV2SY-MSGV3SY-MSGV4.ENDIF.*注册事件CREATEOBJECTGO_EVENTS.SETHANDLER:GO_EVENTS-USER_COMMAND_0100FORGO_GRID_0100,GO_EVENTS-AFTER_USER_COMMAND_0100FORGO_GRID_0100,GO_EVENTS-HANDLE_DATA_CHANGEDFORGO_GRID_0100.CALLMETHODGO_GRID_0100-SET_TOOLBAR_INTERACTIVE.*CALLMETHODGO_GRID_0100-REGISTER_EDIT_EVENT*EXPORTING*I_EVENT_ID=CL_GUI_ALV_GRID=MC_EVT_MODIFIED.CALLMETHODGO_GRID_0100-REGISTER_EDIT_EVENTEXPORTINGI_EVENT_ID=CL_GUI_ALV_GRID=MC_EVT_ENTER.ENDIF.8.增加按钮功能项METHODADD_FUNCTION.DATAL_ENTRYTYPESCTX_ENTRY.L_ENTRY-TYPE=SCTX_C_TYPE_FUNCTION.L_ENTRY-FCODE=FCODE.L_ENTRY-FTYPE=FTYPE.L_ENTRY-ICON=ICON.L_ENTRY-TEXT=TEXT.L_ENTRY-DISABLED=DISABLED.L_ENTRY-HIDDEN=HIDDEN.L_ENTRY-CHECKED=CHECKED.l_entry-accelerator=accelerator.*UnusedforEntriesofTypeFUNCTION:CLEARL_ENTRY-MENU.IFinsert_at_the_topISINITIAL.*insertnewfunctionattheend:APPENDl_entryTOentrytab.ELSE.*insertnewfunctionatthetop:INSERTl_entryINTOentrytabINDEX1.ENDIF.raiseeventchanged.*...ENDMETHOD.9.工具函数VRM创建屏幕下拉框TYPE-POOLS:vrm.TYPE-POOLVRM.*******************************工具基本属性*************************TYPES:*--SingleValueinValueSetBEGINOFVRM_VALUE,KEY(40)TYPEC,TEXT(80)TYPEC,ENDOFVRM_VALUE,*--TableofValuesVRM_VALUESTYPEVRM_VALUEOCCURS0,*--IdofValueSetVRM_IDTYPEVRM_VALUE-TEXT,*--tableofIdsofValueSetVRM_IDSTYPEVRM_IDOCCURS0,*--QueueRowBEGINOFVRM_QUEUEROW,TAG,VALUETYPEVRM_VALUE,ENDOFVRM_QUEUEROW,*--QueueVRM_QUEUETYPEVRM_QUEUEROWOCCURS0.CONSTANTS:VRM_TYPE(20)VALUE'application',VRM_SUBTYPE(20)VALUE'x-sapvaluesets',VRM_QUEUE_TAG_HEADERVALUE'T',VRM_QUEUE_TAG_SUBHEADERVALUE'X',VRM_QUEUE_TAG_ENTRYVALUE'',VRM_QUEUE_KEY_TYPETYPEVRM_VALUE-KEYVALUE'TYPE',VRM_QUEUE_KEY_NAMETYPEVRM_VALUE-KEYVALUE'NAME'.*****************************下拉列表实例*************************REPORTYMPSR102NOSTANDARDPAGEHEADINGMES
本文标题:SAP开发总结
链接地址:https://www.777doc.com/doc-15218 .html