《SAP开发总结.docx》由会员分享,可在线阅读,更多相关《SAP开发总结.docx(38页珍藏版)》请在第一文库网上搜索。
1、1.SAP开发总结AUTHORITY-CHECKOBJECTYMFIAVKORG,id,Ymfivkorg,fie1dgs_userinfos-vkorg.METHODauthority_check.AUTHORITY-CHECKOBJECT,S_A1V_1AYOID,ACTVT,FIE1D,23,.IFsy-subrcO.IFNOThand1eISINITIA1.IFNOT1og_groupISINITIA1.AUTHORITY-CHECKOBJECT,S_A1V_1AYRIDACTVT,FIE1D,23,IDREPORTFIE1DreportIDHAND1E,FIE1Dhand1eID1O
2、G_GROUPFIE1D1og_groupE1SE.AUTHORITY-CHECKOBJECTS_A1V_1AYR,IDACTVTFIE1D23IDREPORTFIE1DreportID,HAND1E,FIE1Dhand1eID1OG_GROUP,DUMMY.ENDIF.E1SE.IFNOT1og_groupISINITIA1.AUTHORITY-CHECKOBJECTS_A1V_1AYR,IDACTVTFIE1D23IDREPORTFIE1DreportID,HAND1E,DUMMYID1OG_GROUP,FIE1D1og_groupE1SE.AUTHORITY-CHECKOBJECT,S_
3、A1V_1AYRIDACTVT,FIE1D23IDREPORTFIE1DreportID,HAND1E,DUMMYID1OGGROUP,DUMMY.ENDIF.ENDIF.ENDIF.rc=sy-subrc.dummycheckforSU22trace(needsnote1587228)IFc1_su2x_too1s=get_status_su22_trace()=X.IFNOThand1eISINITIA1.IFNOT1og_groupISINITIA1.AUTHORITY-CHECKOBJECT,S_A1V_1AYR,ID,ACTVT,FIE1D23IDREPORTFIE1DreportI
4、D,HAND1E,FIE1Dhand1eID,1OG-GROUP,FIE1D1og_groupE1SE.AUTHORITY-CHECKOBJECT,S_A1V_1AYRID,ACTVT,FIE1D23IDREPORTFIE1DreportIDHAND1EFIE1Dhand1eID1OGGROUPDUMMY.ENDIF.E1SE.IFNOT1og_groupISINITIA1.AUTHORITY-CHECKOBJECTS_A1V_1AYR,ID,ACTVT,FIE1D23IDREPORTFIE1DreportIDHAND1EDUMMYID,1OG-GROUP,FIE1D1og_groupE1SE
5、.AUTHORITY-CHECKOBJECT,S_A1V_1AYR,ID,ACTVT,FIE1D23IDREPORTFIE1DreportIDHAND1E,DUMMYID,1OG-GROUP,DUMMY.ENDIF.ENDIF.IFsy-subrc=0.theresu1tisnotneededhereRETURN.ENDIF.ENDIF.ENDMETHOD.2.宏+指针结合操作数据METHODCOVVA1UERAN.DATA:1ODATATYPEREFTODATA.FIE1D-SYMBO1S:TYPEANY,TYPEANY.DEFINE1MACRO_SET_RANGE.IFNOT&1ISINI
6、TIA1ANDNOT&2ISINITIA1.ASSIGNCOMPONENT&1OFSTRUCTURETO.IFISASSIGNED.=&2.UNASSIGN.ENDIF.ENDIF.END-OF-DEFINITION.CHECKNOTIV_VA1UEISINITIA1.TRY.CREATEDATA1O_DATA1IKE1INEOFER_RANGE.ASSIGN1ODATA*TO.IFISASSIGNED.1MACRO_SET_RANGESIGN,I,.1MACRO_SET_RANGEOPTION,EQ,.1MACRO_SET_RANGE1OWIV_VA1UE1MACRO_SET_RANGESI
7、GN,I,.APPENDTOER_RANGE.UNASSIGN.ENDIF.CATCHCX_ROOT.ENDTRY.ENDMETHOD.3 .设置标准按钮的移除功能METHODSET_EXC_0100.DATA:1uNCTYPETAB1EOFUJFUNC.TO1T_INC.TO1T_INC.TO1TINC.APPENDC1_GUI_A1V_GRID=MC_FC_DETAI1APPENDC1_GUI_A1V_GRID=MC_FC_SORT_ASCAPPENDC1GUIA1VGRID-MCFCSORTDSCAPPENDC1_GUI_A1V_GRID=MC_FC_FINDTO1T_INCAPPEND
8、C1_GUI_A1V_GRID-MC_FC_FI1TERTO1T_INCAPPENDC1_GUI_A1V_GRID=MC_MB_EXPORTTO1T_INCAPPENDC1_GUI_A1V_GRID=MC_MB_SUMTO1T_INCAPPENDC1_GUI_A1V_GRID=MC_FC_CURRENT_VARIANTTO1T_INCAPPENDC1GUIA1VGRID=MCFCVIEWSTO1TINC使用按钮的移除功能CA11METHODYMC1_FI_STKGZ_ACTION-FUCTION_EXCEXPORTINGIT_INC=1T_INCIMPORTINGET_EXC=ET_EXC.E
9、NDMETHOD.4 .回车监听事件CA11METHODPOGRID-GETFI1TEREDENTRIESIMPORTING6 ETFI1TEREDENTRIES=1TFI1T.7 .更新屏幕界面1OOPATSCREEN.IFSCREEN-NAME=,P_WBST1,.SCREEN-INPUT=O.MODIFYSCREEN.ENDIF.IFSCREEN-NAME=,P_FQWBST,.SCREEN-INPUT=O.MODIFYSCREEN.ENDIF.8 .设置基本领件操作*注册编辑作用方式光标离开启作用CA11METHODGO_GRID_010O-REGISTER_EDIT_EVENTEXP
10、ORTINGI_EVENT_ID=C1_GUI_A1V_GRID=MC_EVT_MODIFIEDEXCEPTIONSERROR=1OTHERS=2.IFSY-SUBRCOO.*MESSAGEIDSY-MSGIDTYPESY-MSGTYNUMBERSY-MSGNO* WITHSY-MSGV1SY-MSGV2SY-MSGV3SY-MSGVA.ENDIF.* 注册事件CREATEOBJECTGO_EVENTS.SETHAND1ER:GO_EVENTS-USER_COMMAND_0100FORGO_GRID_0100,GO_EVENTS-AFTER_USER_COMMAND_0100FORGO_GRI
11、D_0100,GO_EVENTS-HAND1E_DATA_CHANGEDFORGO_GRID_0100.CA11METHODGO_GRID_0100-SET_TOO1BAR_INTERACTIVE.* CA11METHODGO_GRID_0100-REGISTER_EDIT_EVENT* EXPORTING* I_EVENT_ID=C1_GUI_A1V_GRID=MC_EVT_MODIFIED.CA11METHODGO_GRID_0100-REGISTER_EDIT_EVENTEXPORTINGI_EVENT_ID=C1_GUI_A1V_GRID=MC_EVT_ENTER.ENDIF.8 .增
12、加按钮功能项METHODADD_FUNCTION.DATA1_ENTRYTYPESCTX_ENTRY.1_ENTRY-TYPE=SCTX_C_TYPE_FUNCTION.1_ENTRY-FCODE=FCODE.1_ENTRY-FTYPE=FTYPE.1_ENTRY-ICON=ICON.1_ENTRY-TEXT=TEXT.1_ENTRY-DISAB1ED=DISAB1ED.1_ENTRY-HIDDEN=HIDDEN.1_ENTRY-CHECKED=CHECKED.1_entry-acce1erator=acce1erator.* UnusedforEntriesofTypeFUNCTION:C1
13、EAR1_ENTRY-MENU.IFinsert_at_the_topISINITIA1.* insertnewfunctionattheend:APPEND1_entryTOentrytab.E1SE.insertnewfunctionatthetop:INSERT1_entryINTOentrytabINDEX1.ENDIF.raiseeventchanged.ENDMETHOD.9 .工具函数VRM创建屏幕下拉框TYPE-POO1Szvrm.TYPE-POO1VRM.* *T.本,生*TYPES:* -Sing1eVa1ueinVa1ueSetBEGINOFVRM_VA1UE,KEY(40)TYPEC,TEXT(80)TYPEC,ENDOFVRM_VA1UE,* -Tab1eofVa1uesVRM_VA1UESTYPEVRM_VA1UEOCCURS0,* -IdofVa1ueSetVRM_IDTYPEVRM_VA1UE-TEXT,* -tab1eofIdsofVa1ueSetVRM_IDSTYPEVRM_IDOCCURSOz* -QUeUeHOWBEGINOFVRM_QUEUEROW,TAG,VA1UETYPEVRM_VA1UE,