Message Control.docx
《Message Control.docx》由会员分享,可在线阅读,更多相关《Message Control.docx(54页珍藏版)》请在冰豆网上搜索。
MessageControl
MessageControl(CA-GTF-BS)
Purpose
与合作伙伴有关的消息的输出或者后续处理是通过MessageControl自动进行的。
应用程序使用指定的接口,调用MessageControl。
可以使用这些接口来为想要的处理描述不同的数据组合。
如果其中的一个数据组合在执行时出现,相应的处理被执行(同步或异步)。
可以为处理定义多个不同的方法,例如,作为工作流的打印输出,或者IDocdispatchforEDI。
Implementationconsiderations
SD和MM应用总是使用MessageControl来进行消息输出。
执行应用定制中的MessageControl的定制功能。
MessageControl有时也被叫做OutputControl。
Integration
MessageControl是其它应用的一个“serviceprogram”。
它是通过ABAPfunctionmodule执行初始化。
使用MessageControl的应用必须:
1,调用MessageControl
2,TransferfileswhichshouldbecomparedwiththecombinationsdefinedinCustomizing.
3,如果传递的数据和定制功能中定义的数据组合一致,则需提供一个处理程序,用来在MessageControl中进行调用,
Features
SAPSystem中的条件技术是用来制定所需的数据组合。
如果当前的应用数据和定制功能中定义的条件一致,messagedetermination是成功的,并且会创建一个默认消息(建议的消息)。
如果应用支持,也可以改变默认(建议的)的消息(processed)
然后,消息马上执行或者在定义的时间执行。
消息的处理状态存储在一个状态记录中。
如果应用支持,还会有处理日志。
MessageControlscenarios:
●Thecreditlimithasbeenexceededinasalesorder,whereupontheblockindicatorisassigned.TheMessageControlshouldrespondtotheblockindicatorbyprintingoutthiscustomer’saccounthistory.
●Adocumentisreleasedandreceivesacorrespondingstatusinitsdatarecord.TheMessageControlshouldthereuponissueareleasemessage.
Therearealsoapplicationswhichcan"switchoff"messagedeterminationanddirectlygeneratethemessagedefault.
MessageControlandconnectiontotheSAPapplication
FormoreinformationonMessageControlseeMessageControlStructure.
YoudeterminetherulesinCustomizingbywhichthesystemaccessestheindividualconditionrecords.FormoreinformationseeMessageControlCustomizing.
Youdefineconcretemessagesasconditionrecordsintheapplication.Forfurtherinformation,seeDefinemessagesasconditionrecordsintheapplication
If,asadeveloper,youwanttoinstallMessageControlinanapplication,youcanfindadditionalinformationunderMessageControlConnectiontotheApplication.
Constraints
TheMessageControlonlysupportsspecifictransmissionmedia.Formoreinformation,seeTransmissionMedia.
关于messagedetermination
Messagedetermination是一个对象,检查应用数据是否和条件记录匹配。
Anobjectthatcheckswhethertheapplicationdata(forexample,datadeterminedinCustomizing)correspondstotheconditionrecords.
TransmissionMedia
Definition
Thetransmissionmediadeterminethetypeofprocessing.Thefollowingtransmissionmediaareavailable:
1Printoutput
2Fax
4Telex
5Sendingexternallywithacommunicationstrategy
6EDI:
ThepartnermustbedefinedhereasanEDIpartner(see
Partnerprofiles)
7Sendingamail
8Specialfunction
9Workflowevent
ADistribution(ALE)Thepartnerisderivedfromthedistributionmodel
TWorkflowtask
Youcanusethespecialfunctionsforyourownprograms.Forexample,youcouldcallawarehousemanagementsystemviaCPI-C(CommonProgrammingInterface-Communication).
Integration
TableTNAPRcontainsinformationaboutwhichprocessingprogramsshouldbetransferredfortherelevanttransmissionmediumforthedispatchofthemessage.Newprocessingalsorequirescorrespondingentries.
●MessageswhicharetobesentasmailsarelinkedwithaprogramwhichcallstheBusinessCommunicationInterface.
●MessageswhicharetobeprintedorfaxedarelinkedwithaprogramwhichcontainsbothacalltotheprogramwhichdeterminestheprintdataandthenameoftheSAPscriptformtobeused.
●MessageswhicharetobeprocessedviathecommunicationstrategyarelinkedtoaprogramwhichcontainstheIncludeRVADOPFOforevaluationofthisstrategy.
MessageControlStructure
Definition
可以认为是系统中的一个处理逻辑,MessageControl可以被分割成几个部分。
对于配置来说,它包含了所谓的条件元素。
组合的,这就是MessageControlStructure。
Use
应用程序使用MessageControl自动从数据源(partners,companycodes…)产生消息,并且在预定好的时间发送消息(forinstanceinpaperformatorasane-mail)
Structure
ConditionComponentsandConditionRecords
TheindividualobjectsoftheMessageControlwhicharerelevantinthemessagedeterminationprocessandcanbeconfiguredinCustomizingortheapplicationtransactionareexplained.
MessageDetermination
本部分描述的是如何评估条件组件层次,以及如何访问条件表。
不同的场景,在定制条件组件时可以通过特殊的策略来实现,被用作例子。
Thissectiondescribeshowtheconditioncomponenthierarchyisevaluatedandhowtheconditiontablesareaccessed.Differentscenarios,whichcanberealizedbyspecialstrategieswhenCustomizingtheconditioncomponent,areusedasexamples.
MessageDefaultandMessageEditing
Theresultofmessagedeterminationisamessagedefaultthatcanbeeditedmanuallyintheapplication,ifthisfunctionisavailableintheapplication.Ifnot,anymessagesfoundareforwardeddirectlyforautomaticprocessing.
messagedetermination的结果是一个默认的消息,在应用中,它可以被手动编辑,如果这个功能在应用中可用。
如果不可用,任何发现的消息都被直接转到自动处理。
MessageProcessing
这节介绍找到的消息怎么被执行。
Integration
RequirementsforApplications
TheMessageControlisaddressedbyapplicationprogramsviaadefinedinterface.Thissectionexplainsthevariousfunctionswhichmustbeavailabletotheapplication.
ConditionComponentsandConditionRecords
Definition
ThetoolthatMessageControlusesformessagedeterminationiswellknowninotherapplications(forexamplepricedeterminationandaccountdeterminationinSD):
conditiontechnique.Theconditiontechniqueusesconditioncomponentsthatdeterminewithwhichmethodandwithwhichapplicationdatathemessageissearchedfor.Thefollowingtwodiagramsshowthehierarchyfortheconditioncomponents。
ConditionComponents:
SampleHierarchy
ConditionComponents:
GeneralHierarchy
Structure
Theindividualconditionelementsare:
ApplicationCode
FieldCatalogforConditionKeys
Procedure
OutputType
AccessSequence
ConditionTable
ConditionAccess
ConditionComponents:
SampleHierarchy
ConditionComponents:
GeneralHierarchy
ApplicationCode
Definition
AnapplicationcodeisassignedtoeachindividualapplicationwhichusesMessageControl(forexampleEFfor‘Purchasing’,V1for‘Sales’,MRfor‘InvoiceVerification’).
每个使用MessageControl的独立应用都分配有一个应用码。
Use
IfanapplicationcallsMessageControl,theapplicationcodeisgivenfirstandtheapplicationcanthereforebeidentified.Thecurrentapplicationdataistransferredincommunicationstructures.
如果应用调用MessageControl,应用码首先被给出,然后应用可以被识别。
当前应用数据被传输到通信结构中。
FieldCatalogforConditionKeys
Definition
ThefieldcatalogcontainsallfieldsthatcanbeselectedaskeysforMessageControlconditiontables.Oneapplicationfilterperapplicationiscreatedfromthisfieldcatalog.Thisfilterdetermineswhichfieldscanbeselectedfortherelevantapplication(forexampleV1for"Sales").
Fieldcatalog包含了所有的字段,对于MessageControl条件表,它们可以被作为key。
每个应用的应用过滤器都是从这个fieldcatalog中创建的。
这个过滤决定了,对于相关的应用,哪些字段可以被选择。
Use
Definingtheconditiontable
WhenCreateConditionTableyouselectthekeyfieldsfromthe"applicationfiltered"fieldcatalogwhichshouldbeusedinmessagedeterminationfortableaccess.
Definingtheapplicationfilter
Inordertodefineorextendtheapplicationfilter,maintainCustomizingtableT681F:
Use,forexample,transactionNACE(expertmode)andchooseEdit→FieldCatalog.Selectnewfieldsfromthecommunicationstructuresforyourapplication.
为了定义或者扩展应用过滤器,维护定制表T681F:
使用NACE(专家模式),选择编辑-〉字段目录。
从通信结构中为你的应用选择新的字段。
Extendfieldcatalog
Ifyouwanttodefineaconditionfieldforyourapplicationthatdoesnotyetexistinthefieldcatalog,thenbeforegenerationoftheconditiontablesortheaccesssequencesyoumustextendthefieldcatalog(validforallapplications).
如果想为应用定义一个条件字段,但是这个字段在字段目录中尚不存在,那么在条件表或者访问顺序产生之前,必须扩展字段目录(对于所有应用都有效)
ThefieldcatalogforthemessagedeterminationhasthestructureKOMB.ThisnameisstoredintableT681V.Theusesoftheconditiontechnique(pricing,messagedetermination,etc.)andtheirattributesaremanagedhere.Everyuseoftheconditiontechniquehasitsownfieldcatalog.
Procedure
Definition
Aprocedure(forexampleV10000)isapoolofoutputtypes(forexampleinquiryoutputs,orderoutputs;anoutputtypeisalsocalleda"conditiontype").
过程(例如V10000)是一个输出类型池(例如:
查询输出,订单输出;输出类型也叫做条件类型)
Anapplicationdeterminesoneprocedurefromthecurrentdocumenttype,whichittransferstomessagedetermination.Aprocedureisthereforeacollectionofoutputtypesfromanapplicationperspective.
从传递给messagedetermination的当前document类型,应用决定了一个过程。
因此,从应用的角度看,过程是一个输出类型的集合。
Use
在定制时,分配输出类型到过程。
InCustomizingyouallocateoutputtypestotheprocedure.FormoreinformationseeDefiningtheProcedure
Integration
在条件组件层级中,过程是最高的元素。
无论何时过程被调用,所有的输出类型(下个层级level)都要被搜索。
Theprocedureisthehighestelementintheconditioncomponenthierarchy.Wheneveraprocedureiscalled,alloutputtypes(nexthierarchylevel)aresearchedfor.
ConditionComponents:
SampleHierarchy
DefiningtheProcedure
1,从下边的2个中任选一个:
1)在有关的应用中,从定制中选择合适的活动
2)使用事物:
NACE,以下将描述这种。
2,选择应用,然后选择Edit-〉Procedures
3,在编辑模式,选择Edit-〉Newentries。
在Control中,分配过程的输出类型
4,对于输出类型,可以使用ABAP条件作为退出关键字。
在事物:
V/27中定义新的条件。
如果条件满足,那么系统不再搜索这种输出类型的消息。
YoucanalsodefineconditionsinDefiningAccessSequences
5,保存修改。
下图显示的是:
过程V10000是为订单消息生命的。
应用定制定义了过程何时被应用。
下图显示的是:
在过程V10000中声明的输出类型。
SubsequentexplanationswillconcernoutputtypeBA00(orderconfirmation)。
在过程定义的计数器不影响messagedetermination,因为过程总是作为整体来处理的。
在上面的例子中,条件2代表:
销售凭证必须检查完整性。
只有当凭证完整时才生成消息。
●通过V/27可以查看条件2的代码
Thecodeis:
1form_kobed_002.
2*FallsVerkaufsbelegvollständigist,sollNachrichterzeugtwerden
3sy-subrc=0.
4ifkomkbv1-uvallne'C'.
5sy-subrc=4.
6exit.
7endif.
8ifkomkbv1-costanespaceand
9komkbv1-costane'C'.
10sy-subrc=4.
11exit.
12endif.
13ifnotkomkbv1-lifskisinitial.
14ifkomkbv1-lifsknetvls-lifsp.
15selectsingle*fromtvlswherelifsp=komkbv1-lifsk.
16endif.
17i