SAP 开发 SD 相关的增强BADI_第1页
SAP 开发 SD 相关的增强BADI_第2页
SAP 开发 SD 相关的增强BADI_第3页
SAP 开发 SD 相关的增强BADI_第4页
SAP 开发 SD 相关的增强BADI_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

资料范本本资料为word版本,可以直接编辑和打印,感谢您的下载SAP开发SD相关的增强BADI地点: 时间: 说明:本资料适用于约定双方经过谈判,协商而共同承认,共同遵守的责任与义务,仅供参考,文档可直接下载或修改,不需要的部分可直接删除,使用时请详细阅读内容SD相关的BADIsap的用户出口总共有三代:1、 第一代sap提供一个空代码的子过程,在这个子过程中用户可以添加自己的代码,控制自己的需求。这类增强都需要修改sap的标准代码。示例:USEREXIT..inSAPMV45A2、 第二代sap提供的是CUSTOMER-FUNCTION,它是通过SMOD和CMOD完成实现。参见我的/CompassButton/archive/2006/08/31/1150258.aspx"/CompassButton/archive/2006/08/31/1150258.aspx"/CompassButton/archive/2006/08/31/1150258.aspx3、 第三代sap提供的第三代的用户出口就是BADI,他的调用方式是CALLMETHOD(instance),(相关的TCODE是SE18和SE19),你可以通过EXIT_HANDLER这个单词查找BADI。另外还有一种出口叫BTE相关TCODE:FIBFBusinessTransactionEvents(OpenFI)TheOpenFIenhancementtechniquewasdevelopedintheFinancialAccountingcomponent.OpenFIisbaseduponthefollowingprinciples:Applicationdevelopersmustdefinetheirinterfaceinafunctionmodule,anassignmenttableisreadintheaccompanying(generated)code,andthecustomermodulesassignedarecalleddynamically.Thistechniquedifferentiatesbetweenenhancementsthatareonlyallowedtohaveoneimplementationandenhancementsthatcancallmultipleimplementationsinanysequencedesired.Bothindustryspecificandcountry-specificenhancementsmaybedefined.TheconceptsbehindtheBusinessAdd-InsenhancementtechniqueandOpenFIarebasicallythesame.However,thetwoenhancementtechniquesdodifferfromeachotherinthefollowingpoints:OpenFIcanonlybeusedtomakeprogramenhancements,thatis,youcanonlyenhancesourcecodeusingOpenFI.YoucannotenhanceuserinterfaceelementswithOpenFIlikeyoucanwithBusinessAddIns.OpenFIassumesthatenhancementwillonlytakeplaceonthreelevels(SAP-partners-customers),whereaswithBusinessAdd-Insyoucancreateandimplementenhancementsinasmanysoftwarelayersasyoulike.OpenFIusesfunctionmodulesforprogramenhancements.WithBusinessAdd-Ins,ABAPObjectsisusedtoenhanceprograms./CompassButton/archive/2006/08/31/1150258.aspx"/CompassButton/archive/2006/08/31/1150258.aspx"如何使用SMOD和CMOD进行SD的用户增强1、关于增强的简单介绍SMOD包含具体的增强,而CMOD是包含一组SMOD编写的增强.Userexits(Functionmoduleexits)是sap提供出口,它的命名规则如下:EXIT_<programname><3digitsuffix>示例:sd的VA01事务,对应的程序是SAPMV45A,你会在程序里查到(用CALLCUSTOMER-FUNCTION字符串)如下代码:CALLCUSTOMER-FUNCTION'003'exportingxvbak = vbakxvbuk = vbukxkomk = tkomkimportinglvf_subrc=lvf_subrctablesxvbfa=xvbfaxvbap=xvbapxvbup=xvbup.则exitcallsfunctionmodule的名称就是:EXIT_SAPMV45A_0032、 先试用SMOD建立一个SAP增强2.1、 选择一个增强,如:SDVFX001,点击修改,进入sap增强维护屏幕;2.2、 点击“组件”按钮,进入组件维护屏;2.3、 将光标移到“功能模块名”,输入模块名,如:EXIT_SAPLV60B_001;2.4、 选择“代码修改”按钮进入函数模块;2.5、 双击函数模块的包含单元,进入包含单元加入自定义代码并激活保存;3、 使用CMOD建立增强项目3.1、 输入自定义的项目名,点击“创建”;3.2、 进入增强项目,选择“配置增强”,进入增强配置屏幕;3.3、 输入增强名如:SDVFX0013.4、保存,并退出;4、使用CMOD将增强项目激活,便大工告成。如何查找*判断是否存在相应增强的定义(SMOD)selectsinglenamefrommodsapaintomod0-namewherename='PPCO0002'.ifsy-subrc=0.endif.selectsingle*fromtadirintops_tadir_dbwherepgmid ='R3TR'andobject ='SMOD'andobj_name= 'PPCO0002'.*判断是否存在相应增强项目的定义(CMOD)SELECTSINGLEnameFROMMODATTRintomod0-nameWHERENAME='PPCO0002'..*提取增强的定义的组件(可以用此反查增强定义)select*frommodsapwherename='PPCO0002'.*判断该增强是否移植到BADI实现*Enhancement&hasalreadybeenmigratedinBusinessAdd-Indefinitionselectsinglemigratedbadi_def into(migrated,exit_name)frommodsapawherename=modname.ifsy-subrc=0andmigrated=seex_true.messages621withmodnameexit_name.checkmodene'CHAM'.endif.MODTYP类型:E:功能退出S:屏幕T:表C:GUI代码sap增强存在MODSAP表内*获取增强组件的参见函数MOD_SAP_MEMBER_TEXT*获得退出功能模块的信息selectsingle*fromtftitwhere"SPRAS"='1'AND"FUNCNAME"='EXIT_SAPLCORE_001ifsy-subrc=0.endif.*值得学习的函数MOD_KUN_ACTIVATE(会操作相关报表)/CompassButton/archive/2006/09/16/1231652.aspx"/CompassButton/archive/2006/09/16/1231652.aspx"如何从SAP中查找BADIBADI作为SAP的第三代用户出口,他的应用也越来越广泛,但如何找到合适的badi是许多abap程序员的困惑。我这里就介绍一下我个人的应用的经验,供大家参考。1、badi对象的信息存储在SXS_INTER,SXC_EXIT,SXC_CLASS和SXC_ATTR这四个表中(参见SECE包);2、 sap程序都会调用cl_exithandler=>get_instance来判断对象是否存在,并返回实例;其实get_instance就是对上述几个表和他们的视图(V_EXT_IMP和V_EXT_ACT)进行查询和搜索。3、 基于这个机理,我查用ST05来监控一个TCODE来跟踪,然后选择查找有关上述几个表和视图的操作,就可获得相关BADI。4、 se18查找接口,se19实现接口就可以实现用户增强。示例:用LE_SHP_DELIVERY_PROC控制跨月CancelMETHODIFEXLESHPDELIVERYPROC~CHANGEDELIVERYHEADER. data:thismonth(2)typec.data:wa_likptypelineofSHP_LIKP_T.data:wa_logtypelineofSHP_BADI_ERROR_LOG_T.clearct_log[],thismonth.thismonth=sy-datum+4(2)." >逼一彳固月的月份loopatit_xlikpintowa_likp.checkIS_V50AGL-WARENAUSG_STORNO='X'.〃--->代表作GIcancelifwa_likp-WADAT_IST+4(2)<thismonth.wa_log-VBELN=cs_likp-vbeln.wa_log-MSGTY='E'.〃金昔森^息wa_log-MSGID='ZDN_ERROR'.〃是一固class要自己建wa_log-MSGNO='001'.appendwa_logtoct_log."ErrorlogWAendif.endloop.ENDMETHOD./CompassButton/archive/2007/03/19/1533453.aspx"/CompassButton/archive/2007/03/19/1533453.aspx"如何实现标准TCODE的屏幕增强(HOWTO:ImplementascreenexittoastandardSAPtransaction)IntroductionSAPprovidesstandardtransactionstoenterdataintodatabase.ButaclientmaywanttomaintainsomeadditionalinformationinSAPotherthanwhatisprovided.Tomakeprovisionsforthis,additionalscreenshavetobeprovidedandadditionalfieldsmustbeaddedintoappropriatedatabasetable.Topavewayforthis,SAPhasprovidedtheoptionforscreenexits.Usually,SAPprovidesthefollowing:Anappendstructureinthedatabasetablewiththenewfields.Asubscreenareaintothestandardscreen-wheretheprogrammercanattachhissubscreenofhisownprogramwiththenewfields.Afunctiongroupunderwhichthenewsubscreenhastobecreatedwiththenewfields.FunctionexitstosynchronizethePBOandPAIofthestandardSAPprogramwiththePBOandPAIofthesubscreen-sothatdatacanflowbackandforthbetweenthestandardSAPprogramandtheprogramwrittenbythedeveloperforthesubscreen.Thesefunctionmodulesalsoexistinthesamefunctiongroupunderwhichthesubscreenwillhavetobedeveloped.Finally,alinkagehastobedonebetweenthesubscreenareaofstandardSAPscreenwiththecustomsubscreenconstructedbythedeveloper.Typically,SAPprovidesanenhancementinwhichthedevelopercancreateanappendstructure,usethefunctionexitstosynchronizethePBOandPAIofthestandardSAPprogramandthecustomsubscreenprogram,andmakethenecessarylinking(asmentionedaboveinstep4.But,again,thisisnotahardandfastrule.Linkinginsomecase,isalsodonebyconfigurations.)SAPalsousuallyprovidesthenameofthefunctiongroupunderwhichthesubscreenhastobedeveloped.NecessaryguidanceaboutimplementingascreenexitdevelopmentisusuallyavailableintheDocumentationsectionoftheenhancement(canbeavailedbytransactionSMOD).Pre-RequisitesThedevelopertoworkonscreenexitshouldhaveessentialknowledgeonthefollowing:DDICconcepts,includingtheknowledgeofappendstructure.ConceptofSAPEnhancementsandimplementingthemusingProjects.Conceptoffunctionexits.KnowledgeonModulePool-includingsubscreens,Tabstripcontrolsetc.StepsGuidelinesSo,adevelopercanfollowtheguidelinesmentionedbelowtoimplementascreenexittoastandardSAPtransaction,asandwhenrequired:FindouttheRequiredEnhancementsGotoSMOD.PressF4intheEnhancementfield.Inthenextpopupwindow,clickpushbutton‘SAPApplications'.Alistwillappearthatcontainsinformationonalltheenhancements,categorizedunderfunctionalareas.Developermustsearchfortheenhancementsrelevanttohisfunctionalareaofinterest-fore.g.,Purchasing,AssetAccounting,etc.Notedowntheenhancements.Then,cometotheinitialscreenofSMODandviewthedocumentationofeachenhancementtofindoutwhichoneisrequiredforyourdevelopment.UtilizetheEnhancementinaProjectAfteryouhavefoundone,d

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论