EDIEDI原理与实现培训原理与实现培训SAP方案架构部2009.05ElectronicCommerceElectronicCommerceDocumentSAPSystemR/3SAPSystemR/3IDocEDISubsystemEDISubsystemTransactionMessageIDocIDocSM59SM59:建立:建立RFCRFC连接配置连接配置WE21WE21:建立:建立RFCRFC的连接端口的连接端口WE41WE41:处理出站代码与信息类型关联:处理出站代码与信息类型关联WE42WE42:处理进站代码与信息类型关联:处理进站代码与信息类型关联WE20WE20:建立合作伙伴参数:建立合作伙伴参数IDOCIDOC的三个部分的三个部分StatusRecordIDoc-IDStatusinformationDataRecordIDoc-IDSequence/HierarchySegmentFormatdefinitionfor•headerdata•itemdataControlRecordIDoc-IDSender-IDReceiver-IDIDoctypeandlogicalmessageExternalstructureWE31WE31建立建立SEGMENTSEGMENTWE30WE30建立建立IDOCIDOC(数据结构)(数据结构)WE81WE81建立信息类型(处理的事务)建立信息类型(处理的事务)WE82WE82建立信息类型和建立信息类型和IDOCIDOC类型关联系类型关联系SE37SE37建立建立FunctionModuleFunctionModuleBD51BD51将将FunctionModuleFunctionModule注册为注册为InboundInbound程序程序WE57WE57建立建立FunctionModuleFunctionModule和和IDOC\IDOC\消消息类型关联息类型关联OutboundDataFlowOutboundDataFlowIDocNASTRecordDocumentDocumentSAPApplicationMessageControl(表:NAST)System2,e.g.EDIsubsystemIDocInterface&ALEServicesMessageControlMessageControlSAPApplicationProcessingApplicationdataMessageproposalNAST-RecordOutput,e.g.asIDocOutputDeterminationProcessingPrograme.g.RSNASTEDProcessingacc/TNAPRCurrentvaluesofaSAPdocumentarepassedwiththecommunicationstructuretotheoutputdetermination,wherethesevaluesarecheckedagainstconditiontables.Thechecksagainstconditiontablesaredefinedbytheaccesssequence.Anumberofconditiontablescanbecheckedinline(inclusive)oruptothefirsthit(exclusive).Ahitmeansthatareadofaconditiontable,wherebythekeyfieldsarefilledwiththevaluesofthecommunicationstructure,wassuccessful.TheformattingprogramismaintainedintableTNAPR.IncaseofEDI(communicationmediumis„6“)itisthemodule„EDI_PROCESSING"ofprogramRSNASTED.Thismoduleretainstheoriginalpartnertype,e.g.„KU“forcustomerand„LI“forvendor,andthepartnernumber,i.e.SAPkey.IncaseofALE(communicationmediumis„A")itisthemodule„ALE_PROCESSING"ofprogramRSNASTED.Thismodulemapstheoriginalpartnertypetologicalsystem„LS“andpartnernumbertothelogicalsystemID.MessageControl-CallSequenceMessageControl-CallSequenceSAPApplicationscommunicationstructuresmessagedefaultoutputdeterminationmessagetriggerandmessagestatusMessageControltableTNAPRformattingprogram...printoutfaxALEEDIE-mail...conditiontablesconditionelementevaluatepasssuggestrelationwritestatusprocesscallMessageControl-EDIrelatedMessageControl-EDIrelated„1“/„2“SingleIDocTransferaccordingtooutputmodeBatchofIDocsbyRSEOUT00„3“/„4“RSNASTEDCallALEServiceCallSelectionModule(application)ReadPartnerProfileCheckNAST-ReordBythecommunicationmediumintheapplicationisdeterminedthechannelforoutput.Medium„6“and„A“assigntotheIDocinterface.„6“EDI(ElectronicDataInterchang),i.e.w/odistributionmodel„A“ALE(ApplicationLinkEnabling),i.e.w/distributionmodelTheprogramRSNASTEDofferstheform-routinesEDI_PROCESSINGandALE_PROCESSING.BothmaintainedintableTNAPR.Withoutputmodes(fieldOUTMODintheControlRecord)„1“and„2“asingleIDocispassedtotheothersystem,e.g.EDIsubsystem.Thistransmissionisdoneinthe„formatting“programRSNASTED.Withoutputmodes(fieldOUTMODintheControlRecord)„3“and„4“abatc...