《SAP开发总结7709.docx》由会员分享,可在线阅读,更多相关《SAP开发总结7709.docx(82页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、1 权限字段检查AUTHORITY-CHECKOBJECTYMFIAVKORGIDYMFIVKORGFIELDGS_USERINFOS-VKORG.METHODauthority_check.AUTHORITY-CHECKOBJECTS_ALV_LAYOIDACTVTFIELD23.IFsy-subrc0.IFNOThandleISINITIAL.IFNOTlog_groupISINITIAL.AUTHORITY-CHECKOBJECTS_ALV_LAYRIDACTVTFIELD23IDREPORTFIELDreportIDHANDLEFIELDhandleIDLOG_GROUPFIELDlo
2、g_group.ELSE.AUTHORITY-CHECKOBJECTS_ALV_LAYRIDACTVTFIELD23IDREPORTFIELDreportIDHANDLEFIELDhandleIDLOG_GROUPDUMMY.ENDIF.ELSE.IFNOTlog_groupISINITIAL.AUTHORITY-CHECKOBJECTS_ALV_LAYRIDACTVTFIELD23IDREPORTFIELDreportIDHANDLEDUMMYIDLOG_GROUPFIELDlog_group.ELSE.AUTHORITY-CHECKOBJECTS_ALV_LAYRIDACTVTFIELD2
3、3IDREPORTFIELDreportIDHANDLEDUMMYIDLOG_GROUPDUMMY.ENDIF.ENDIF.ENDIF.rc=sy-subrc.dummycheckforSU22trace(needsnote1587228)IFcl_su2x_tools=get_status_su22_trace()=X.IFNOThandleISINITIAL.IFNOTlog_groupISINITIAL.AUTHORITY-CHECKOBJECTS_ALV_LAYRIDACTVTFIELD23IDREPORTFIELDreportIDHANDLEFIELDhandleIDLOG_GROU
4、PFIELDlog_group.ELSE.AUTHORITY-CHECKOBJECTS_ALV_LAYRIDACTVTFIELD23IDREPORTFIELDreportIDHANDLEFIELDhandleIDLOG_GROUPDUMMY.ENDIF.ELSE.IFNOTlog_groupISINITIAL.AUTHORITY-CHECKOBJECTS_ALV_LAYRIDACTVTFIELD23IDREPORTFIELDreportIDHANDLEDUMMYIDLOG_GROUPFIELDlog_group.ELSE.AUTHORITY-CHECKOBJECTS_ALV_LAYRIDACT
5、VTFIELD23IDREPORTFIELDreportIDHANDLEDUMMYIDLOG_GROUPDUMMY.ENDIF.ENDIF.IFsy-subrc=0.theresultisnotneededhereRETURN.ENDIF.ENDIF.ENDMETHOD.2 宏+指针结合操操作数据METHODCOV_VVALUE_RAN.DATAA:LO_DAATATYYPEREEFTODATA.FIELLD-SYMMBOLS:TYPEEANY,TYPPEANYY.DEFIINELMMACRO_SET_RRANGE.IFFNOT&1ISINITIIALANNDNOOT&2ISINNITIALL
6、.ASSSIGNCOMPOONENT&1OFSTRUCCTURETO.IFISSASSIIGNED.=&2.UNNASSIGGN.ENNDIF.ENDDIF.END-OF-DEEFINITTION.CHECCKNOTTIV_VVALUEISINNITIALL.TRY.CREAATEDAATALOO_DATAALIKEELINEEOFEER_RANNGE.ASSIIGNLOO_DATAA-*TO.IFISSASSIIGNED.LMMACRO_SET_RRANGESIGNNI.LMMACRO_SET_RRANGEOPTIIONEQ.LMMACRO_SET_RRANGELOWIV_VAALUE.LM
7、MACRO_SET_RRANGESIGNNI.APPPENDTOER_RANGEE.UNNASSIGGN.ENDIIF.CAATCHCCX_ROOOT.ENDTTRY.ENDMEETHOD.3 设置标准按钮的的移除功能METHODSET_EEXC_01100.DATAA:LT_INNCTYPPETABBLEOFFUI_FFUNC.APPEENDCLL_GUI_ALV_GGRID=MC_FCC_DETAAILTOLT_INNC.APPEENDCLL_GUI_ALV_GGRID=MC_FCC_SORTT_ASCTOLT_INNC.APPEENDCLL_GUI_ALV_GGRID=MC_FCC_SO
8、RTT_DSCTOLT_INNC.APPEENDCLL_GUI_ALV_GGRID=MC_FCC_FINDDTOLT_INNC.APPEENDCLL_GUI_ALV_GGRID=MC_FCC_FILTTERTOLT_INNC.APPEENDCLL_GUI_ALV_GGRID=MC_MBB_EXPOORTTOLT_INNC.APPEENDCLL_GUI_ALV_GGRID=MC_MBB_SUMTOLT_INNC.APPEENDCLL_GUI_ALV_GGRID=MC_FCC_CURRRENT_VVARIANNTTOLT_INNC.APPEENDCLL_GUI_ALV_GGRID=MC_FCC_V
9、IEWWSTOLT_INNC.“使用按钮的移移除功能CALLMETHOODYMCCL_FI_STKGZZ_ACTIION=FUCTTION_EEXCEXPOORTINGGIT_IINC=LT_INNCIMPORRTINGET_EXXC=ET_EEXC.ENDMEETHOD.4 回车监听事件CALLMETHOODPO_GRID-GET_FILTEERED_EENTRIEESIMPORRTINGET_FIILTEREED_ENTTRIES=LT_FFILT.5 创建树的基本操操作DATA:GOO_TREEE_DOCKKINGTYPEREFTTOCLL_GUI_DOCKIING_COONTAINNE
10、R,GO_TRREETYPPEREFFTOCL_GUUI_SIMMPLE_TTREE,GV_TRREE_01100_VIISTYPPECVALLUE,GT_ADDD_NODDESLIKKESTAANDARDDTABLLEOFMTREEESNODEE.6 更新屏幕界面LOOOPATSCREEEN.IFSSCREENN-NAME=P_WWBST1.SCCREEN-INPUTT=0.MOODIFYSCREEEN.ENDIIF.IFSSCREENN-NAME=P_FFQWBSTT.SCCREEN-INPUTT=0.MOODIFYSCREEEN.ENDIIF.7 设置基本事件操操作*注册编辑作作用方式光
11、标离开启启作用CAALLMEETHODGO_GRRID_01100-REGIISTER_EDIT_EVENTTEXXPORTIINGI_EEVENT_ID=CL_GUUI_ALVV_GRIDD=MC_EEVT_MOODIFIEEDEEXCEPTTIONSEERROR=1OTHERRS=2.IFSY-SUBRCC00.*MESSSAGEIDSYY-MSGIIDTYPPESY-MSGTYYNUMBBERSYY-MSGNNO*WWITHSSY-MSGGV1SYY-MSGVV2SY-MSGV33SY-MMSGV4.ENDIIF.*注册事件件CREAATEOBBJECTGO_EVVENTS.SETHAN
12、DLLER:GOO_EVENNTS-USERR_COMMMAND_00100FORGOO_GRIDD_01000,GOO_EVENNTS-AFTEER_USEER_COMMMAND_0100FORGOO_GRIDD_01000,GOO_EVENNTS-HANDDLE_DAATA_CHHANGEDDFORGO_GRRID_01100.CALLLMETHHODGOO_GRIDD_01000-SET_TOOLBBAR_INNTERACCTIVE.*CALLLMETTHODGGO_GRIID_01000-REEGISTEER_EDIIT_EVEENT*EXPOORTINGG*I_EVVENT_IID=
13、CCL_GUII_ALV_GRID=MC_EEVT_MOODIFIEED.CAALLMEETHODGO_GRRID_01100-REGIISTER_EDIT_EVENTTEXXPORTIINGI_EEVENT_ID=CL_GUUI_ALVV_GRIDD=MC_EEVT_ENNTER.ENNDIF.8 增加按钮功能项项METHODADD_FFUNCTIION.DATAAL_ENNTRYTTYPESSCTX_EENTRY.L_EENTRY-TYPE=SCTXX_C_TYYPE_FUUNCTIOON.L_EENTRY-FCODEE=FCODDE.L_EENTRY-FTYPEE=FTYPPE.L_EE
14、NTRY-ICON=ICONN.L_EENTRY-TEXT=TEXTT.L_EENTRY-DISABBLED=DISAABLED.L_EENTRY-HIDDEEN=HIDDDEN.L_EENTRY-CHECKKED=CHECCKED.l_eentry-accelleratoor=acceelerattor.*UnuusedfforEnntriessofTTypeFFUNCTIION:CLEARRL_ENNTRY-MENU.IFinssert_aat_thee_topISINNITIALL.*iinserttnewfuncttionaattheeend:APPPENDl_enttryTOOent
15、rrytab.ELSEE.*iinserttnewfuncttionaattheetop:INNSERTl_enttryINNTOenntrytaabINDDEX1.ENDIIF.raisseeveentchhangedd.*.ENDMEETHOD.9 工具函数VRMM创建屏幕下拉框TYPE-POOOLS:vrm.TYPE-POOOLVRRM.*工具基本属性性*TYPESS:*-SSingleeValuueinValueeSetBEGIINOFVRM_VVALUE,KKEY(40)TYPEEC,TTEXT(80)TYPEEC,ENDDOFVVRM_VAALUE,*-TTableofVaalue
16、sVRM_VALUEESTYPPEVRMM_VALUUEOCCCURS00,*-IIdofValueeSetVRM_IDTYYPEVRRM_VALLUE-TEXT,*-ttableofIddsofValueeSetVRM_IDSTTYPEVVRM_IDDOCCUURS0,*-QQueueRRowBBEGINOFVRRM_QUEEUEROWW,TTAG,VVALUETYPEVRM_VVALUE,ENDDOFFVRM_QUEUEEROW,*-QQueueVRM_QUEUEETYPEEVRM_QUEUEEROWOOCCURSS0.CONSTTANTS:VRMM_TYPEE(20)VAALUEappl
17、iicatioon,VRMM_SUBTTYPE(20)VALUEEx-ssapvalluesetts,VRMM_QUEUUE_TAGG_HEADDERVALUEET,VRMM_QUEUUE_TAGG_SUBHHEADERRVALUEEX,VRMM_QUEUUE_TAGG_ENTRRYVALUEE,VRMM_QUEUUE_KEYY_TYPEETYPEEVRM_VALUEE-KEYVVALUETYPEE,VRMM_QUEUUE_KEYY_NAMEETYPEEVRM_VALUEE-KEYVVALUENAMEE.*下拉列表实例 *REPORTYMPSRR102NNOSTAANDARDDPAGEEHEA
18、DDINGMMESSAGGE-IDYMPS.TYPE-POOLSSVRM.定义一个下下拉表屏幕参参数SELEECTIONN-SCREEENBEEGINOOFBLOOCKAWITHFRAMEETITLLETEXXT-001.PARAMMETERSS:P_LISSTTYPPECAASLISSTBOXVISIBBLELEENGTH12.SELECCTION-SCREEENENDDOFBBLOCKA.INITIIALIZAATION.PERFFORMFFRM_INNIT_LIISTBOXX.*&-*&FormFRM_INIT_LISTBBOX*&-*texxt*-*-p1textt*MT_TTOOLB
19、AAR.ENDMMETHODD.hanndle_ttoolbaarMETHHODHAANDLE_UCOMMM.DAATAROOWID_TTTYPEELVC_T_ROWW.DAATATEEMPTYYPELVVC_S_RROW.CAASEE_UCOMMM.WHENNSHOOW.CAALLMEETHODALV_GGRID-GET_SSELECTTED_ROOWSIMPPORTINNGETT_INDEEX_ROWWS=ROWIID_T.IFFSY-SUBRCC=0.PERFOORMGEET_SELLECTEDD_ROW_INFOTABLLESROWWID_T.ENNDIF.ENNDCASEE.ENDM
20、METHODD.hanndle_uucommEENDCLAASS.llcl_evvent_rreceivver*&-*&Forrmgeet_sellectedd_row_info*&-*GGet_seelecteed_roww_infoo*-*-ROWWINFOteext*-*FFORMGGET_SEELECTEED_ROWW_INFOOTABLLESROOWINFOOTYPEELVC_T_ROWW.DATAAROWIID_STTYPELLVC_S_ROW.DATAA:STRTYPEESTRIING,STTEPVAALUE-.LOOPPATRROWINFFOINTTOROWWID_S.REEA
21、DTAABLEIITABIINTOWWAINDDEXROOWID_SS-INDEXX.COONCATEENATEWA-CARRIIDWA-CONNIIDWA-CITYFFROMWWA-CITYTTOINTTOSTRRSEPAARATEDDBYSSTEP.MEESSAGEEI0011(ZMESSS)WITHHSTR.ENDLLOOP.ENDFOORM.gget_seelecteed_roww_infooMODULLESTAATUS_00100OOUTPUTT.IFCONNTAINEERISINITIIAL.CRREATEOBJECCTCONNTAINEEREXPPORTINNGCCONTAIIN
22、ER_NNAME=NAMEE.CRREATEOBJECCTALVV_GRIDDEXPOORTINGGI_PARENNT=CONTTAINERR.CAALLMEETHODALV_GGRID-SET_TTABLE_FOR_FFIRST_DISPLLAYEXXPORTIINGI_STRRUCTURRE_NAMME=SPFFLICCHANGIINGIT_OUUTTAB=ITABB.*CCreateeandseteeventCRREATEOBJECCTEVEENT_REECEIVEER.SEETHANNDLEREVENTT_RECEEIVER-HANDDLE_TOOOLBARRFORALV_GGRID.
23、SEETHANNDLEREVENTT_RECEEIVER-HANDDLE_UCCOMMFFORALLV_GRIID.*SSetinnteracctionCAALLMEETHODALV_GGRID-SET_TTOOLBAAR_INTTERACTTIVE.ENDIIF.ENDMOODULE.SSTATUSS_01000OUTTPUTMOODULEUSER_COMMAAND_01100INNPUT.SAVVE_OK=OK_CCODE.CLEAAROK_CODE.CASEESAVEE_OK.WHHENEEXIT.LEAVVEPROOGRAM.ENDCCASE.ENDMOODULE.UUSER_CCOMMANND_01000INNPUT11. ALVV TREEE动态显示列(更改改弹出菜单)CLASSllcl_evvent_rreceivverDEEFINITTION.PUBLLICSEECTIONN.MEETHODSShanddle_coontextt_menuu_requuestFOREVENTTconttext_mmenu_rrequesstOFcl_guui_alvv_griddIMPOORTINGGe_obbject.ENDCLLASS.LCL_AAPPLICCATIONNDEFIINI