Documente Academic
Documente Profesional
Documente Cultură
Users Guide
webMethods, Inc. South Tower 3877 Fairfax Ridge Road Fairfax, VA 22030 USA 703.460.2500 http://www.webmethods.com
webMethodsAccess,webMethodsAdministrator,webMethodsBroker,webMethodsDashboard,webMethodsDeveloper,webMethodsFabric,webMethods Glue,webMethodsInstaller,webMethodsIntegrationServer,webMethodsMainframe,webMethodsManager,webMethodsModeler,webMethodsMonitor, webMethodsOptimize,webMethodsPortal,webMethodsServicenet,webMethodsTradingNetworks,andwebMethodsWorkflowaretrademarksof webMethods,Inc.webMethodsandthewebMethodslogoareregisteredtrademarksofwebMethods,Inc. AcrobatandAdobeareregisteredtrademarks,andReaderisatrademarkofAdobeSystemsIncorporated.Amdocsisaregisteredtrademark,andClarifyCRM isatrademarkofAmdocs.AribaisaregisteredtrademarkofAriba,Inc.BEA,BEAWebLogicServer,Jolt,andTuxedoareregisteredtrademarks,andBEA WebLogicPlatformisatrademarkofBEASystems,Inc.ActionRequestSystem,BMCSoftware,PATROL,andRemedyareregisteredtrademarksofBMC Software,Inc.BroadVisionisaregisteredtrademarkofBroadVision,Inc.ChemeStandardsandCIDXaretrademarksofChemicalIndustryDataExchange. UnicenterisaregisteredtrademarkofComputerAssociatesInternational,Inc.PopChartisaregisteredtrademarkofCORDATechnologies,Inc.Kenanand ArborareregisteredtrademarksofCSGSystems,Inc.DataConnectionandSNAPIXareregisteredtrademarksofDataConnectionCorporation.DataDirect, DataDirectConnect,andSequeLinkareregisteredtrademarksofDataDirectTechnologies.D&BandDUNSareregisteredtrademarksofDun&Bradstreet Corporation.EntrustisaregisteredtrademarkofEntrust,Inc.papiNetisaregisteredtrademarkoftheEuropeanUnionandtheUnitedStates.Financial InformationeXchange,F.I.X,andF.I.XProtocolaretrademarksofFIXProtocolLtd.UCCnetandeBusinessReadyareregisteredtrademarks,and1SYNCand TransoraaretrademarksofGS1US.HewlettPackard,HP,HPUX,OpenView,PARISC,andSNAplus2aretrademarksofHewlettPackardCompany.i2isa registeredtrademarkofi2Technologies,Inc.AIX,AS/400,CICS,DB2,Domino,IBM,Informix,Infoprint,Lotus,LotusNotes,MQSeries,OS/390,OS/400, RACF,RS/6000,SQL/400,S/390,System/390,VTAM,z/OS,andWebSphereareregisteredtrademarks;andCommunicationsSystemforWindowsNT,DB2 UniversalDatabase,IMS,MVS,andSQL/DSaretrademarksofIBMCorporation.InnoDBisatrademarkofInnobaseOy.Itaniumisaregisteredtrademarkof IntelCorporation.JBossisaregisteredtrademark,andJBossGroupisatrademarkofJboss,Inc.LinuxisaregisteredtrademarkofLinusTorvalds.W3Cisa registeredtrademark,andXWindowSystemisatrademarkoftheMassachusettsInstituteofTechnology.MetaSolvisaregisteredtrademarkofMetasolv Software,Inc.ActiveX,Microsoft,Outlook,VisualBasic,Windows,andWindowsNTareregisteredtrademarks;andWindowsServerisatrademarkof MicrosoftCorporation.SixSigmaisaregisteredtrademarkofMotorola,Inc.Firefoxisaregisteredtrademark,andMozillaisatrademarkoftheMozilla Foundation.MySQLisaregisteredtrademarkofMySQLAB.nCipherisatrademarkofnCipherCorporationLtd.TeradataisaregisteredtrademarkofNCR International,Inc.NetscapeisaregisteredtrademarkofNetscapeCommunicationsCorporation.ServletExecisaregisteredtrademark,andNewAtlantaisa trademarkofNewAtlantaCommunications,LLC.SUSEisaregisteredtrademarkofNovell,Inc.AppiaisaregisteredtrademarkandJavelinTechnologiesis atrademarkofNYFIX,Inc.CORBAisaregisteredtrademarkofObjectManagementGroup,Inc.JDEdwards,OneWorld,Oracle,PeopleSoft,Siebel,and Vantiveareregisteredtrademarks,andPeopleSoftPureInternetArchitectureandWorldSoftwarearetrademarksofOracleCorporation.InfranetandPortal aretrademarksofPortalSoftware,Inc.RedHatisaregisteredtrademarkofRedHat,Inc.PIPandRosettaNetaretrademarksofRosettaNet,anonprofit organization.SAPandR/3areregisteredtrademarksofSAPAG.SWIFTandSWIFTNetareregisteredtrademarksofSocietyforWorldwideInterbank FinancialTelecommunicationSCRL.SPARCandSPARCStationareregisteredtrademarksofSPARCInternational,Inc.SSAisaregisteredtrademark,and BaanandSSAGlobalaretrademarksofSSAGlobalTechnologies,Inc.EJB,EnterpriseJavaBeans,Java,JavaServer,JDBC,JSP,J2EE,Solaris,Sun,andSun Microsystemsareregisteredtrademarks;andJavaNamingandDirectoryInterface,SOAPwithAttachmentsAPIforJava,JavaServerPages,andSunSoftare trademarksofSunMicrosystems,Inc.SybaseisaregisteredtrademarkofSybase,Inc.VERITASisaregisteredtrademark,andVERITASClusterServerisa trademarkofSymantecCorporation.UNIXisaregisteredtrademarkofTheOpenGroup.UnicodeisatrademarkofUnicode,Inc.VeriSignisaregistered trademarkofVerisign,Inc. Allothermarksarethepropertyoftheirrespectiveowners. Copyright2006bywebMethods,Inc.Allrightsreserved,includingtherightofreproductioninwholeorinpartinanyform. Document ID: ADAPTER-SAP-UG-65SP1-20061006
Contents
About This Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Document Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SAP System Screens and Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13
13 14 15 15
17
18 19 19 20 20 21 21 21 22 22 22 22 23 23 25 26 28 28 29 29 29 30 30 30 31 31 31 32 32
Contents
Considerations When Installing SAP Adapter Packages . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Considerations When Configuring Connections with Connection Pooling Enabled . . . . . . 53 Considerations about SAP Adapter Centralized Transaction Store . . . . . . . . . . . . . . . . . . 53
55
56 56 56 62 62 63 64 64 65 66 66 67 67 68 68 68 69 69 70 71 71 72
73
74 74 75 75 76 77
79
80 80 81 81
Contents
Action Equals 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Action Equals 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating an RFC Destination on an SAP System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Before you Configure New Listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring an RFC Listener . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Enabling Listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Testing the RFC Listener . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Viewing Listener Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing Listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Copying Listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deleting Listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Suspending Listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Disabling Listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Before You Configure Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Dependencies for Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RFC Listener Notification (Synchronous) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ALE Listener Notification (Synchronous) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing Synchronous Listener Notification Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RFC Listener Notification (Asynchronous) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ALE Listener Notification (Asynchronous) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Enabling Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Testing Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Testing Publishable Document Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Viewing Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deleting Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Disabling Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a Synchronous RFC Adapter Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a Function Module in an SAP System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating an RFC Adapter Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Testing the Product Retrieval Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a Synchronous ALE Listener Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Create an Empty Flow Service Called mapOrders02 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Create an Asynchronous ALE Listener Notification for IDoc Type Orders02 . . . . . . . . . . . Define the Input and Output Signatures for the mapOrders02 Service . . . . . . . . . . . . . . . . Map Fields from Orders02RequestDocument to PurchaseOrder Document . . . . . . . . . . .
82 83 84 87 87 87 91 92 93 94 95 96 96 97 97 97 98 99 99 101 103 103 105 106 106 107 107 108 109 109 110 110 110 111 113 114 115 115 116 116
Testing the Listener Notification from the SAP System . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 Setting Up the SAP System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Contents
RFC Based XML Messages Using IFR Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Posting RFCs via FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Posting RFCs in an E-mail Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Routing BAPIs Through the SAP Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting Up a Routing Notification and the BAPI Transport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Posting BAPI-based XML IFR-Compatible XML Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . Transaction Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BAPI XML Transaction Commit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Synchronous Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Asynchronous Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Routing IDocs Through the SAP Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Posting an IDoc-XML Document from an HTTP Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Posting an IDoc via FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Posting an IDoc in an E-mail Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Posting an IDoc from a Web Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Transmitting IDocs between Two Integration Servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mapping IDocs to Other Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating an Empty Flow Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating the Routing Notification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating a Document Type for Your IDoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Transforming the IDoc to a Hierarchical Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mapping IDoc Information to Pipeline Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Testing the Mapping Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Content-Based Routing and Mapping for IDocs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Routing Arbitrary XML Documents Through the SAP Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
150 150 150 150 150 151 152 152 153 153 154 155 157 157 158 158 158 159 159 160 160 160 161 161 163 164 166
Preparation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Further Setup in the SAP Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Status Update Via SYSTAT IDoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setup the participating SAP Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Prepare the Integration Server for Automatic SYSTAT IDoc . . . . . . . . . . . . . . . . . . . . . . . . Centralized Transaction Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring a Centralized Transaction Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Viewing Centralized Store Configuration and Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Removing the Configuration of a Centralized Transaction Store . . . . . . . . . . . . . . . . . . . . . . . .
177 178 179 179 179 180 181 182 185 186
Contents
10
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
11
Contents
12
Related Documentation
Thefollowingdocumentsarecompanionstothisguide.SomedocumentsareinPDF formatandothersareinHTML. Refer to this book... webMethods IntegrationServer AdministratorsGuide For... InformationaboutusingtheServerAdministratorto configure,monitor,andcontrolthewebMethodsIntegration Server.Thisbookisforserveradministrators. Youwillfindthisbookat: webMethods_directory\IntegrationServer\doc\Integration ServerAdminGuide.pdf webMethodsDeveloper UsersGuide Informationaboutcreatingandtestingservicesandclient applications.Thisbookisforapplicationdevelopers. Youwillfindthisbookat: webMethods_directory\Developer\doc\DeveloperUsers Guide.pdf webMethodsDeveloper OnlineReference InformationaboutthecontrolsintheDeveloperapplication windowsandstepbystepproceduresdescribinghowto performtaskswiththeDeveloper. YoucanaccesstheonlinereferencebyclickingHelpinan applicationwindowordialogbox.
13
SerializationofABAP datainXML
XMLFormat Specifications
Document Conventions
Convention Bold Italic Description Identifieselementsonascreen. Identifiesvariableinformationthatyoumustsupplyorchangebased onyourspecificsituationorenvironment.Identifiestermsthefirst timetheyaredefinedintext.Alsoidentifiesserviceinputandoutput variables. IdentifiesstoragelocationsforservicesonthewebMethodsIntegration Serverusingtheconventionfolder.subfolder:service. Identifiescharactersandvaluesthatyoumusttypeexactlyor messagesthatthesystemdisplaysontheconsole.
Narrow font
Typewriter font
14
Convention UPPERCASE \ []
Additional Information
ThewebMethodsAdvantageWebsiteathttp://advantage.webmethods.comprovidesyou withimportantsourcesofinformationaboutthewebMethodsIntegrationPlatform: Troubleshooting Information.webMethodsprovidestroubleshootinginformationfor manywebMethodscomponentsinthewebMethodsKnowledgeBase. Documentation Feedback.ToprovidedocumentationfeedbacktowebMethods,gotothe DocumentationFeedbackFormonthewebMethodsBookshelf. Additional Documentation.AllwebMethodsdocumentationisavailableonthe webMethodsBookshelf.
15
16
CHAPTER
17
18
Functional Highlights
Functional Highlights
SynchronousandAsynchronousCommunicationwithSAPsystemsviaRFCand tRFC BidirectionalcommunicationtoandfromSAPsystems HigherlevelservicestoprocessSAPIDocsandBAPIs EasyXMLandInternetenablingofexistingSAPreleases SupportofBizTalkXMLenvelopesforBAPIandRFCcalls SupportofunifiederrorhandlingofBAPIsandRFCsonXMLlevel
19
20
Functional Highlights
Support of Unified Error Handling of BAPIs and RFCs on the XML Level
Toallowgenericerrorevaluationsontheclient,regardlessoftheinterfacetype(BAPI, RFC)used,thebXMLformatunifiestheerrorhandlingofBAPIsandRFCs.Inthisway, interfacetypespecificerrorhandlingconcepts(BAPIreturnparameterandfunction moduleexceptions)areconvertedonanXMLlevelintoastandardizedtypeoferror representation.
21
Transaction Store
TheTransactionStoreisusedtostorethetransactionstatusinformationlocally.TheSAP Adapterprovidesapersistenttransactionstorethatthetransactionmanagerusestotrack allIDocsandalltRFCcallsroutedtoandfromSAPsystemsviathewebMethods IntegrationServer.Formoreinformation,seeManagingTransactionsandthe TransactionStoreonpage 170.
22
tRFC protocol
RFC
23
Description CommunicationsmethodthattheSAPsystemusesto synchronouslyandasynchronouslyinvokeafunctionona remotesystem,andaremotesystemusestosynchronously andasynchronouslyinvokeafunctionontheSAPsystem. IntegrationServerfunctionsthatarenamedwitha hierarchicalfolder/servicesyntax.Servicescanbeflow, Java,orC/C++developedbyyou,thirdpartyvendors,or webMethods. CodelibraryprovidedbySAPallowingthirdpartiesto integratetheRFCprotocolintoapplications.Thisishow theSAPAdaptercommunicateswiththeSAPsystem. EDIlikeSAPbusinessdocument. Aprocessthatacceptsmessagesandroutesthemtoa configuredlocation,forexample,messagescanberouted toanSAPsystem,anotherIntegrationServer,oraremote URLinanXMLformat. Note: Ifyouneedtousearoutinglistener,youdonotneed tocreateone.TheSAPAdapterincludesapreconfigured routinglistenercalledwm.sap.internal.ls:routingListener. Formoreinformationabouttheroutinglistener,see Overviewonpage 129.
Service
LIBRFC
24
ThefollowingillustratesthecomponentsinasystemthatusestheSAPAdapter:
Architecture and Components
25
26
27
Adapter Connections
AnadapterconnectionenablesanSAPAdapterservicetoconnecttoanSAPsystem. TheadaptersupportsanRFCtypeofadapterconnection.Forinstructionsforconfiguring, viewing,editing,enabling,anddisablingSAPAdapterconnections,seeChapter 4, AdapterConnections.Forinformationaboutsettinguserprivileges,seethewebMethods IntegrationServerAdministratorsGuide. Foralistoftasksthatyoumustdobeforeyoucancreateyourconnections,seeBefore ConfiguringorManagingAdapterConnectionsonpage 56.
28
Adapter Connections
Connection Pools
TheIntegrationServerincludesaconnectionmanagementservicethatdynamically managesconnectionsandconnectionpoolsbasedonconfigurationsettingsthatyou specifyfortheconnection.Bydefault,connectionpoolingisenabledforalladapter connections. Aconnectionpoolisacollectionofconnectionswiththesamesetofattributes.The IntegrationServermaintainsconnectionpoolsinmemory.Connectionpoolsimprove performancebyenablingadapterservicestoreuseopenconnectionsinsteadofopening newconnections.
29
Adapter Services
Adapterservicesallowyoutoconnecttotheadaptersresource(thatis,anSAPsystem) andinitiateanoperationontheresourcefromtheIntegrationServer.Youcalladapter servicesfromafloworJavaservicetointeractwithfunctionmodulesonanSAPsystem. Atdesigntime,theadapterobtainsinformationabouttheSAPdocumentontheSAP system.YouconfigureadapterservicesusingthetemplatesprovidedwiththeSAP Adapter.Eachtemplaterepresentsaspecifictechniquefordoingworkonaresource,such asinvokingafunctionmoduleonanSAPsystem.Anadapterservicetemplatecontainsall thecodenecessaryforinteractingwiththeresourcebutwithoutthedataspecifications. Youprovidethesespecificationswhenyouconfigureanewadapterservice.
30
YouusethewebMethodsDevelopertoconfiguretheadapterservice.Somefamiliarity withusingthewebMethodsDeveloperisrequired.SeethewebMethodsDeveloperUsers Guideformoreinformation. TheSAPAdapterprovidesthefollowingadapterservicetemplate: Adapter Service Template RFC Adapter Service (synchronous) Description InvokesanRFContheSAPsystem, executesatRFC,orconfirmsatransaction.
Listeners
AlistenercontinuallymonitorsanSAPsystemforRFCrequeststosendtotheIntegration Server.WhenacallismadefromtheSAPsystem,thelistenerpassesthemessagetoa listenernotification. Alistenerisarealtimeprocessthatyouconfigure,enable,anddisableusingthe Administrator.Fordetailedinstructionsonhowtoconfigurelisteners,seeListenerson page 87.
Listener Notifications
AlistenernotificationworksinconjunctionwithalistenertofilterandprocesstheRFC requestsintheSAPAdapter.TheSAPAdapterusesfivedifferentlistenernotificationsto processrequests: Listener Notification ALE Listener Notification (synchronous) ALE Listener Notification (asynchronous) RFC Listener Notification (synchronous) Description HandlesincomingIDocssynchronously. HandlesincomingIDocsasynchronously. HandlesincomingRFCsandtRFCssynchronously.
31
32
CHAPTER
System Requirements
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Disk Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
33
Overview
Fordetailedinformationonsystemrequirements,seethewebMethodsSAPAdapter InstallationGuide. ThewebMethodsSAPAdapterversion6.5issupportedonallplatformswhereboththe webMethodsIntegrationServerversion6.5andSAPJavaConnectoraresupported.For informationonsupportedplatformsforSAPJavaConnector,seeOSSnote0000549268.
CPU
ForjustInternetenablinganSAPsystem,anaveragePCwillbesufficient.Forheavy loadscenarios,youshouldadjustyourhardwareaccordingly.
Disk Space
Questions on Sizing
AppropriatesizingfortheSAPAdapterinstallationstronglydependsonthebusiness scenarioyouwanttoestablish.Forspecifyingyourindividualrequirements,youshould answerthefollowingquestionsfirst: 1 2 Isthereaneedforyourowndevelopment,andifso,howbigdoyouexpectyour scenariotobe?SmallPackage:<1MB,averagePackage:<5MB,bigPackage:10MB Whatkindofdataflowdoyouexpect?Thatis,whatkindoftransactionalmessages andtheirsize,howmanyperday,forhowlongdoyouwanttokeepthemintheSAP Adaptertransactionstoreaftertheyarecompleted(Confirmed) Doyouneedtokeepstatisticalinformationofthekindwrittentoaudit.logand session.log?(SeethewebMethodsIntegrationServerAdministratorsGuideforan explanationofthesetwologfiles.)
34
Disk Space
Transaction Store
Youmustdeterminethestoragespaceforthetemporarilystoredtransactions.Usethe followingformula: (Averagesizeofatransactionalmessage)x(Numberoftransactionsperday)x (NumberofdaysyouwanttomaintainConfirmedtransactionsforreference).
To determine the average size of one transactional message 1 Determinethecurrentsizeofthe webMethods_directory/IntegrationServer/packages/WmSAP/txStore/directory, includingitssubdirectories. Send100typicaltransactionalmessages(transactionsyouwilluseinproduction) throughtheSAPAdapter. Checkthesizeofdirectoryagain. Dividethedifferenceby100todeterminetheaveragesizeofyourtransactional message.Forexample,atypicalORDERSIDocisbetween13kBand35kB.
2 3 4
Log Files
Thelogfilesneedadditionaldiskspace.IftheSAPAdapterrunsonahighdebuglevel duringtheimplementationandtestphase,itcanwrite1GBperday.Typicaldatavolumes withastandarddebuglevel(4orlower)maygeneratebetween10kBand40MBperday (dependingontraffic).Thebiggestpartsareconsumedbyauditlogandsessionlog, whichareusedforstatisticalevaluations.Youcanturnofftheselogstosavediskspace. ThentheSAPAdapterneedsonlyafewkBeachdayfortheerrorlogandserverlog. However,itisnotrecommendedthatyouturnofftheselogs.ThiswillonlysaveafewkB andeliminatesallpossibilitiesfordeterminingthecauseoferrors.
To turn off the logs Audit Log:UsetheEdit Extended SettingsfeatureoftheIntegrationServerAdministrator toviewthewatt.server.auditLogkeyandeditthekeyasfollows: watt.server.auditLog=off.
35
Tip! YoucanalsoadjustthisparameterbyshuttingdowntheIntegrationServerand addingtheparametertooreditingitinthe webMethods_directory/IntegrationServer/config/server.cnffile. Session Log:UsetheEventManagertoolintheDevelopertosetthefollowingevents totheEnabledstatusfalse: Session End Event Session Expire Event Session Start Event Stats Log: UsetheEventManagertosetStat EventeventtotheEnabledfalse.
36
Memory
Memory
Questions on Sizing
1 HowmanytaskswilltheIntegrationServerhavetohandlesimultaneously?For example,howmanyRFCs,httprequests,ftpconnections,startedlistenersandRFC listenerswilltheIntegrationServerhavetohandlesimultaneouslyatthepeaktimeof theday?Thisdeterminesthenumberofsessionsn.Formoreinformation,see ConsumptionPerSessiononpage 37. ForhowmanySAPsystemswilltheSAPAdapterregisteranRFClistener?How manythreadsdotheselistenershave? Howmanymessages(XMLdocuments,IDocs,RFCcalls)gothroughtheIntegration Serversimultaneouslyatthepeaktimeoftheday?Isthereanyexpensivemappingto bedone?
2 3
Initial Consumption
TheIntegrationServerneedsapproximately80MBRAMtostartupandjustrunwithout anyheavyloadonit.DependingontheloadandexpectedtrafficontheIntegration Server,youneedtoaddthefollowing:
Ifnprovestobemuchlargerthan75,usetheEdit Extended Settingsfeatureofthe IntegrationServerAdministratortoviewthewatt.server.threadPoolkeyandeditthe keytoenabletheIntegrationServertohandlemorethan75tasksinparallel.The IntegrationServerthenprovidesapoolofunusedsessions,andthenextrequestcanbe processedimmediatelywithoutwaitingforanewsessiontobecreated. Note: IfthesizeofyourhardwaredoesnotsupportthislevelofRAMusage,donotchange watt.server.threadPool. Youcanalsoincreasethevalueofthewatt.server.threadPoolMin=10parameterto enhanceperformance.
37
Tip! YoucanalsoadjusttheseparametersbyshuttingdowntheIntegrationServerand addingtheparameterstooreditingtheminthe webMethods_directory/IntegrationServer/config/server.cnffile Formoreinformationabouttheseparameters,seethewebMethodsIntegrationServer AdministratorsGuide. Note: Thisprocedureshouldbeusedwithcaretoavoidunnecessarymemoryoverload. Forexample,ifyoukeepapoolof1000sessionsandtheIntegrationServerrarelyneeds morethan100,youwillwastealotofmemoryandresources.
Payload
Youwillhavetocalculatetheamountofmemoryrequiredtoprocessdocuments simultaneously(seequestion3).Usethefollowingequationtocalculateyourneeds: Payloadconsumption=(documentsizexmemFactor+RFCSize)xnumberofparallel documents,where: memFactor=3+thenumberofINVOKEstatementsintheadapterornotification service(iftherearemappingsbetweendocumentformatsanddifferentXML dialects)+theSSLvalue.TheSSLvalue=0or1,accordingtowhetherdocuments areencryptedwithSSLornot. RFCSize=0,ifnoRFCisinvolvedintransportingthedocument. RFCSize=(1063bytesxnumberofsegments+524bytes)xnumberofIDocsin package,iftheIDocsareeithersentorreceivedviaRFC.
38
Memory
39
Miscellaneous
Encryption
WhenusingSSLtoencryptXMLdocuments,thetimeneededtoprocessadocumentwill increasebyafactorof3.Inthiscase,youthereforeneedtotakeaCPUfromthenext higherclass. YoualsohavetochangetheformulaforcalculatingtheRAMneededforprocessing documents:increasememFactorbyone.
IDoc Packets
TheperformancecanbevastlyimprovedbyusingIDocPacketsofawellchosensize.If thepacketsizeistosmall,youwillnottakefulladvantageoftheperformance improvement.Ifitistobig,theIntegrationServermayrunoutofmemoryorstart swapping.Youshoulddosometestingtofindtheoptimumsize;itdependsontheIDoc typeaswellasonthesizeofyourmachine.
Logging
Iftheproductionscenarioinvolvesinvokingthousandsofservicesinashortperiodof time,youcanachieveahugeperformanceimprovementbyturningoffAuditLogging. Forinformationaboutturningofflogging,seeLogFilesonpage 35.
40
CHAPTER
Package Management
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Managing the Adapter Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Controlling Group Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Using the Adapter in a Clustered Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
41
Overview
ThefollowingsectionsdescribehowtosetupandmanageyourSAPAdapterpackages, setupAccessControlLists(ACL),andusetheadapterinaclusteredenvironment.
SAP Connections Package (user-defined) WmART WmSAP SAP Adapter Services Package (user-defined) SAP Notifications Package (user-defined) Adapter n Connections Package (user-defined)
Adapter n
42
Packagemanagementtasksinclude: Settingpackagedependencies(seePackageDependencyRequirementsand Guidelinesonpage 43). EnablingandDisablingPackagesonpage 44. ImportingandExportingPackagesonpage 45. ControllingGroupAccessonpage 46.
43
Note: Enablinganadapterpackagewillnotcauseitsassociateduserdefinedpackage(s)to bereloaded.Forinformationaboutreloadingpackages,seeLoading,Reloading,and UnloadingPackagesonpage 45. Important! Beforeyoumanuallyenableauserdefinedpackage,youmustfirstenableits associatedadapterpackage(WmSAP).Similarly,ifyouradapterhasmultipleuser definedpackages,andyouwanttodisablesomeofthem,disabletheadapterpackage first.Otherwise,errorswillbeissuedwhenyoutrytoaccesstheremainingenableduser definedpackages.
44
Unloading Packages
Atshutdown,theIntegrationServerunloadspackagesinthereverseorderinwhichit loadedthem:itunloadsthenodepackage(s)first,theadapterpackagenext,andthe WmARTpackagelast(assumingthedependenciesarecorrect).
45
46
47
Inthelightoftheserestrictions,clusteringoffersthefollowingadvantageand disadvantages. Advantage: Noadditionalloadbalancingcomponentisneeded. Disadvantages: LoadbalancingforvariouskindsofHTTPclientsiseasiertoachievewithanexternal loadbalancerandseveralinstancesofindependentIntegrationServers. Scalabilitythroughloadbalancingisnotreached.IndependentIntegrationServers frontedbyanexternalloadbalancerofferabettersystemperformance. Failovermechanismsonlymakessenseformultisteptransactions.WithanSAP backendsystem,thesetransactionsareboundtoasingleIntegrationServer,sothe checkpointsupportoftheclusterdoesnotapply.
48
Youcanstartandfinishyourdependentrequestsequencebybindingandreleasingyour sessiontoyourRFCconnectionusingspecialservices. 1 TobindyourIntegrationServersessiontoanRFCconnection,callthe pub.sap.client:lockSessionservicebeforeanyseriesofrequeststhatmusthavethesame usercontextassignedattheSAPsystemhost.Forformoreinformationaboutthis service,seepub.sap.client:lockSessiononpage 233. ToreleaseyourIntegrationServersession,makesurethattheLUWiscomplete(all serviceshavebeencalled).Thencallthepub.sap.client:releaseSessionservice.Formore informationaboutthisservice,seepub.sap.client:releaseSessiononpage 234.
49
SavethefileandrestartthewebMethodsIntegrationServer.
50
For Example... OneIntegrationServerintheclustercannotbeversion6.5 andanotherIntegrationServerintheclusterbeversion 6.0.3allserversmustbeversion6.5,withthesameservice packsandfixes(updates)applied. AlladapterpackagesononeIntegrationServershouldbe replicatedtoallotherIntegrationServersinthecluster. Inthecluster,allSAPAdaptersmustbethesameversion, withthesamefixes(updates)andthesameSAPlibraries (versions)applied.
Adapterpackages Adapterversions
51
All Integration Servers in a given cluster must have identical... Userdefinedadapter packages
For Example... Eachpackagethatyouhaveconfiguredcontainingadapter connections,adapterservices,flowservices,listeners, triggers,andnotificationsfortheSAPAdapter,mustexist onalloftheIntegrationServersinthecluster,sothatall IntegrationServersintheclustercanhandleanygiven request. TheconfigurationandsettingsofallSAPAdapter connections,adapterservices,listeners,triggersand notificationsmustbeidenticalthroughoutthecluster. Toensureconsistency,createallpackagesononeserver,and replicatethemtotheotherservers.Ifyouallowdifferent serverstocontaindifferentservices,youmightnotderive thefullbenefitsofclustering.Forexample,ifaclient requestsaservicethatresidesinonlyoneserver,andthat serverisunavailable,therequestcannotbesuccessfully redirectedtoanotherserver.Forinformationabout replicatingpackages,seethechapteronmanagingpackages inthewebMethodsAdministratorsGuide. Note: Ifyouplantouseconnectionpoolsinaclustered environment,seeConsiderationsWhenConfiguring ConnectionswithConnectionPoolingEnabledonpage 53.
Adapterconnections
Adapterservices
52
53
TopreventthesesynchronizationissueswithtRFCtransactioninformationupdates,you canconfigureyourgroupofSAPAdapterstouseasingleCentralizedTransactionStore (CTS)thathostsalltransactionstateinformationforallSAPAdaptersinthegroup. TheCentralizedTransactionStoreimplementsaclient/serversolution,whereoneSAP Adapterhoststhecentralizedstore(theCTSServer)andallotherSAPAdaptersaccess thisstoreasclients(CTSClients).Sincealltransactionstatusinformationupdatesarenow routedtoasingletransactionstore,nomoreduplicate,incomplete,orinconsistent transactionstateinformationwillbepersistedinlocaltransactionstores. NotethatitisnotrequiredthatyousetuptheCTSasanIntegrationServercluster.Instead youcanusetheCTSeitherwithanIntegrationServerclusterorwithagroupofSAP AdaptersonindependentIntegrationServers. ACTSisneededwhenyouwanttoimplementrobustinboundoroutboundload balancingusingtRFCsandIDocs.IfyoujustrunasingleSAPAdapter,thenaCTSwill notmakeanysense(anditwouldbeinternallytreatedlikealocalTransactionStorebythe adapter).IfyourunagroupofcompletelyindependentSAPAdaptersanddonotintend touseloadbalancingortRFCsorIDocswiththeseadapters,thenconfiguringaCTSwill notbeuseful. SAPAdaptersconfiguredasCTSClientswillpersistandlookupalltransaction informationintheCTS,thereforetheavailabilityandperformanceoftheCTSServerisof importance.EnsurethattheSAPAdapterthathoststheCTS(theCTSServer)isalways startedbeforeallotherSAPAdapters(Clients),andalsoensurethattheCTSserverisnot shutdownordisabledwhileotherCTSClientsarestillrunningandprocessing transactions. FormoreinformationaboutconfiguringtheCentralizedTransactionStore,see CentralizedTransactionStoreonpage 181.
54
CHAPTER
Adapter Connections
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Before Configuring or Managing Adapter Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Configuring Adapter Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Setting Up the SAP System for SNC Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Dynamically Changing a Services Connection at Run Time . . . . . . . . . . . . . . . . . . . . . . . . . 62 Enabling Adapter Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Viewing Adapter Connection Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Editing Adapter Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Copying Adapter Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Deleting Adapter Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Disabling Adapter Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Testing the Execution of an RFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Testing the Execution of a BAPI Via XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
55
Overview
ThischapterdescribeshowtoconfigureandmanageSAPAdapterconnections.Formore informationabouthowadapterconnectionswork,seeAdapterConnectionsonpage 28.
3 4 5
56
Forabasicconnection,completethefollowingfieldsintheSAP Adaptersection: Field Package Description/Action Thepackageinwhichtocreatetheconnection.Youmust createthepackageusingtheDeveloperbeforeyoucanspecify itusingthisparameter.Forgeneralinformationaboutcreating packages,seethewebMethodsDeveloperUsersGuide. Note: Configuretheconnectioninauserdefinedpackage ratherthanintheadapterspackage.SeeChapter 3,Package Managementforotherimportantconsiderationswhen creatingpackagesfortheSAPAdapter. Folder Name Thefolderinwhichtocreatetheconnection.
IntheConnection Propertiessection,completethefollowingfieldsusingthevalues fromyourconfiguredSAPsystem: Field Connection Alias Description/Action TheRFCconnectionname.ThisisthenamebywhichtheSAP systemwillbeknowntoSAPAdapterdevelopers,clients,and partners. TheSAPusername. TheSAPpassword. ThethreedigitSAPclientnumber. TheSAPlanguagecode.Ifconnectingtoaversion3SAP system,thisisonecharacter.Foraversion4orlaterSAP system,itistwocharacters.
Toconfigurelogonproperties,completeoneofthefollowingsteps: Toenableloadbalancing,configurethefollowingfields: Field Load Balancing Description/Action IfyouselectOn,thegrouploginconceptisactive. Completetheremainingfieldsinthisstep. IfyouselectOff,youwillconnecttoonededicated applicationserver.SkiptoCompletethefollowingfields tosetupthesingleserverlogon:onpage 58. Logon Group Thenameofthegroupyouwanttologin.
57
CompletethefollowingfieldsifyouareusinganexternalRFCServer: Important! ThesettingsshouldpointeithertotheGatewayatwhichthisRFC serverisregisteredortotheRepository Serverselectedbelow.Theloadbalancing andsingleserverlogonsettingswillbeignoredifyouconfigureanRFCserver. Field External RFC Server Description/Action IfyouselectYes,anexternalRFCserverwillbeused. Completetherestofthefieldsinthissection. IfyouselectNo,youdonotneedtocompletetherestofthe fieldsinthissection. Program ID Gateway Host TheProgramIDoftheexternalRFCServer GatewayHostforaccessingyourRFCServer.Mustbethe IPorDNaddressoftheGatewaytheRFCServeris registeredon. ThiscorrespondstothesystemnumberofyourRFC Server. Syntax:TheGatewayServicemustintheformofsapgwXX, whereXXisavaluefrom00to99. Example:sapgw07 Repository Server ThisserveristakenfromtheexistingSAPsystemlist.All repositorylookupssuchasmetadatalookupsfor structuresandfunctioninterfacesaredonethere.This helpsusingthirdpartyRFCServersfromtheSAP Adapterasclient.Theycanprovidetheirfunctionality withoutbeingextendedbyaspecificinterface,for example:RFC_GET_FUNCTION_INTERFACE
Gateway Service
58
Note: AnyserverprogramthatisenabledforRFCcommunicationcanbean externalRFCServer.InordertouseanexternalRFCServerwiththeSAP Adapter,theRFCServermustimplementatleastthefollowingfunctionmodules: RFC_FUNCTION_SEARCH RFC_GET_FUNCTION_INTERFACE RFC_GET_STRUCTURE_DEFINITION(iftheserverisrunningwitha3.xLib) DDIF_FIELDINFO_GET(iftheserverisrunningwitha4.xLib) ThelastthreefunctionmodulesarerequiredonlyiftheRFCServeristobeits ownRepository Server. 7 Optionally,completethefollowingfieldstoenablesecurity: Field SNC Enabled SNC Quality of Service Description/Action DetermineswhetherthisservershoulduseSecureNetwork Communications(SNC).Default:No. SNCQualityofservice,possiblevalues: Useglobalbuiltindefaultsettings Plaintext,butauthorization Eachdatapacketwillbeintegrityprotected Eachdatapacketwillbeprivacyprotected Usemaximumavailablesecurity SNC Name YourownSNCnameifyoudonotwanttousethedefault SNCname.Thisisthenameyouchosewhengeneratinga PersonalSecurityEnvironment(PSE). SNCnameoftheSNCpartner(RFCserver)orSNCnameof themessageserver(LoadBalancing).
SNC Partnername
59
Optionally,settheSAPRouterString: Field SAP Router String Description/Action TheSAProuterstring.Arouterstringcontainsasubstringfor eachSAPRoutertosetupaconnectionintheroute:thehost name,theportname,andthepassword,ifonewasgiven. Example: /H/127.0.0.1/H/ Syntax: /H/indicatesthehostname. TheSAProuterstringisonlyneededifthereexistsafirewall betweentheSAPsystemandIntegrationServer.Formore informationonconfiguringtheSAProuter,seetheSAPHelp PortalontheSAPServiceMarketplace.
Optionally,completetheadvancedsettingsfortheconnection: Field Use SAPGui Description/Action Runwithout/with/invisibleSAPGUIbetweentwoRFC functions. Values:Off/On/Hidden Default:Off RFC Trace Disables/enablesthecreationofRFCtraceinformationforthis clientconnection. Values:Off/On Default:Off FordetailedinformationonusingtheRFCtrace,see Chapter 10,LoggingandMonitoring. ABAP Debug Runwithout/withtheABAPdebugger Values:Off/On Default:Off
60
Description/Action ThisswitchcanbesettoOnorOff. IfsettoOff,thentheprocessinglogswillnotbesaved, althoughatransactionwillbecreated(ormaintained),andthe transactioncanbemonitoredlateroninthetransactionlist. Tip! Activatingthisswitchreducestheamountofdiskspace neededandthetimeittakestologthetransactionstatus.Itstill allowsyoutocheckthecurrenttransactionstatusontheSAP Adapter.
61
Table/Parameter TableSNCSYSACL (SM30, view VSNCSYSACL, TYP=E) SNC nameentryoftheSAPAdapter. ProfileParameter: SNC/libsapsecu=./libsecude.sl (forHPUX) SNC/extid_login_diag=1 SNC/extid_login_rfc=1 TableSNCSYSACL(SM30, view VSNCSYSACL, TYP=E), activate: Certificate log in Diag RFC
FordetailedinformationontheSAPapplicationserversettingsforSNC,seeyourSAP documentation.
62
Forexample,youhaveaflowwhoseprimarypurposeistocreateanentryonthe productionSAPsystem.However,youwanttheflowtohavethecapabilitytocreatethe entryonthetestserver,withthedecisionofwhichSAPsystemtoupdatetobemade programmaticallyatruntime.Theoutputsignatureoftheflowsfirstservicecontainsa fieldcalledTarget.TheflowcouldbranchbasedonthevalueinTarget. IfTargetcontainsthevalueproduction,thesecondserviceintheflowwouldignore $connectionNamethususingitsdefaultconnectiontoconnectto(andthenupdate) theproductionSAPsystem. However,ifTargetcontainsthevaluetest,thesecondserviceintheflowwoulduse thevalueinthe$connectionNamefromthepipelineandconnectto(andthenupdate) thetestSAPsystem. KeepinmindthatbothconnectionsthedefaultandoverridemusthavethesameSAP classesandmethods. Formoreinformation,seeChangingtheConnectionAssociatedwithanAdapterService atRunTimeonpage 30.
To enable a connection 1 2 IntheAdaptersmenuintheAdministratorsnavigationarea,clickSAP Adapter. OntheConnectionsscreen,clickNointheEnabledcolumnfortheconnectionyouwant toenable. TheIntegrationServerAdministratorenablestheadapterconnectionanddisplays a andYesintheEnabledcolumn. Ifyoureceiveanerrormessage,clicktheEditbuttontoviewtheconfiguration. Verifythatyourconfigurationinformationiscorrect.SeeEditingAdapter Connectionsonpage 64. IncaseofanRFCerrormessage,anRFCtracefilenameddev_rfc.trcwillbe writtentothewebMethods_directory\IntegrationServerdirectory.Thisfilecontains amoredetaileddescriptionoftheerrorcause.
63
To view the parameters for a connection using the Developer 1 2 3 StarttheDeveloperifitisnotalreadyrunning. FromtheDevelopersnavigationarea,openthepackageandfolderinwhichthe connectionislocated. Clicktheconnectionyouwanttoview. TheparametersfortheconnectionappearontheConnection Informationtab.For descriptionsoftheconnectionparameters,seeConfiguringAdapterConnections onpage 56.
64
OntheConnectionsscreen,clicktheEditicon
fortheconnectionyouwanttoedit.
TheCopyConnectionscreendisplaysthecurrentparametersfortheconnectionyou wanttocopy.Namethenewconnection,specifyapackagenameandfoldername, andeditanyconnectionparametersasneededbytypingorselectingthevaluesyou wanttospecify. Note: Whenyoucopyaconnection,thenewconnectiondoesnotsavethepasswordof theoriginalconnection.Youmustenterandthenretypethepasswordbeforeyoucan savethenewconnection. Fordescriptionsoftheconnectionparameters,seeConfiguringAdapter Connectionsonpage 56. 3 ClickSave Connection tosavetheconnectionandreturntotheConnectionsscreen.
65
TheIntegrationServerdeletestheadapterconnection.
66
6 7 8
67
3 4
EnterthefunctionmoduleyouwouldliketoinvokeviaXMLintheFunction Name fieldoftheFunction By Namesection. SelectRFC-XML. ThisgeneratesaformcontainingtheXMLtemplatenecessarytoinvokethefunction module.FillintheappropriateinputsandselectInvoke on System ID.Youwillseethe XMLresponseinthebrowser(youmayhavetoselectView Sourcetoseetheactual XMLsourceinyourbrowser).
Starting to Browse
YoucanstartbrowsingyourBAPIsusingtheLookuptab.Hereyoucanenterthenameof abusinessobjectandaBAPI.ThisselectionalwaysappliestotheSAPsystemselectedin thefieldSystem ID. Thereareseveralwaysyoucanfillouttheform: InthegroupBAPI By NameenterthefullnameofthebusinessobjectandBAPI.Youcan eitherviewthedetailsoftheBAPIbyselectingLookupordirectlyinvoketheBAPIvia XMLbyclickingbXML. InthegroupBAPI By Nameenteronlythenameofthebusinessobject.SelectLookupto viewdetailsofthebusinessobjectandselectoneBAPIfromthelistofavailableBAPIs forthebusinessobject. InthegroupBAPI By Nameenter* inthebusinessobjectfieldtoviewalistofall businessobjectsavailableintheselectedsystem. Note: BusinessobjectnamesandBAPInamesarecasesensitive.
68
Displaying a BAPI
ByenteringthefullnameofthebusinessobjectandBAPIinthecorrespondingfieldon theLookupmainpage,youcandisplaydetailedinformationoftheBAPI.Youcanalso displaythisinformationbyfollowingthecorrespondinglinkonthedisplaypagefora businessobject. Field Static method Description TheStatic method flagistrueiftheBAPIisaninstanceindependent method.Inpractice,thatmeansthatyoudonothavetospecifythe businessobjectskeyfieldswhencallingthismethod. TheDialog methodflagistrueifthemethodisadialogmethod.Ifthe methodisnotusingadialog,theflagisfalse.DialogBAPIsrequire aSAPGui. TheFactory method flagistrueiftheBAPIisusedtocreateanobject instanceinsidetheSAPsystem.Factorymethodsreturnthekey fieldsofthebusinessobject. TheImplementing RFCisthemessagetypethathastobeusedtoset uproutingforsynchronouscallscomingfromanSAPsystem.This istechnicallyrealizedviaRFC,soherethenameofthe correspondingRFCfunctionmoduleinsidetheSAPsystemis provided.Althoughitispossibleatthemoment,itisnot recommendedtocallBAPIsdirectlyviaRFCXML,asthiswould onlybeanimplementationdependentviewoftheBAPI.
Dialog method
Factory method
Implementing RFC
69
Description TheALE message typeisthemessagetypethathastobeusedtoset uproutingforasynchronouscallscomingfromanSAPsystem. ThisistechnicallyimplementedviaIDoctransfers,butwhenusing theBAPIstyledXMLcalls,theALEmessagetypeisonlyneeded tosetuprouting. The ParametersfieldcontainsalistofallparametersintheBAPI interface.Byselectingthislink,youcandisplaymoreinformation oneachparameter.Pleasenotethatthekeyfieldsofabusiness objectarenotdisplayedinthisparameterareabutintheKey fields areaonthebusinessobjectdetailpage.
Parameters
Optional
Table
70
71
YoucanalsoadjustthepregeneratedinformationintheBizTalkXMLheaderfieldsthat arefilledwithdefaultdata. TherearethreewaysofcallingtheBAPI,whichcanbeselectedthroughthelist: SynchronouslycallingtheBAPIinanSAPsystem. AsynchronouslycallingtheBAPIinanSAPsystem.ThisonlyworksforBAPIsthat aremappedtoanALEinterface.ToseewhethertheBAPIismappedtoanALE interface,checktheBAPIdetailpage.IfanALEmessagetypeisspecified,theBAPI canbecalledasynchronously. Applyingroutingnotification:ThecallwillbesenttotheBAPIinboundprocessofthe routinglistenerthatwillcheckifaroutingnotificationforthisBAPIcallexistsand willforwardthecalltothespecifiedservice.Thiswillonlyworkifacorrectrouting notificationhasbeensetup,otherwiseyouwillreceiveanXMLerrormessage. AfterclickingInvoke,theresultofyourXMLcallisdisplayed.Inthecaseofsynchronous processing,thiswillbeaBizTalkmessagewitheithertheexportingparametersofthe BAPIorwithanerrormessage. Forasynchronouscalls,thiswillbeaBizTalkmessagewithanemptybodyinthecaseof successorwithanerrormessage,ifthemessagecouldnotbedeliveredtoanSAPsystem. Applicationspecificerrorsarenotreturnedinthecaseofasynchronouscalls,butyoucan usetheALEmonitoringtoolsinthetargetSAPsystemtochecktheseerrors.
72
CHAPTER
Adapter Services
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Creating an Adapter Service that Executes an RFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
73
Overview
AdapterservicesfortheSAPAdapterworkbyexecutingafunctionmoduleresidingon anSAPsystem.AfunctionmoduleperformsfunctionsagainstdataintheSAPsystem. Youcancreateaserviceforanyfunctionmodulethatisdesignatedforexternaluse(for example:remoteenabled).ThisincludesallBAPIs,whichareformalizedfunction modules. Beforeyoucancreateanadapterservice,youmustconfigureanRFCclientconnectionto theSAPsystemyouwanttoaccess.Youidentifyaconnectionaliasandspecify informationthatisrequiredtoconnecttotheSAPsystem.Tocreateanadapterservice, youselecttheSAPsystemandtheRFCthatyouwanttheservicetoexecute.Aftercreating theadapterservice,youcancreateaclientthatinvokestheservice. Thischapterdescribeshowtocreateanadapterserviceforaspecificfunctionmoduleon onespecificSAPsystemandhowtotesttheadapterservice. Note: YoumusthaveadministratorprivilegesontheIntegrationServertocreateanew RFCconnectiontoanSAPsystem.Ifyoudonothavesuchprivileges,haveyour IntegrationServeradministratorcreatethenewRFCconnectionforyou.
74
Terminology
TousetheSAPAdaptersuccessfully,youshouldunderstandthefollowingtermsand concepts: Term Export Function Signature Import RFC Adapter Service Structure Table Description Outputparametersofafunctionmodule.Outputparametersare simplevaluesorstructures. Specificationsoftheimport,export,andtableparametersofan functionmodule.Alsoknownasafunctioninterface. InputparametertoanRFC.Inputparametersaresimplevalues (suchasstringornumber)orstructures. SAPAdapterterminologyforanassociationbetweenafunction moduleonanSAPsystemandanadapterservicebasedonthe RFCAdapterServicetemplateontheSAPAdapter. SAPdatastructurecontainingoneormorefields.Thiscanbe thoughtofasasinglerowofatable. SAPdatastructurethatisbothanimportandexporttoafunction. TablescanbecreatedandpassedtoanRFC.Thefunctionmodule canmodifythesetablesandreturnthem.Thetablesthemselvesare nodifferentfromrelationaldatabasetables;theyconsistofaseries offieldsandrowsofdataforthesefields.
75
5 6 7
Fromthelistofavailabletemplates,selectRFC Adapter Service (synchronous).ClickNext. EnteranameandselectafolderwheretheRFCadapterserviceshouldbestored. ClickFinish. OntheFunction Searchtab,intheFunction Patternfield,typeallorpartofthenameof thefunctionmoduleforwhichyouwanttocreateanadapterservice.Usepattern matchingcharactersifyouareunsureofthecompletenameandwanttheSAP AdaptertosearchforseveralRFCswithsimilarnames.Forthisexample,enter RFC_FUNCTION_* intheFunction Patternfield. UnderFunction Name,alistofRFCsthatmatchthecriteriayouspecifiedinthe previousstepisdisplayed. SelectthenameoftheRFCforwhichyouwanttocreateanadapterservice.Forthis example,RFC_FUNCTION_SEARCH.Leaveallotherfieldsattheirdefaultvalues.
ClickSaveontheDevelopertosaveyourRFCadapterservice.
76
77
Formoreinformationaboutthepub.client:httpservice,seethewebMethodsBuiltInServices ReferenceGuide.
78
CHAPTER
Adapter Notifications
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Creating an RFC Destination on an SAP System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110
79
Overview
YoucancreateRFCsontheSAPsystemthatinvokeservicesontheIntegrationServer. ThisallowsSAPuserstoaccesstheinformationthatisavailableviatheSAPAdapter. BeforeyoucancreateanRFCthatinvokesaservice,orsendanIDoctotheSAPAdapter, youmustconfiguretheSAPsystemtohaveanRFCdestinationforanRFClistener runningattheSAPAdapter.ThisenablestheSAPsystemtosendRFCstotheSAP Adapter.YoumustalsoconfiguretheSAPAdaptertohaveanRFClistenerthatlistensfor RFCsfromtheSAPsystem. AfteryouhavetheSAPsystemandtheSAPAdapterconfigured,youcancreatea functionmoduleontheSAPsystemthatrequeststheexecutionofaservice synchronouslyoryoucansendanIDoctotheSAPAdapterforfurthersynchronousor asynchronousprocessing.Todosoyoualsoneedtocreatealistenernotificationonthe SAPAdapter.ThelistenernotificationindicateseitherwhatservicetheSAPAdapteristo executewhenitreceivesamessagefromtheSAPsystemorhowtopublisha correspondingdocument. TheSAPAdaptersupportsthreetypesofnotificationsthatcanbeassignedtoanRFC listener. RFClistenernotification(synchronous) ALElistenernotification(synchronous) ALElistenernotification(asynchronous) IfthereisnolistenernotificationassignedtotheRFClistener,thereceivedmessagewillbe forwardedtotheroutinglistener.Formoreinformation,seeChapter 8,Routing MessagesThroughtheSAPAdapter. Note: Inthiscontext,synchronousorasynchronousreferstotheprocessingonthe IntegrationServer.ItdoesnotindicatehowthemessagewasprocessedontheSAP system.However,inthecaseofanALElistenernotification,thereisalwaysaTID assignedtothemessage.InthecaseofanRFClistenernotification,aTIDwillbepresent inthepipelineonlyfortransactionalRFCcallsfromtheSAPsystem.
80
Overview
81
Action Equals 1
Inthescenariowherethevalueof$actionequals1(Execute),thecallingservicename,or incaseofaninboundtransport,thematchingconfirmservice,willbestoredinthe transactionstore(setServiceName()call).
$action=1
82
Overview
Action Equals 4
Inthescenariowherethevalueof$actionequals4(Confirm),thestoredservicenamewill beretrievedandtheservicewillbecalleddirectly,bypassingthenotification (getServiceName()call).
$action=4
83
To register SAP Adapter listener as an RFC destination 1 2 3 UsetheSAPGuitologintotheSAPsystem. SelectAdministration (SM59). System Administration Administration Network RFC Destinations
SelectTCP/IPconnections.
84
4 5
SelectCreate. IntheRFC Destinationfield,typeanamethatwillmeaningfullyidentifyboththeSAP AdapterandtheSAPsystemitself.Forexample,iftheSAPsystemisnamedCERand theIntegrationServerisnamedIS,nameyourRFCdestinationISCER.Youwillneed toreenterthisnameseveraltimesduringthecourseofthissection,sokeepitsimple andmemorable. Important! Thisfieldiscasesensitive.Itisrecommendthatyoupickanamethatisall UPPERCASEcharacters.
6 7 8 9
10 InfieldProgram IDtypethenameofyourRFCdestinationfromstep 5.Enteritexactly asyoudidinstep 5.Thisisalsoacasesensitivefield. 11 SelectSavefromthetoolbarorselectSavefromtheConnectionmenu. 12 SelectGatewayOptionsfromtheDestinationsmenu. 13 EnterSAP system application serverintheGateway hostfield. 14 Entersapgwnn (wherennistheSAPsystemnumber) intheGateway servicefield. Note: ThisguaranteesthatyoucanaccesstheRFCServerfromallSAPapplication servers. 15 SelectOK. 16 SelectSave.
85
RemainonthecurrentscreenwhileyoucompletethestepsforcreatinganSAPAdapter listener.
86
Listeners
Listeners
Thissectiondescribeshowtocreate,modify,anddeletelisteners.
2 3 4
87
CompletethefollowingfieldsontheConfigureListenerTypescreen(leaveallother fieldsattheirdefaultvalues): Field Package Description/Action Thepackageinwhichtocreatethelistener.Youmustcreate thepackageusingtheDeveloperbeforeyoucanspecifyit usingthisparameter.Forgeneralinformationaboutcreating packages,seethewebMethodsDeveloperUsersGuide. Note: Configurethelistenerinauserdefinedpackagerather thanintheadapterspackage.SeeChapter 3,Package Managementforotherimportantconsiderationswhen creatingpackagesfortheSAPAdapter. Folder Name Listener Name Program ID Thefolderinwhichtocreatethelistener. Thenameofthenewlistener. TheProgramIDthatyouspecifiedwhencreatingthe correspondingRFCdestinationontheSAPsystem.Thisfield iscasesensitive. GatewayHostforaccessingyourSAPsystem.Thismustbe exactlythesameparameterasyouchoseforthecorresponding RFCdestinationintheSAPsystem. TheGatewayService.ThiscorrespondstoyourSAPsystem number.IfyourSAPsystemnumberis01thenyour gatewayserviceissapgw01. Again,thismustbeexactlythesameparameterasyouchose forthecorrespondingRFCdestinationintheSAPsystem. Number of Threads ThenumberofsimultaneousincomingRFCsthatthislistener canhandle.
Gateway Host
Gateway Service
88
Listeners
Description/Action Theoutboundconnectionaliasisusedasarepositoryfor functioninterfacesandstructuredefinitionsofinboundcalls. ThiswayitispossibletouseRFCseveniftheyarenotdefined inthecallingsystem. Inthedropdownlistbox,youwillfind,selectingwhich, usesastaticlocalRFCmetadatarepositorywhichisrequired forthelisteneroftheWmSAPOptimizepackage.Thestatic localRFCmetadatarepositorywillthenappearintheDDIC cachepage. Important! DonotselectfromthedropdownListboxwhen creatingormodifyingalistener. Note: ThestaticlocalRFCmetadatarepositoryisonlyusedby theBAMforSAPprototype,andcannotbedirectlyutilizedby theSAPAdapteruser.
YourownSNCnameifyoudonotwanttousethedefault SNCname.ThisisthenameyouchosewhengeneratingaPSE. CalledbytheRFClistenertocheckforauthorization.To provideapplicationspecificauthorizationhandlingtheuser mightprovideaserviceherethatimplementsspecification pub.sap.listener:listenerAuthorizationCheck.Thisservicehas toreturnGrantedinfieldaccessiftherequestshouldbe accepted.Ifnoserviceisspecifiedaccesswillbegranted.Ifan exceptionhappensduringexecutionofthisserviceora differentstringthanGrantedwillbereturnedtheaccesswill bedenied. Seepub.sap.listener:listenerAuthorizationCheck.on page 276forinformationabouttheservicespecification.
89
Description/Action EnablesordisablesthelistenertolistentoaUnicodesystem. ClickYes,ifyourSAPsystemisaUnicodesystem. WhetheryouwantRFCtracingenabledordisabled.Fora productionsystem,selectOff.WhenyouselectOn,SAP Adaptercollectstracinginrfc*.trcfilesindirectory webMethods_directory\IntegrationServer\. Fordetailedinformationaboutlogging,seeChapter 10, LoggingandMonitoring.Forinformationaboutchanging thedirectoryforthetracefiles,seeAppendix B,Server Configuration.
ThisswitchcanbesettoOnorOff. IfsettoOff,thenthemessagebodyoftheincomingdocument willnotbestoredtodisk,althoughatransactionwillbe created(ormaintained),andthetransactioncanbemonitored lateroninthetransactionlist. Tip! SettingthisswitchtoOffreducestheamountofdiskspace neededandofcoursethetimeittakestopersistthemessage body.ItstillallowsyoutotrackthemessagestatusontheSAP Adapter.
90
Listeners
Enabling Listeners
Afteryouhaveconfigurednotifications,youmustenablethelistenersothatthe associatednotificationswillcommunicateappropriatelywiththelisteneratruntime.You enablethelistenersusingtheAdministrator. TheStatuscolumnindicatesthereadinessofthelistener.IfthestatusisSucceeded,the listenerisreadytobeenabled.IfthestatusisFailed, anerroroccurredduringstartup.Ifan erroroccursduringstartup,thestatewillnotchangetoEnabledwhenrefreshingthe page.Errorsatthisstagetypicallyindicateaproblemwitheitherthelistener configurationorthenetwork.Reviewthelistenersettingsandcheckthenetwork. Formoreinformationonconfiguringlistenersandnotifications,seethesections ConfiguringanRFCListeneronpage 87andConfiguringListenerNotificationson page 99. Note: Whenyoureloadapackagethatcontainsenabledlisteners,thelistenerswillbe enabledautomaticallywhenthepackagereloads.Ifthepackagecontainsdisabled listeners,theywillremaindisabledwhenthepackagereloads.
To enable a listener 1 2 3 IntheAdaptersmenuinthenavigationareaoftheAdministrator,clickSAP Adapter. IntheSAP Adaptermenu,clickListeners.TheListenersscreenappears. SelectEnabledfromthelistintheStatefield.TheIntegrationServerAdministrator enablesthelistener. ThestatechangestoPendingenabled.AfterrefreshingtheListenerspage,you shouldseethestatechangedtoEnabled. Afteralistenerisenabled,aconnectionexistsbetweentheSAPAdapterandtheSAP system. Tip! TheEnable all suspendedlinkhelpsyouchangethestatequicklyformultiple listeners.
91
92
Listeners
To view a listeners parameters using the Developer 1 2 3 StarttheDeveloperifitisnotalreadyrunning. FromtheDevelopernavigationarea,openthepackageandfolderinwhichthe listenerislocated. Clickthelisteneryouwanttoview. TheparametersforthelistenerappearontheListener Information tab.Fordescriptions ofthelistenerproperties,seeConfiguringanRFCListeneronpage 87. To view the notification order of a listener 1 2 3 IntheAdaptersmenuinthenavigationareaoftheadministrator,clickSAP Adapter. IntheSAP Adaptermenu,clickListeners. OntheListenersscreen,clicktheViewicon forthelistenerthatyouwanttoview.
93
Editing Listeners
YouusetheAdministratortoeditthelistenerinthefollowingsituations: Ifyouneedtoselectanewlyconfiguredconnection,orifyouneedtochangeany listenerpropertiesyoucanupdatethelistenerparameters. Ifyouneedtochangetheorderofthenotificationsthatareassociatedwiththe listener,seetheprocedureonhowToeditthenotificationorderofalisteneron page 94. To edit a listener 1 2 3 IntheAdaptersmenuinthenavigationareaoftheAdministrator,clickSAP Adapter. IntheSAP Adaptermenu,clickListeners. OntheListenersscreen,makesurethatthelistenerisdisabledbeforeediting.To disablethelistener,seeDisablingListenersonpage 97. OntheListenersscreen,clicktheEditicon forthelistenerthatyouwanttoedit.
To edit the notification order of a listener 1 2 3 IntheAdaptersmenuinthenavigationareaoftheadministrator,clickSAP Adapter. IntheSAP Adaptermenu,clickListeners. OntheListenersscreen,makesurethatthelistenerisdisabledbeforeediting.To disablethelistener,seeDisablingListenersonpage 97fordetails. OntheListenersscreen,clicktheEditicon forthelistenerthatyouwanttoedit.
4 5
94
Listeners
OntheEditNotificationOrder screen,usetheUpandDown buttonstodeterminethe processingorderinwhichtheSAPAdapterinvokesthenotifications. Note: Forbetterprocessingresults,arrangeyournotificationsfromascendingto descendingorderstartingwiththemostdetailednotificationstotheleastdetailed notifications.Formoreinformationonnotificationsandtheirfiltercriteria,see DependenciesforListenerNotificationsonpage 98.
7 8
Copying Listeners
Youcancopyanexistinglistenertocreateanewlistenerwiththesameorsimilar propertieswithouthavingtotypeorspecifyallpropertiesforthelistener.Youcopy adapterlistenersusingtheAdministrator. To copy a listener 1 2 3 IntheAdaptersmenuinthenavigationareaoftheAdministrator,clickSAP Adapter. IntheSAP Adaptermenu,clickListeners. OntheListenersscreen,clicktheCopyicon forthelistenerthatyouwanttocopy.
95
Deleting Listeners
Ifyounolongerwanttousealistener,usethefollowinginstructionstodeletethelistener. YouusetheAdministratortodeletelisteners. Important! IfyoudeleteanSAPAdapterlistener,anynotificationsthataredefinedtouse thelistenerwillnolongerwork.Youcannotchangewhichlisteneranotificationusesafter thenotificationisconfigured.However,youcanchangetheparametersforanexisting listener.Forinstructions,seeEditingListenersonpage 94.
To delete a listener 1 2 3 IntheAdaptersmenuinthenavigationareaoftheAdministrator,clickSAP Adapter. IntheSAP Adaptermenu,clickListeners. OntheListenersscreen,makesurethatthelistenerisdisabledbeforedeletingit.To disablethelistener,seeDisablingListenersonpage 97fordetails. OntheListenersscreen,click forthelisteneryouwanttodelete.
TheIntegrationServerdeletesthelistener.
Suspending Listeners
Youcansuspendlistenersforanindefiniteperiodoftime.Suspendedlistenerscannotbe editedordeleted. Important! SuspendinglistenersfortheSAPAdapterhasthesameeffectasdisablingthem. Formoreinformationaboutdisablinglisteners,seeDisablingListenersonpage 97.
To suspend a listener 1 2 3 IntheAdapters menuinthenavigationareaoftheAdministrator,clickSAP Adapter. IntheSAP Adaptermenu,clickListeners. OntheListenersscreen,selectSuspendedfromthelistintheStatefield.The IntegrationServerAdministratorsuspendsthelistener. TheSuspend all enabledlinkhelpsyouchangethestatequicklyformultiplelisteners. Whenyoususpendalistener,theactionmaynottakeeffectrightaway.Youmayhaveto waitaslongasthetimespecifiedintheTimeoutparameterforthelistener.Ifoneormore messagesappearonthequeuewithinthattimeinterval,theadaptermayreceiveand processthefirstmessage.
96
Listener Notifications
Disabling Listeners
Listenersmustbedisabledbeforeyoucaneditordeletethem.Youdisablelistenersusing theAdministrator. To disable a listener 1 2 IntheAdapters menuinthenavigationareaoftheAdministrator,clickSAP Adapter. IntheSAP Adaptermenu,clickListeners. TheListenersscreenappears. 3 SelectDisabledfromthelistintheStatefield.TheIntegrationServerAdministrator disablesthelistener.
Listener Notifications
ThefollowingsectionsprovideinstructionsforconfiguringandmanagingSAPAdapter listenernotifications.TheSAPAdapterhasthreetypesoflistenernotificationsthatyou canconfigure: RFClistenernotifications(synchronous) ALElistenernotifications(synchronous) ALElistenernotifications(asynchronous) Formoreinformationonhowlistenernotificationswork,seeAdapterListenersand ListenerNotificationsonpage 31.
97
4 5 6
UsingtheAdministrator,makesurethattheWmSAPpackageisenabled.Toverify thestatusoftheWmSAPpackage,seeEnablingandDisablingPackagesonpage 44. ConfigurealistenerusingtheAdministrator.Formoreinformationonhowto configureanewlistener,seeConfiguringanRFCListeneronpage 87. UsingtheDeveloper,createauserdefinedpackagetocontainthelistener,ifyouhave notalreadydoneso.Formoreinformationaboutmanagingpackages,seePackage Managementonpage 41.
98
Listener Notifications
99
10 SelecttheFunction Searchtabtoverifyormodifythefollowing: Property Function Pattern Description AllorpartofthenameofthefunctionmoduleontheSAP system. Enterawildcardlikepatternforthefunctionmodulefor whichyouwantcreatethenotification.Youcanuseexact patterns,orpatternswithsingleormultiplewildcard characters. Group Pattern AllorpartofthenameoftheFunctionGroupontheSAP system. EnterawildcardlikepatternfortheFunctionGroupfor whichyouwantcreatethenotification.Youcanuseexact patterns,orpatternswithsingleormultiplewildcard characters. Function Name Function Description Group Name Theresultingfunctionmodulenamematchingtheprovided pattern. Thefunctionmoduledescription,ifitisavailableforthat functionmodule. Thegroupnamethefunctionmodulebelongsto.
11 Selectthe Request Field Selectiontabtospecifywhichfieldsshouldmatchthearriving messagetorunthenotification. SelectthefieldsbyselectingtheappropriateboxesintheUsecolumn.Youcanalso selectallfieldsbyusingtheCheck all rowsicon Uncheck all rowsicon . ordeselectallfieldsbyusingthe
100
Listener Notifications
12 Selectthe Reply Field Selectiontabtospecifywhichfieldsshouldmatchthereturning messagefromthenotification. SelectthefieldsbyselectingtheappropriateboxesintheUsecolumn.Youcanalso selectallfieldsbyusingtheCheck all rowsicon Uncheck all rowsicon . ordeselectallfieldsbyusingthe
13 SelecttheAdditional SettingstabtosettheForward confirm eventflag.Formore informationabouttheForwardConfirmEventFlag,seeForwardConfirmEvent Flagonpage 81. 14 SelectthePermissionstabtomanagetheaccesscontrollist(ACL)information.Usethe dropdownmenutoselecteachoftheACLtypes.Forgeneralinformationabout assigningandmanagingACLs,seethewebMethodsDeveloperUsersGuide. 15 FromtheFile menu,selectSave (orSave All).
101
Note: YoucannoteditanyfieldsorpropertiesonthePublications Propertiestabfor theSynchronousRequestandReplyDocumentTypes.TheIntegrationServer doesnotpublishthesedocumenttypes. 9 Intheadapternotificationserviceeditor,youcanselecttheAdapter Settingstabatany timetoconfirmthefollowinglistenernotificationproperties: Adaptername Adapterlistenername Adapternotificationtemplate AdapternotificationserviceToeditthisservice,seeEditingSynchronous ListenerNotificationServicesonpage 103. 10 SelecttheIDoctabtoverifyormodifythefollowing: Property IDoc type Cim type SAP system release Old IDoc type 2 Monitor IDocs Description IdentifiesthetypeofIDocexpectedbythelistener notification. TheIDoctypeextension(CIMtype/customerextension type). TheIDocrelease. TheIDocversion;uncheckedforanewversion3IDoc, checkedforoldversion2IDocs(likein3.1SAPsystems). SettoOntohavetheSAPAdapterlinktheIDocpackets TIDwiththeDOCNUMsoftheIDocsinthatpacketsothat laterALEIDocMonitoringwillbepossible.SettoOffto preventlinkingtheTIDwiththeDOCNUMS.
11 Selectthe Request Field Selectiontabtospecifywhichfieldsshouldmatchthearriving messagetorunthenotification. SelectthefieldsbyselectingtheappropriateboxesintheUsecolumn.Youcanalso selectallfieldsbyusingtheCheck all rowsicon Uncheck all rowsicon . ordeselectallfieldsbyusingthe
12 SelecttheAdditional SettingstabtosettheForward confirm eventflag.Formore informationabouttheForwardConfirmEventFlag,seeForwardConfirmEvent Flagonpage 81. 13 SelectthePermissionstabtomanagetheaccesscontrollist(ACL)information.Usethe dropdownmenutoselecteachoftheACLtypes.Forgeneralinformationabout assigningandmanagingACLs,seethewebMethodsDeveloperUsersGuide.
102
Listener Notifications
To edit the notification service 1 2 3 4 5 FromDeveloper,intheadapternotificationserviceeditor,selecttheAdapter Settings tab. OpentheSelect Menuforthatservice. Selectanewservice. ClickOK. FromtheFile menu,selectSave (orSave All).
103
Intheadapternotificationserviceeditor,youcanselecttheAdapter Settingstabatany timetoconfirmthefollowinglistenernotificationproperties: Adaptername Adapterlistenername Adapternotificationtemplate 8 SelecttheFunction Searchtabtoverifyormodifythefollowing: Property Function Pattern Description AllorpartofthenameofthefunctionmoduleontheSAP system. Enterawildcardlikepatternforthefunctionmodulefor whichyouwantcreatethenotification.Youcanuseexact patterns,orpatternswithsingleormultiplewildcard characters. Group Pattern AllorpartofthenameoftheFunctionGroupontheSAP system. EnterawildcardlikepatternfortheFunctionGroupfor whichyouwantcreatethenotification.Youcanuseexact patterns,orpatternswithsingleormultiplewildcard characters. Function Name Function Description Group Name 9 Theresultingfunctionmodulenamematchingtheprovided pattern. Thefunctionmoduledescription,ifitisavailableforthat functionmodule. Thegroupnamethefunctionmodulebelongsto.
104
Listener Notifications
105
Selectthe Request Field Selectiontabtospecifywhichfieldsshouldmatchthearriving messagetorunthenotification. SelectthefieldsbyselectingtheappropriateboxesintheUsecolumn.Youcanalso selectallfieldsbyusingtheCheck all rowsicon Uncheck all rowsicon . ordeselectallfieldsbyusingthe
106
Listener Notifications
4 5
107
To edit the document types 1 2 3 IntheDeveloper,expandthepackageandfolderthatcontainthedocumenttypethat youwanttoedit. Openthelistenernotificationforthedocumentthatyouwanttoedit. SelecttheRequest Field SelectionorReply Field Selectiontabandmodifytheavailable valuesforthedocumenttypesparametersasneeded.Fordetaileddescriptionsofthe documenttypesparameters,seetheappropriateprocedureforthatlistener notificationtype.
108
Listener Notifications
109
Examples
Creating a Synchronous RFC Adapter Notification
ThefollowingtutorialexplainshowtoassigninboundRFCstoservicesontheIntegration Server.ItdescribesanapplicationinwhichtheSAPsystemrequestsaservicetoretrieve informationaboutaproduct. Note: AnSAPAdapterinboundcallisanoutboundcallfromtheSAPsystemspointof view.
To create a function module in an SAP system 1 2 3 4 5 UsingtheSAPGui,gototheABAP Function Library.SelectTools (SE37). ABAP Workbench
Createafunctiongroup,forexample:Z_FG01(MenuGoto/Functiongroups/Create group). EnterZ_IS_PRODUCTinfieldFunction module.ThisisthenameofyourSAPproduct retrievalfunction. SelectCreate. CompletethefollowingdialogsinaccordancewiththepoliciesgoverningyourSAP developmentenvironment.TheonlyaspectrelevanttotheSAPAdapteristhefield Processing type.SelectRemote-Enabled Moduletoallowthisfunctiontocallexternallyto theSAPAdapter. Definetheimport/exportparametersofyourfunction.Addanimportnamedsku. YoumustprovideanReference Typefield.Pickacharacterfieldwithalengthgreater than5.Forthisexample,useCHAR100. Addsixexports:name,product_type,product_length,product_width,price, availability.Again,youmustprovideReference Typefieldsforeachoftheexports. Forthistutorial,useCHAR100fortheseparameters.
110
Examples
8 9
111
6 7
Selecttheservicethatshouldbeinvokedbythisadapternotification.(Inthiscase, app:getProductData.)ClickNextandthenFinish. OntheFunction Searchtab,intheFunction Patternfield,enterallorpartofthenameof thefunctionmoduleforwhichyouwanttocreateanRFCadapternotification.Use patternmatchingcharactersifyouareunsureofthecompletenameandwantthe SAPAdaptertosearchforseveralRFCswithsimilarnames. Forthisexample,enterZ_IS_*intheFunctionPatternfield. AlistofRFCnamesthatmatchthecriteriaisdisplayed.
ClickSaveontheDevelopertosaveyourRFCadapternotification. Leaveallotherfieldsattheirdefaultvalues.
112
Examples
Execute(F8)theRFCbyselectingtheappropriatetoolbarbuttonorselectingExecute fromtheFunction modulesmenu. Youwillreceivetheproductdatainyourexportslistsimilarasshowninthe followingfigure. Note: IfyoureceiveanerrorfromtheSAPAdapter,makesureyourRFCadapter notificationiscorrectandthatthe app:getProductData flowserviceisavailableand functional.
113
114
Examples
115
Define the Input and Output Signatures for the mapOrders02 Service
ThisservicemapsanORDERS02IDoctoaspecificPurchaseOrderformat.Todothis,you needtodefinetheinputandoutputsignaturesfortheservice. To define the input and output signatures 1 2 3 OpenthemapOrders02serviceandselecttheInput/Outputtab. FortheInputfield,opentheSelectdialogandselectthe apps\idocs\Orders02RequestDocument. FortheOutputfield,opentheSelectdialogandselectthe WmSAP\sample\sap\records\PurchaseOrderdocument.
116
Examples
Whenyouarefinishedtesting,deletetherestorePipelineFromFileserviceandsavethe finishedflow.
Create an RFC Destination YoumustcreateanRFCdestinationontheSAPsystem.Forinstructionsonhowtocreate anRFCDestination,refertoCreatinganRFCDestinationonanSAPSystemonpage 84. Define a Logical Port Thelowerlevelnetworkingrequiresthatasystemportnumberbeassociatedwiththe RFCdestination.Thelogicalportidentifiestheporttowhichmessagesaresent.The logicalportcanonlybeusedifanRFCDestinationwaspreviouslycreated. YoucandefineauniquelogicalportusingWE21(alternatively,usethefollowingmenu pathtodothis:Main screen Tools Business Communication IDoc-Basis IDoc Port Definition). 1 2 3 4 SelecttheTransactional RFC treeitemandclickCreate. Onthetoolbar,click New Entries. Eitherselectyourowndescriptiveportnameorletthesystemgenerateone. EntertheIDocversionyouwanttosendviathisport,theRFCdestinationyoujust created,andashortdescriptionofyourlogicalport,andthensavetheinformation.
117
Create a Partner AlogicalsubsystemmanagesoneormoreRFCDestinations.Youcancreateapartner (logicalsystem)usingSPRO_ADMIN(alternatively,usethefollowingmenupathtodothis: Main screen Tools AcceleratedSAP Customizing Project Management). 1 2 SelectSAP Reference IMG. Expandthefollowingnodes:Basis Components Application Link Enabling (ALE) Sending and Receiving Systems Logical Systems Define Logical System.(Youcan alsouseSALEandselectthepathdescribedabove,startingwithApplicationLink Enabling(ALE). SelectDefine Logical System. ClickNew Entries. Enteraninformativenameforyourpartnerandprovideashortdescription.After savingthepartnerinformation,assignittoaworkbenchrequest.
3 4 5
Create a Partner Profile UseWE20tocreateapartnerprofile(alternatively,usethefollowingsequencetodothis: Main screen Tools Business Communication IDoc-Basis IDoc Partner profile). 1 2 3 4 5 6 7 8 9 SelecttheLS (logical system) partnertypeinthetreeviewandclickCreate. EnterinthePartnerfieldthepartneryoucreatedinCreateaPartneronpage 118, andsavethepartnerprofile. Belowtheoutboundparametertablecontrol,clickInsert entry. EnterthemessagetypeoftheIDoc,(forexample:MATMAS). EnterthelogicalreceiverportyoucreatedbeforeandenterthebasictypeoftheIDoc, (forexample:MATMAS03). Savetheoutboundparameter. Belowtheinboundparametertablecontrol,clickInsert entry. EnterthemessagetypeoftheIDoc,(forexample:MATMAS)andtheprocesscode,(for example:MATM). Savetheinboundparameter.
118
Examples
Create a Distribution Model for the Partner and Message Type Afteryoudefineapartnerandpartnerprofile,youcancreateadistributionmodelthat triggersthecreationofacommunicationIDoc. IfyouareusingSAPsystem4.5orearlier,youcanuseBD64tocreatethedistribution model(alternatively,usethefollowingsequencetodothis:Main screen Tools Business Framework ALE Customizing). 1 2 3 4 OpentheCross-Application Componentsfolder,thentheDistribution (ALE) folder,thenthe Distribution Customer Model folderinthetreeview. SelectMaintain customer distribution model. CreateanewmodelusingModel Create.
Addamessagetypetoyourmodel,enterthesenderinthedialogbox(forexample:, CERCLNT800),enterthereceiver(yourlogicalsystem),andthemessagetype(MATMAS).
IfyouareusingSAPsystem4.6orlater,youcanuseBD64oralternatively,thefollowing procedure: 1 2 3 4 5 6 7 8 9 IntheMainscreen,selectTools SelectSAP Reference IMG. Expandthefollowingnodes:Basis Components Distribution (ALE) Modelling and Implementing Business Processes Maintain Customer Distribution Model. SelectMaintain Customer Distribution Model(BD64). Changeintotheeditmode. SelectCreate modelview. Enterashorttextstringandatechnicalnameforyournewmodelview. SelectyournewmodelviewinthetreeDistribution Model,andselectAdd message type. Inthedialogbox,enterthesender(forexample:CERCLNT800),thereceiver(your logicalsystem),andthemessagetype(MATMAS). AcceleratedSAP Customizing Project Management.
119
120
CHAPTER
121
C H A P T E R 7 G e n e r a t i n g D o c u m e n t Ty p e s
To create a document type using the DDIC 1 2 3 4 5 6 7 OpentheDeveloper. OntheFilemenu,selectNew. OntheNewpanel,selectSAP Document TypeandthenclickNext. OntheNewSAPDocumentTypepanel,selectRFCandclickNext. SelecttheSystem IDandclickNext. SelecttheSAP Structure.Ifnostructureshavebeencached,youmusttypethestructure nameintothefield.ClickNext. Namethedocumenttypeandselectthefolderwhereitwillbeplaced.ClickFinish.
To create a document type using the DDIC 1 2 3 4 OpentheDeveloper. OntheFilemenu,selectNew. OntheNewpanel,selectSAP Document TypeandthenclickNext. OntheNewSAPDocumentTypepanel,selectIDocandclickNext.
122
5 6 7
SelecttheSystem IDandclickNext. SelecttheIDoc type.IfnoIDocshavebeencached,youmusttypetheIDoctypeintothe field. Completetheremainingfieldsasfollows: Field Cimtype SAPsystemrelease OldIDoctype2 Description/Action TheIDoctypeextension(CIMtype/customerextension type). TheIDocrelease. TheIDocversion;uncheckedforanewversion3IDoc, checkedforoldversion2IDocs(likein3.1SAPsystems).
Oroptionally,leavethemblank.ClickNext. 8 Namethedocumenttypeandselectthefolderwhereitwillbeplaced.ClickFinish.
To create a document type from an IDoc DTD 1 2 3 4 OpentheDeveloper. OntheFilemenu,selectNew. OntheNewpanel,selectDocument TypeandthenclickNext. OntheNew Document Typepanel,dothefollowing: a b IntheFoldertree,selecttheFolderintowhichyouwanttosavethedocumenttype definition. IntheNamefield,typeanameforthedocumenttypeusinganycombinationof letters,numbers,and/ortheunderscorecharacter.(Youmightwanttoincludethe nameoftheIDocinthename.)
5 6
123
C H A P T E R 7 G e n e r a t i n g D o c u m e n t Ty p e s
7 8 9
10 ClicktheSavebutton.
5 6 7
PressFinish. NowswitchtotheemptyFlowServiceyoujustcreated. Click ontheFlow Panetoolbar,andselectthepub.flow:savePipeline service.(Ifthis servicedoesnotappearinthelist,selectBrowsetofindit.)Thisservicewillcopythe contentsofthepipelinesothatyoucanretrieveitinalaterstage.(Lateronthe savePipelinestepwillbedeletedfromyourflowagain.Itspurposeissimplytocapture acopyoftheIDocitisnotapermanentpartofyourflow.) SelectthePipelinetab.
124
Selectthe$namevariableunderService In,andclick
onthetoolbar.
12 SendyoursampleIDoctothisserviceasdescribedbelow: UsetheSAPGuiortheutilityat/WmSAP/submitIDocXML.htmltosubmityoursample IDocorsimplysendanIDocoverHTTPtotheroutinglistener.Specifysender,receiver, andmsgTypeasspecifiedfortheroutingnotificationthatshouldinvokethe app:mapOrders02service.Formoreinformationonhowtocreatearoutingnotificationsee ConfiguringaRoutingNotificationonpage 134. Makesurethatthedocumentyousubmitisacomprehensiveexamplethatcontainsall possiblefieldsforthatIDoc.Whentheroutinglistenerreceivesthisdocument,itinvokes theflowserviceyoucreatedabove,whichcapturestheIDocbymakingacopyofthe pipeline.Inthenextstep,youwillretrievethesavedimageofthepipeline. Note: ThepipelineimagecreatedbythesavePipelineoperationisstoredinmemoryandcan berecalledbyanysubsequentservice.However,theimageisnotstoredondisk.Ifthe serverisrestarted,itwillnolongerbeavailable.Youcancreateapermanentcopyby usingsavePipelineToFileinstead.
Use the following procedure to retrieve the pipeline image you created: 1 2 3 IntheDeveloper,createanewFlowthesameway,youcreatedapp.idocs:mapOrders02 SelecttheFlowtab. Select ontheFlow Panetoolbarandselectthepub.flow:restorePipelineservice.(If thisservicedoesnotappearinthelist,selectBrowsetolocateit.)Thisservicewill retrievethecontentsofthepipelineyousavedpreviously. Setinputfield$nameofthisservicetothenameofthesavedpipelineandselectOK. Asthenextstepofthisserviceinsertpub.xml:xmlNodeToDocument (tobefoundalsointhe WmPublicPackage),iftheIDocwassenttotheSAPAdapterviahttp,or pub.sap.idoc:iDocToDocument(tobefoundintheWmSAPPackage),iftheIDocwassentto theSAPAdapterfromanSAPsystemviatRFCorfromthesamplepage /WmSAP/submitIDocXML.html. Click tosavethisflowservice.
4 5
125
C H A P T E R 7 G e n e r a t i n g D o c u m e n t Ty p e s
126
CHAPTER
127
Introduction
ThischapterdescribeshowtoroutemessagesthroughtheSAPAdapter. WhentheSAPAdapterreceivestheIDocorRFC,itmatchesthesender,receiver,and messagetypeassociatedwiththeIDocorRFCtoitsroutingnotifications.Whenitlocates amatchingroutingnotification,thisisinvokedtoroutetheIDocorRFC.
Thischapterincludesinformationabouthowto: Createandmaintainroutingnotifications Updateservicesthatprocessroutingnotifications MapIDocstootherformats UsecontentbasedroutingforIDocsandarbitraryXMLdocumentsaswellas outboundmappingforIDocs Forspecificinformationabouthowto: Route... RFCs Through the SAP Adapter, see... SendinganRFCfromanSAPSystemtotheSAPAdapteron page 140andRoutingRFCsThroughtheSAPAdapteron page 149 SendingaBAPIfromanSAPSystemtotheSAPAdapteron page 146andRoutingBAPIsthroughtheSAPAdapteron page 103
BAPIs
128
Overview
Route... IDOCs
Through the SAP Adapter, see... SendingIDocswithALEfromanSAPSystemtoanSAP Adapteronpage 149andRoutingIDocsthroughtheSAP Adapteronpage 121 RoutingArbitraryXMLDocumentsThroughtheSAPAdapter onpage 166
XML
Overview
Normally,theRFCsandIDocssenttotheSAPAdapterfromanSAPsystemareassigned toaspecificservicebyanadapternotification.However,insomecases,youmightwantto routeanRFCorIDocthroughtheroutinglistener. TheSAPAdapterincludesadefaultroutinglistenerthatmanagestheroutingof messages.Itdetermineshowandwheretorouteamessagebasedonroutingnotifications thatyoudefine.Eachroutingnotificationisassociatedwithatransportthatwillbechosen andinvokedwhentheroutingnotificationiscalled. Whentheroutinglistenerreceivesamessage,itperformsaroutingnotificationlookup. Afterlocatingtheroutingnotificationfortheincomingmessage,thespecifiedoutbound transportgetsinvoked. Routingnotificationsindicatehowamessageistobeprocessed.Eachroutingnotification isuniquelyidentifiedbyitssender,receiver,andmessagetype.WhentheSAPAdapter receivesamessage,itperformsaroutingnotificationlookuptomatchthesender,receiver, andmessagetypeoftheincomingmessagewiththesender,receiver,andmessagetypeof theexistingroutingnotifications. Ifamatchingroutingnotificationisfound,theSAPAdapterprocessesthemessageasthe routingnotificationindicates.Ifaroutingnotificationisnotdefinedforthemessage, processingofthemessagewillbeabortedwithanexceptionthrown. Theroutingnotificationidentifiesatransport,whichindicateshowandwhereamessage istoberouted.Thetransportsyoucanspecifyallowyoutorouteamessagetoaservice, routeanIDoctoanSAPsystemviatRFC,routeanRFC/BAPItoanSAPsystemvia RFC/tRFC,orpostanIDocXML,RFCXML,orbXMLmessagetoaURL.
129
4 5
130
Overview
Note: FortheMessagetypesORDERSandORDRSP,asamplecontentbasedrouting serviceisshippedwiththeSAPAdapter. Thisreplacesthesender/receiverinformationfromtheIDoccontrolrecord(SNDPRNand RCVPRN)bypartnerinformationfromtheE1EDKA1segment.Ifthisisnotdesired, disablethisContentBasedRoutingfromAdapters> SAP Adapter>Routing/Mapping. Youcanwriteyourownserviceforroutingbasedonthefieldswhichareusedinyour environment.YoucanuseContentBasedRoutingforthispurpose. RefertoConstructinganIDocwiththeSAPJavaIDocClassLibraryonpage 194and Appendix D,BuiltinServicesfortheAPIstoparsetheIDoc.
131
Example
Supposethatyouhaveroutingnotificationssetupwiththefollowingvaluesand notificationorder: Sender
1 2 3
CERCLNT800 * CERCLNT750
Ifamessagearriveswiththefollowingvalues:
132
Overview
Sender=CERCLNT800 Receiver=partner1 msgType=ORDERS itwillberoutedaccordingtothefirstroutingnotificationasithasahigherranking comparedtothesecondroutingnotification. Analogously,amessagewiththevalues: Sender=CERCLNT750 Receiver=partner1 msgType=ORDERS wouldberoutedaccordingtothesecondnotification,notthethird. To edit the notification order of a listener 1 2 3 IntheAdaptersmenuinthenavigationareaoftheadministrator,clickSAP Adapter. IntheSAP Adaptermenu,clickListeners. Selecttheroutinglistener(wm.sap.internal.ls:routingListener)andchangetheStateto Disabled. ClicktheEditicon fortheroutinglistener.
4 5 6 7 8 9
OntheEditListenerscreen,clickEdit Notification Order. OntheEditNotificationOrder screen,usetheUpandDown buttonstodeterminethe processingorderinwhichtheSAPAdapterinvokesthenotifications. ClickSave Changestosavethenotificationorderofthelistener. Click Return to Edit ListenerstoreturntotheEditListenersscreen. ClickReturn to SAP Adapter ListenerstoreturntotheListenersscreen.
10 ChangetheStateoftheroutinglistenertoEnabled.
133
Basedonthetransportyouselect,theNotificationEditordisplaysadditionalfields requiredbytheselectedtransport.
Routing Notifications
Configuring a Routing Notification
Usethefollowingproceduretocreatearoutingnotification. To create a routing notification 1 2 3 4 5 6 7 8 OpentheDeveloperandselectNew Adapter Notification.ClickNext.
SelectSAP Adapterfromthelistofavailableadaptertypes.ClickNext. Fromthelistofavailabletemplates,selectRouting Notification.ClickNext. Selecttheroutinglistenerwm.sap.internal.ls:routingListener.ClickNext. Enteranameandselectafolderwheretheroutingnotificationshouldbestored.Click Next. Selecttheservicethatshouldbeinvokedbythisroutingnotification.ClickNextand thenclickFinish. TypeinvaluesforfieldsSender,Receiver,andMessage Typetoassigntherouting notificationforcorrespondinginboundmessages. SelectoneofthefollowingtransportsfromtheTransportfieldandspecifythe additionalinformationthatisspecifictothetypeoftransportyouselect.For informationabouttheadditionalparametersthatyouneedtosupplyforeach transport,refertothepageindicatedbelow.
134
Routing Notifications
10 EnabletheroutingnotificationthroughtheIntegrationServerAdministrator.
IS Transport
Usethistransporttoroutemessagestoanotherservicethatexecutesonthelocalmachine oronaremoteIntegrationServer.Theentirepipelineissubmittedtothespecifiedrouting notificationservice.IfyouconnecttoaremoteIntegrationServer,youshouldeditthe assignedserviceofthisroutingnotificationandaddaMAPstepbeforetheinvokestep pub.remote:invoke,whereyoudropallunnecessaryparametersfromthepipelineso thattheamountofdatasentoverthenetworkisassmallaspossible.TheISTransport supportstheForwardConfirmeventfeature.Incaseof$actionsetto4(Confirmevent), theassignedserviceiscalledasecondtime.Youcanaddpreandpostprocessingstepsto thepipelineifyouwraptheserviceyouwantinvokeandassignthewrapperservicetothe routingnotification. Tip! WhensendinganIDocoranRFCbetweentwoSAPAdaptersusingtheIStransport,if thereceivingSAPAdapterisofalowerreleasethan6.5andyouaresendinganIDoc,you needtoaddasanadditionalinvokesteptheservicepub.sap.idoc:iDocToTables.Thisis becauseolderSAPAdapterreleasesdonotunderstandthenewinternalIDocformat,but insteadexpectthetwotablesIDOC_CONTROL_REC_40 and IDOC_DATA_REC_40.
135
ALE Transport
UsethistransporttorouteanIDoctoanSAPsystemviatRFC.Beforeyoucanroutean IDoctoanSAPsystem,youmustdefinetheRFCconnectiontothatSAPsystem.For instructions,refertoConfiguringAdapterConnectionsonpage 56. SettheConfigureALETransportparametersasfollows: Key serverName Value NameoftheSAPsystemtowhichyouwanttoroutetheIDoc. SelectanRFCconnectionaliasfromthedropdownlist. ThedropdownlistcontainstheRFCconnectionaliasesasdefined ontheSAPAdapter.ForinstructionsonhowtodefineanRFC connectiontoanSAPsystem,refertoConfiguringAdapter Connectionsonpage 56.
RFC Transport
UsethistransporttorouteanRFCtoanSAPsystemviaRFCortRFC. Setthetransportparametersasfollows: Key serverName Value NameoftheSAPsystemtowhichyouwanttoroutetheRFC. SelectanRFCconnectionaliasfromthedropdownlist. ThedropdownlistcontainstheRFCconnectionaliasesasdefined ontheSAPAdapter.ForinstructionsonhowtodefineanRFC connectiontoanSAPsystem,refertoConfiguringAdapter Connectionsonpage 56.
136
Routing Notifications
BAPI Transport
UsethistransporttorouteanBAPItoanSAPsystemviaRFCortRFC. Setthetransportparametersasfollows: Key serverName Value NameoftheSAPsystemtowhichyouwanttoroutetheBAPI. SelectanRFCconnectionaliasfromthedropdownlist. ThedropdownlistcontainstheRFCconnectionaliasesasdefined ontheSAPAdapter.ForinstructionsonhowtodefineanRFC connectiontoanSAPsystem,refertoConfiguringAdapter Connectionsonpage 56. Processing restrictions Processingrestrictions:SomeBAPIscanbecalledbothsynchronouslyand asynchronously.Callerscanchoosehowtheywanttoexecuteacallbyspecifyinga transactionidintheXMLheader(seeAppendix G,UsingBizTalkEnvelopeswiththe SAPAdapter).Ifyouonlywanttoallowonespecifictypeofcall(forexamplefor performancereasonsonlyasynchronouscalls,orforadministrationreasonsonly synchronouscalls).Youcandefinerestrictionsusingthedropdownlist: no restrictions synchronous only Callermaydecidetosendbothsynchronous andasynchronouscalls. Callermayonlysendcallswithouta transactionID.MessageswithatransactionID (asynchronousmessages)arerejectedandan XMLerrormessageisreturned. Callermayonlysendcallswithatransaction ID.MessageswithoutatransactionID (synchronousmessages)arerejectedandan XMLerrormessageisreturned.
asynchronous only
137
XML Transport
UsethistransporttopostanSAPIDocorRFCXMLtoaURL. Setthetransportparametersasfollows: Key url xmlType Value URLtowhichyouwanttoposttheXMLmessage. SelectbetweentheXMLdialectsSAPXML,bXML,ValuesXML, ArbitraryXMLorSOAPXRFC(XRFCwithSOAPenvelope). IfyouselectSAP-XMLthecontenttypeissettoapplication/xsap.idoc (respectively .rfc).Thereforethereceivingserverhas tounderstandthiscontenttype.(Thiscanbeoverriddenusingthe followingflag.) IfArbitrary XMLisselected,thetransportexpectstheXML documentasstringinthevariablexmlData. useTextXml FlagthatallowsyoutooverwritethecontenttypeofbXML,SAP XMLtotext/xml,ifsettotrue.Thecheckboxisdisabledforother dialects. FlagthatallowsyoutoforcetherenderersofbXML,SAPXMLto usetheencodingutf8,ifsettotrue.Thecheckboxisdisabledfor otherdialects. SetthisflagifyouwanttousetheBAPIXMLformat.(Thisfieldis onlyactivewhenusingthebXMLdialect.) Thenameofthebusinessobjecttowhichthecallshouldbe mapped.Thisvalueiscasesensitive.(Availableonlywhenusing thebXMLdialectandtheBAPIformat.) ThenameoftheBAPImethod,towhichthecallshouldbe mapped.Thisvalueiscasesensitive.(Availableonlywhenusing thebXMLdialectandtheBAPIformat.) Anoptionalparameterthatallowsyoutospecifyausernamefor authenticationontheremoteWebsystem. Anoptionalparameterthatallowsyoutospecifyapasswordfor authenticationontheremoteWebsystem.
useUTF8
useBAPI objectName
bapiName
httpUser httoPassword
138
Routing Notifications
Tip! WhensendinganIDocbetweentwoSAPAdaptersviaXMLtransport,use
http://<hostname>:<port>/invoke/pub.sap.transport.ALE/InboundProcessas
URL. WhensendinganRFCtoasecondSAPAdapteroverHTTP,use
http://<hostname>:<port>/invoke/pub.sap.transport.RFC/InboundProcessas
139
Selecttheroutingnotificationyouwanttodeleteandclickthe column.
iconintheDelete
140
ThenameofthetablemustbeSBCHEADERanditmusthavethefollowingstructure. Component NAME VALUE Component type SBCNAME SBCVALUE DTyp CHAR CHAR Length 32 255 Dec. places 0 0 Short text SBCrouting table,Keyfield SBCrouting table,valueof Keyfield
receiver
141
IfyouwanttocontroltheroutingofanRFCfromtheSAPsystemdirectly(without requiringaroutingnotificationontheSAPAdapter),youcanincludetransport informationintheheadertable.ThetransportindicateswheretheSAPAdapteristoroute theincomingRFC.WhentheSAPAdapterreceivesanRFCthatspecifiesthetransport,it doesnotinvokearoutingnotificationbutdirectlypassestheRFCtothespecified transport.Thetransportsthatyoucanidentifyinaheadertabletodynamicallyroutean RFCthroughtheSAPAdapterare: RoutetheRFCtoanIntegrationServerservice RoutetheRFCtoanSAPsystem PosttheRFCXMLtoaURL Thefollowingdescribesthekey/valuepairsyoumustspecifyforeachtransportyoucan specify. To route the RFC to an Integration Server service, use the Integration Server service transport. Key
transport
Value
IS
Thisvalueidentifiesthetransport.Specifythevalueexactlyas specifiedabove
serverAlias
NameoftheIntegrationServeronwhichtheservicetoinvoke resides.Iftheserviceresidesontheserverthatroutesthe message,specify(local).Otherwise,specifyanaliasfora remoteserver.Fortheroutingtobesuccessful,theserver routingtheRFCmusthavethedefinedaliasfortheremote server. Nameofthefolderinwhichtheserviceresides.Thefolder nameiscasesensitive;usetheexactcombinationofupperand lowercaseletters. NameoftheservicetowhichtopasstheRFC.Theservice nameiscasesensitive;usetheexactcombinationofupperand lowercaseletters. WhereyouwanttheSAPAdaptertostoretheconnectionto theremoteserver. Tosavetheconnectioninyourownsession,specifySESSION. UseSESSIONwhentheworkbeingperformedrequiresstatebe maintained. Tosavetheconnectioninasharedarea,specifyGLOBAL.Use GLOBALwhentheworkbeingperformedisstateless.
folderName
serviceName
valueScope
142
To route the RFC to an SAP system, use the RFC transport. Key
transport
Value
RFC
Thisvalueidentifiesthetransport.Specifythevalueexactlyas specifiedabove
serverName
RFCConnectionaliastowhichyouwanttheRFCrouted.
Value
XML
Thisvalueidentifiesthetransport.Specifythevalueexactlyas specifiedabove
url xmlType
URLtowhichyouwanttoposttheRFC. TheXMLformatyouwanttheroutinglistenertouseforthe RFC.SpecifySAPXMLifyouwanttheRFCinanXMLformat thatiscompliantwiththeSAPXMLspecification.Specify Values-XMLifyouwanttheRFCinwebMethodsnativeXML format. Usernametosupplyforausername/passwordauthentication challenge(optionally) Passwordtosupplyforausername/passwordauthentication challenge(optionally)
httpUser
httpPassword
143
AwrapperforZ_DEMO_COPYcouldlooklikethis:
FUNCTION Z_WRAPPER_DEMO_COPY. *"-----------------------------------------------------------------*"*"Lokale Schnittstelle: *" IMPORTING *" VALUE(INPUT) TYPE CHAR255 OPTIONAL *" VALUE(DESTINATION) TYPE CHAR32 *" EXPORTING *" VALUE(OUTPUT) TYPE CHAR255 *" TABLES *" SBCHEADER STRUCTURE SBCCALLENV *"-----------------------------------------------------------------data: msg TYPE CHAR1024. CALL FUNCTION 'Z_DEMO_COPY' DESTINATION destination EXPORTING input = input IMPORTING output = output TABLES sbcheader = sbcheader EXCEPTIONS no_input_given = 1 communication_failure = 2 message msg system_failure = 3 message msg OTHERS = 4. CASE sy-subrc. WHEN 1. output = 'Exception received: NO_INPUT_GIVEN' . WHEN 2. concatenate 'COMMUNICATION_FAILURE received:' msg into output separated by space. WHEN 3. concatenate 'SYSTEM_FAILURE received:' msg into output separated by space. WHEN 4. output = 'Exception received: OTHERS'. ENDCASE. IF sy-subrc <> 0. WRITE output. ENDIF. ENDFUNCTION.
144
TheSAPsystemroutestheRFCtothespecifiedRFCDestinationISCER(which correspondstothenameoftheRFClistener).IntheSAPAdapter,theroutinglistener invokestheroutingnotificationthatcorrespondstothesenderCERCLNT800,receiver DELL,andmessagetypeZ_DEMO_COPY.TodeterminehowtheSAPAdapterroutes Z_DEMO_COPYfunctionmodule,youwouldneedtoinspectthecorrespondingrouting notificationthattheroutinglistenerinvokes. ThefollowingexampleillustrateshowtoroutetheZ_DEMO_COPYfunctionmoduleto theSAPAdapteranddirectlyinvokinganoutboundtransport.Whentestingthefunction modulefromtheSAPGUI,providethefollowinginputvalues: INPUT DESTINATION SBCHEADER Hello...! ISCER transport RFC serverName CERCLNT750 Inthiscase,theSAPsystemroutestheRFCtothespecifiedRFCDestinationISCER.Inthe SAPAdapter,theheadertablegetsinterpreteddirectlytodeterminehowtoroutethe RFC.TheSAPAdapterroutesthemessagetotheSAPsystemknownasCERCLNT750on theSAPAdapterusingtransportRFC.NotethatCERCLNT750mustcorrespondtothe connectionaliasofanRFCconnectionthatisconfiguredintheSAPAdapter.
145
146
Note: Theserviceyouselectedinstep 6willonlybeusediftheoutboundtransport thatischoseninyourroutingnotificationisIS.Forallotheroutboundtransports, thisselectionwillbeoverriddenbyatransportspecificservice. 7 8 9 SelectXMLintheTransportfieldtoselecttheXMLtransport. SelectbXML DialectforthexmlTypefield. EnteraURLasdestinationoftheXMLcall.ToposttheXMLtoanotherSAPAdapter, youcanpostthemessagetoitsBAPIinboundprocess.Forthis,youcanpostittothe URL.
http://<host>:<port>/invoke/pub.sap.transport.BAPI/InboundProcess.
10 SelectYesfortheuseBapifield. 11 EntertheobjectnameintheobjectNamefield.Forexample:CompanyCode. 12 EntertheBAPImethodthatyouwanttouseinthebapiNamefield.Forexample: GetList. 13 Optionallyyoucanspecifyausernameandpasswordforuserauthenticationonthe remotehost. Note: YoucanselectadditionaloptionsfortheXMLtransportconfiguration: Use text/xml as content type:FlagthatallowstooverwritethecontenttypeofbXML,SAP XMLtotext/xml,ifsettotrue.Thecheckboxisdisabledforotherdialects. Use utf-8 as encoding:FlagthatallowstoforcetherenderersofbXML,SAPXMLtouse theencodingutf8,ifsettotrue.Thecheckboxisdisabledforotherdialects. SOAP XRFCcanbeselectedasadditionalXMLdialect.ThisisequivalenttoXRFC(RFC XML)withaSOAPenvelope(higherthanSOAP1.1).
147
Value XML ThedestinationURLfortheHTTPpostoperation bXML Anoptionalparameterthatallowsyoutospecifyausernamefor authenticationontheremotewebsystem Anoptionalparameterwhichallowsyoutospecifyapasswordfor authenticationontheremotewebsystem SetthisvaluetoYESifyouwanttousetheBAPIXMLformat.If youomitthisvalueorsetittosomethingdifferentthanYES,the messagewillbesentasRFCbasedXMLinaBizTalkXML envelope Thenameofthebusinessobject,towhichthecallshouldbe mapped.Thisvaluehastobecasesensitive. ThenameoftheBAPImethod,towhichthecallshouldbe mapped.Thisvalueiscasesensitive Avaluethatshouldbeputintheheaderelement <from> <address>.SeesenderTypeforfurtherdetails Anoptionalformatdescriptor,definingthesenderaddresstype. DefaultisLogSysforlogicalsystems.Logicalsystemnamesare automaticallyconvertedtoanURNbyanSAPdefinedschema. Alternatively,youcansetsenderType Avaluethatshouldbeputintheheaderelement<to> <address>. SeereceiverTypeforfurtherdetails Anoptionalformatdescriptor,definingthereceiveraddresstype. DefaultisLogSysforlogicalsystems.Logicalsystemnamesare automaticallyconvertedtoanURNbyanSAPdefinedschema. Alternatively,youcansetreceiverType Flagthatallowstooverwritethecontenttypetotext/xml,ifsetto Yes(forSAPXMLandbXML). Flagthatallowstoforcetherendererstousetheencodingutf8,if settoYes(forSAPXMLandbXML).
useTextXml useUTF8
ForsendingRFCbasedXMLmessages,onlythefirstfiveparametersaresupported.You canspecifythisparametertoyourABAPRFCasfollows:
DATA header like SBCCALLENV occurs 1 with header line. *... some code lines omitted CALL FUNCTION 'BAPI_COMPANYCODE_GETLIST' DESTINATION 'ISCER'
148
149
YoucanposttothegeneratedproxyservicesURLfortheRFCfunctionmodules,ortothe RFCroutinggateway
http://<server>:<port>/invoke/pub.sap.transport.RFC/InboundProcess
150
151
</body> </biztalk_1>
Transaction Control
YoucancontrolwhethertheBAPIshouldbecalledsynchronouslyviaRFCor asynchronouslyviaALEbythe <referenceID>elementintheBizTalkheader. Ifthe<referenceID>elementisspecifiedandcontainsavalidSAPtransactionID(TID), theBAPIoutboundprocessautomaticallychoosestheALEformat,otherwise,ifthe elementisomitted,themessagewillbeprocessedsynchronously. Forbothsynchronousandasynchronouscalls,technicalprocessingerrorsarereportedby anXMLresponsedocumentcontainingafaultdescriptor.
CalltheBAPIinthesamesessionusingHTTP CommittheservicewithanemptyPOSTusingHTTP
http://<host>:<port>/invoke/pub.sap.bapi/commit
ReleasethesessionbysendinganemptyPOSTusingHTTP
http://<host>:<port>/invoke/pub.sap.client/releaseSession
152
Synchronous Calls
ApplicationlevelresponsestosynchronousXMLrequestsarereportedusingaresponse businessdocumentintheHTTPresponse.Theresponsebusinessdocumentsfor synchronouscallsaredocumentedintheSAPInterfaceRepositoryandcontaina serializationofallexportingandchangingparametersoftheBAPIorfunctionmodule.
Example
SendingasynchronouscalltoanSAPsystem
153
Itreturnsaresponsebusinessdocument
Asynchronous Calls
AnasynchronouscallcanbeexecutedbyspecifyingatransactionIDintheBizTalkheader oftheXMLdocument.TheXMLelementusedisthe<referenceID>element(see descriptionoftheBizTalkXMLenvelope)inthe<receiver>sectionoftheBizTalk header. AtransactionIDshouldbeaglobaluniqueIDexpressedinhexadecimallettersand24 letterslong,forexample0A11449F652C394A34DE042F.Ifanasynchronousrequestcanbe transmittedwithouterrorsinsidetheSAPsystem,theSAPAdapterwillreturnaBizTalk envelopewithanemptybodyasconfirmationdocument.Iftherewereanyprocessing errors,thebodywillcontainafaultdescriptorelement.Theresultofanasynchronouscall canbecheckedinsidethetargetsystembyusingtheALEmonitoringservices(BD87)ina 4.6SAPsystem.PleaserefertoyourSAPsystemdocumentationforfurtherinformation onALEservices.
154
Example
SendinganasynchronousrequesttoanSAPsystembyspecifyingatransactionID
155
ReceivinganXMLconfirmationdocument
CheckingthecorrectapplicationlevelprocessinginsidethetargetSAPsystem(BD87 ina4.6systemorusetheIDoclistWE05):
156
157
Thissamplepagecanbeusedasatesttool.IfyouplantosubmitIDocsfromanHTML form,youcanusethispageassamplecode.
158
2 3 4
159
3 4 5 6
160
161
To map the IDoc to variables in the pipeline PerformthefollowingstepstoaddaDocumentTypedescribingthecontentandstructure oftheIDoc. 1 2 3 4 5 6 7 IntheDeveloper,selecttheFlowtab. IntheFlowPane,selecttheiDocToDocument / xmlNodeToDocumentoperation. SelectthePipelinetabandselectthedocumentvariableunderPipeline Out. Click onthetoolbarandselectDocument.
IntheNamefield,typethefullyqualifiednameofthedocumenttypeyoucreatedin CreatingaDocumentTypeforYourIDoconpage 160,orselectitintheFoldertree. ClickOK. TypeanameforthisdocumentandpressENTER.(YoucangivethisDocumentany nameyoulike,butwesuggestthatyouidentifytheIDocinthename.) Whenyoufinishthisstep,Pipeline Out shouldcontainadocumentthatdefinesthe structureofyourIDoc.(Donotsavetheflowatthisstage,becauseifyoudo,theyet unuseddocumentwillbedeletedagainfromtheservice...)
8 9
10 InPipeline Out,selecttheIDocdocumentandclickMap,ormapdocumenttotheIDoc documentusingdragandrelate: 11 ThePipelineEditorwillshowaconnectinglinebetweendocumentandtheIDoc documentyoucreatedinthepreviousprocedure. Performthefollowingstepstodefinethevariable(s)towhichyouwanttomap informationfromtheIDoc. To define the variable(s) to which you want to map information from the IDoc 1 SelectMaponthe Flow Panetoolbar. Note: MakesuretheMAPoperationappearsimmediatelyaftertheiDocToDocument / xmlNodeToDocumentoperation.Ifnecessary,usethearrowbuttonsonthetoolbarto moveittothecorrectposition. 2 3 SelectthePipelinetab. InPipeline Out,selectthebottommostvariable,andthen
162
4 5 6
Click
onthetoolbar,andselecttheDocumentReference.
2 3
Whenyouarefinishedtesting,deletetherestorePipelineFromFileserviceandsavethe finishedflow.
163
2 3
164
Providethefullservicenameandthemessagetypeintheinputfield,andthenclick Register.
Arouting/mappingservicehastousethefollowingspecificationsforproperbehavior: Specification pub.sap.transport.ALE:aleRoutingInfo pub.sap.transport.ALE:aleRoutingInfo _Default pub.sap.transport.ALE:aleMappingInfo pub.sap.transport.ALE:aleMappingInfo _Default Description Specificationthatshouldbeusedforserviceswhich provideaninboundcontentbasedrouting/mapping. Specificationthatshouldbeusedforserviceswhich provideadefaultinboundrouting/mapping Specificationthatshouldbeusedforserviceswhich provideanoutboundcontentbasedmapping. Specificationthatshouldbeusedforserviceswhich provideadefaultoutboundmapping.
Afteryouregisteredyourroutingservicesyoucanassociatethemwithmessagetypesvia theAdministratorUI(Adapters>SAP Adapter>Routing/Mapping): Important! IntheSAPRouting/MappingscreenoftheAdministratorUItherearetwo sectionstoselectservices:amessage type independentsection(defaulthandlingsection)and amessage type dependentsection. Adefaulthandlingservice(inboundoroutbound)isexecutedforallmessagetypes.Ifthere areservicesselectedinthemessage type dependent section,theywillbeexecutedforthe correspondingmessagetypeinadditiontothedefaultservice.Ifthespecialvalue$none is selected,allregisteredservicesaresettoinactive. Note: Theservicesforcontentbasedroutinghavetoberegisteredbyyourselfbeforethey canbeselectedviatheAdministratorUI. Important! Ifyoucreateyourowndefaultinboundroutingservice,youmustsetthe parameterssender,receiverandmsgType.Thoseparametersarepartofthespecification.If youdonotsetthem,youcouldreceiveanerrormessage. Note: Thesettingofthedefaultservicesworksthesamewayasthesettingofregular services.Youneedtoregisteraservicebeforeyoucanselectit.Ifno*Default Routing/Mappingtypehasbeenregistered,thenyouwillnothaveachoiceforselecting oneatall,whichisthecasewiththeadapteroutofthebox.$nonechoiceisonlythereif oneormoreservicesareregistered.
165
node
Return Values This key sender receiver msgType $tid(optional) $action(optional) Must specify Senderusedforfindingthematchingroutingnotification. Receiverusedforfindingthematchingroutingnotification. Messagetypeusedforfindingthematchingroutingnotification. TransactionIDfoundinthedocument,ifclientwantstoexecutea transactiononceandonlyonce. Oneofthefollowingtransactioncodes: Code
1 4
166
ToconfiguretheInboundProcessmechanismoftheXMLtransport,performthe followingsteps: 1 2 3 4 CreateaninboundroutinginfoserviceforyourXMLtransport.Itextractsallrequired parameterssothattheroutinglistenercanhandletherequest. Afterhavingimplementedaservice,youmustmakeitknowntotheXMLtransport. GototheAdapters SAP Adapter Routing/Mappingpage. FollowthelinkRegister New User Exit ServiceandthenselectXML Routing Info. Providethefullservicenameintheinputfield,andclickRegister:
NowyouarereadytodoroutingusingXMLInboundProcessforarbitraryXML documents.
167
168
CHAPTER
Transaction Handling
Managing Transactions and the Transaction Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 Viewing Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 Deleting Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 Automatic Cleanup of the Transaction Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 Configuration Parameters for the Transaction Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Using the ALE Monitoring Features Via the SAP Adapter . . . . . . . . . . . . . . . . . . . . . . . . . 175 Centralized Transaction Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
169
C H A P T E R 9 Tr a n s a c t i o n H a n d l i n g
Viewing Transactions
YouviewtransactionsforalocalTransactionStoreandaCentralizedTransactionStore (CTS)inthesameway.InalocalTransactionStore,youcanviewonlythetransactions executedbythatindividualadapter;inaCTS,youcanviewthestatusofallthe transactionsexecutedbyanyadapterinthegroup. To view the transactions in the transaction store 1 2 IntheAdaptersmenuintheIntegrationServerAdministratornavigationarea,click SAP Adapter. IntheSAP Adaptermenu,clickTransactions. TheSAPAdapterdisplaystransactionsinpagesof20,toavoidatimeoutoroutof memoryofthewebbrowserincasethereisalargenumberoftransactionsinthe store. 3 Toviewdetailinformationforatransaction,clickonthetransactionIDintheTID column. Thisscreenallowsyoutoviewthedetailsofeachtransaction,includingthesender, receiver,messagetype,transactionID,timewhenthistransactionwasfirstreceived bytheSAPAdapter,currentstate,thetimewhenthisstatewasset,lasterror(ifany), andanaudittrailthatshowsstatechanges,errormessagesandthevariousstepsthat haveprocessedthemessage. TheCurrent Statefieldcontainsthetransactionstate.Theinformationinthisfield correspondstothedifferentstatesofthetRFCprotocol.Ifthemessagewasnot
170
Viewing Transactions
receivedviatRFCbutviaadifferentprotocol(likehttp),thetransactionstoretriesto imitatethetRFCstatushandling,butthemeaningofthesinglestatesisslightly differentinthiscase.ThefollowingdescribesthevalidstatesofatRFCtransaction: Status Created Meaning (tRFC) Thesenderhassenda transactionID,whichwas acceptedbytheSAP Adaptertransaction manager.(Nodatasent yet.) Executionofthe transactionhasfailed.The sendermayretrythe transactionagainata latertime. TheAdministratorshould manuallyfollowup transactionsinstatus Rolled backasfollows: Trytofindandeliminate thereasonoffailureand then: Resendthe transactionfrom SM58,ifitoriginally camefromanSAP system Askyourpartnerto resendthe transaction,ifit originallycameinvia FTPorHTTP. Ifthetransactionwas initiatedbyalocal service,reinvokethe service. Meaning (other protocols) Thesenderhassendatransaction IDanddata,whichwas forwardedtothetransaction store.
Rolledback
171
C H A P T E R 9 Tr a n s a c t i o n H a n d l i n g
Status Committed
Meaning (tRFC) Thesenderhas acknowledged,thathe knows,thatthe transactionexecuted successfully. Thesenderhaspromised nevertosendthis transactionagain.Sothe TIDmaybedeleted,as thereisnoneedanymore toprotectagainst duplicateprocessingof thesametransaction.
Confirmed
Thisisusedonlyiftheexternal clientinvokestheservice pub.sap.transport.*:InboundProcess again,with$actionset4,afterthe transactionhasbeenexecuted successfully.Inthiscaseandif thetransportsupportsit,the Confirm eventhasbeenforwarded tothefinalreceiver,sothatitis abletocleanupitsARFCRSTATE tableandremovetheTIDfromit.
Deleting Transactions
YoudeletetransactionsfromalocalTransactionStoreandaCentralizedTransactionStore (CTS)inthesameway.Ifatransactionstorecontainstransactionsthatarenolonger needed,youcandeletethem.InalocalTransactionStore,youcandeleteonlythe transactionsexecutedbythatindividualadapter;inaCTS,youcandeleteanytransaction executedbyanyadapterinthegroup. Important! IfyoudeleteatransactioninaCTS,thetransactionwillnotbeavailableforall theadaptersinthegroup.Makesureyoudeleteonlythetransactionsthatarenotneeded byanyadaptersinthegroup.
172
To delete transactions from the transaction store 1 2 3 IntheAdaptersmenuintheIntegrationServerAdministratornavigationarea,click SAP Adapter. IntheSAP Adaptermenu,clickTransactions. Clickthe iconintheDelete columnforthetransactionthatyouwanttodelete.
173
C H A P T E R 9 Tr a n s a c t i o n H a n d l i n g
Example
ToperiodicallypurgealltransactionsthathavebeenintheConfirmedstateforlongerthan 30minutes,youcancreateaservicecalledapp:purgeConfirmedTRXwiththosestateandtime parameters.Youalsospecifyhowmanytransactionseveryinvocationoftheservicewill purge.Thisissoyoucancontrolthepaceofyourmaintenancejobswithoutputtingto muchloadontheIntegrationServeratonesingletime.Itisalsoagoodideatoschedule thejobattimeswhenthereisnotmuchloadontheIntegrationServer.
174
cacheuntilthecacheTimeToLiveperiodhasexpired,orlongerifitwasmodified again. Important! ForaCentralizedTransactionStore,theSAPAdapterwillsetthevalueto 1000ifthevaluesetislessthanthat. watt.sap.xtn.cacheTimeToLive Thetransactioncacheworksbothasareadandawritecache.Afteratransactionis readthefirsttime,itiskeptinthecacheforaspecificamountoftime (cacheTimeToLive).Ifthetransactionisnotaccessedduringthistime,itisremoved fromthecacheafterthisperiodhasended.Thiskeepsthecachefromgrowing indefinitely. Important! ForaCentralizedTransactionStore,theSAPAdapterwillsetthevalueto 1000ifthevaluesetislessthanthat. watt.sap.xtn.fastAsyncMode Thisproperty,whensettotrue,enablesthesynchronouswritecacheandwhenset tofalsedisablesthecache.Thispropertyworkstogetherwiththe watt.sap.xtn.cacheFlushPeriodandwatt.sap.xtn.cacheTimeToLive.Settingthisfeaturetotrue willforcethetransactionmanagernottopersisteachupdateofatransactionbutwill keepthestatechangesinmemoryandpersistitperiodically. Important! ForaCentralizedTransactionStore,youcannotsetthisparametertotrue.
175
C H A P T E R 9 Tr a n s a c t i o n H a n d l i n g
StatusupdateviaALEAUDIDoccanbeusedifthefinalrecipientisagainanotherSAP system.ThemostcommoncasewillbetheconnectionoftwoSAPsystemsviatheInternet likethis: SAPsystem(sender)>IntegrationServer1>Internet(http)>IntegrationServer2> SAPsystem(receiver). InallothercasesstatusupdateviaSYSTATIDocshouldbeused.IntegrationServeracts herelikeanEDISubsystemandreturnsstatusinformationandinformationaboutthe finalreceiver(receivingemailaddress,WebServerURL,FTPServer,thirdpartysystem, etc.)tothesender. Thesethreeoptionsarenowdescribedindetail:
IDoc Trace
Overview
TheALEMonitorallowsyoutomakeinquiriesabouttheprocessingstatusofanIDocin thereceivingsystemactivelyfromwithinthesendingsystem.InSAPsystemsofrelease< 4.6CthiscanbedonewiththetransactionBDM2(CrossSystemIDocReporting)andfrom release4.6ConwithtransactionBD87(StatusMonitorforALEMessages).Asinputsyoucan specifycertainselectioncriteria,likeDocumentNumber,MessageType,LSofreceiver anddateranges.ThesystemthenmakesasynchronousRFCcall (IDOC_DATE_TIME_GET)totheLSthatreceivedtheIDocs,withalistofDOCNUMs correspondingtotheselectedIDocs.(FromtransactionBD87youhavetohitthetoolbar buttonTraceIDocsaftertheselectionoftheIDocs.)Thisfunctioncallreturnsforeach IDoctheDOCNUM,underwhichitwassavedinthereceivingsystem,thereceivingtime andthecurrentprocessingstatusinthereceivingsystem.
Prerequisites
TheIDocTracefunctionalityonlyworksforIDocsexchangedbetweenpartnersof PartnerTypeLS(LogicalSystem). InordertobeabletomakethissynchronousRFC,thepartnerprofileoftheLS,which representstheIntegrationServer,mustcontainanoutboundparameterwithmessage typeSYNCH. AlsotheFunctionCalltoanLSoftypetRFCPort,liketheIntegrationServer,isonly executediftheSAPsystemisofrelease4.6Dorhigher.Forolderreleasesyouhaveto applythefollowinghotpackages: R/3 Release 3.1I 4.0B Hot Package SAPKH31I67 SAPKH40B56
176
Note: DependingonhowtheSAPAdapterprocessestheIDocitreceives,different informationwillbereturned.Bydefault,thecreationdateandtimeatthereceiving systemandthestatuswillbereturned.IftheIDocwillnotbeforwardedtoanotherSAP system,theSAPAdapteristhereceivingsystem. However,iftheIDocisforwardedtoanSAPsystem(eitherbyinvokingarouting notificationwithoutboundtransportsettoALEorbyinvoking pub.sap.transport.ALE:OutboundProcessorpub.sap.client:sendIDocdirectlyorfromaremote IntegrationServer)theSAPAdapterinvokesIDOC_DATE_TIME_GETdirectlyagainst thereceivingSAPsystem.Thisactionreturnsadditionalinformation,liketheIDoc number,fromthereceivingSAPsystem.AllremoteIntegrationServersthatreceiveIDocs viaaremoteinvocationofpub.sap.transport.ALE:InboundProcessshouldthereforealsosupport IDocTracing.
177
C H A P T E R 9 Tr a n s a c t i o n H a n d l i n g
Receiving SAP System: FortheLSthatrepresentsthesender,setupapartnerprofile withanoutboundparameterALEAUDandaninboundparameterMATMAS.Alsoin thedistributionmodelthefollowingmodelviewhastobecreated: Sender:T90CLNT090(orLS,whichreceivedtheIDoc,ifdifferent) Receiver: LSofsender Message type:ALEAUD HereaddaFilterwithvalueMATMAS. Nextyouhavetoscheduleajob,whichexecutesavariantofthereportRBDSTATE.The varianthastoincludetheLSofthesenderasselectionparameter.Thisshouldsendoutan ALEAUDIDoctotheIntegrationServer.
ThentheALEAUDhastobepushedinwiththisheader:
EDI_DC40-SNDPRN = XYZCLNT123 EDI_DC40-RCVPRN = T90CLNT090
Thiscanbeachievedbyaddingtheservicepub.sap.monitor.aleaud01:swapSenderReceiverLS aspreprocessingservicetotheroutingnotificationservice.
178
179
C H A P T E R 9 Tr a n s a c t i o n H a n d l i n g
3 4 1
DoubleclickonthenodeInbound with ALE service _ Processing by task InthefollowingscreenpresstheSavebutton(F11). OpenSALE(Distribution(ALE))andselectBasis configuration Set up logical system Maintain logical systemstoaddanewlogicalsystemfortheIntegrationServerifyou donothaveoneyet.IfyounameitBUSCON,theIntegrationServerwillrecognizeit automatically;otherwise,youwillhavetomakethenameknowntotheIntegration Serverasdescribedlater. InWE20(PartnerProfiles),createapartnerprofilewithPartn.number = thenameyou choseinstep1(BUSCON)andPartn.type = LS.Afteryousavedit,addanInbound Parametertoitasfollows: Message type=STATUS Process code=STA1
Generalsetup:
StarttheIntegrationServeragain. WithBUSCONyoucanomitthisstep. 2 3 TomarkaroutingnotificationorALEadapternotificationforautomaticstatus update,editthenotificationandsetthevalueforfieldMonitorIDocstoOn. GotoServer Scheduler Create a scheduled taskandscheduletheservice pub.sap.monitor.systat01:report. HereyouspecifytimeintervalsfortheService.Youshouldtrytoscheduleitfortimes whenyouknowthatthereislittleloadonthesystem.Ontheotherhand,inorderto preventtheresultingSYSTATIDocsfromgettingtoobig,youshouldscheduleitoften enough,sothatatmostaround2000IDocshavebeenreceivedbytheSAPAdapter sincethelastrunofthereportservice. Thisservicecollectsallthenecessaryinformationanderror/successmessagesfor thoseIDocs,whichthenotificationschoseninstep2haveprocessedsincethelastrun. ForeachSAPsystemthathassentanysuchIDocstotheSAPAdapter,itcreatesand submitsoneSYSTATIDoccontainingallthisinformation.
180
181
C H A P T E R 9 Tr a n s a c t i o n H a n d l i n g
Foradditionalperformanceandconfigurationtasks,see: AutomaticCleanupoftheTransactionStoreonpage 173 ConfigurationParametersfortheTransactionManageronpage 174 UsingtheALEMonitoringFeaturesViatheSAPAdapteronpage 175 ConfiguringaCentralizedTransactionStoreonpage 182 ViewingCentralizedStoreConfigurationandStatusonpage 185 RemovingtheConfigurationofaCentralizedTransactionStoreonpage 186
182
Use SSL
SelectifyouwanttousetheSSLprotocol. Default:No
Private Key
Certificates
Retry Server
4 5
183
C H A P T E R 9 Tr a n s a c t i o n H a n d l i n g
To configure the Centralized Transaction Store (Client) Note: PerformthisprocedureforeachSAPAdapterthatistobeaCTSclient. 1 2 3 IntheSettingsmenuintheIntegrationServerAdministratornavigationarea,click Remote Servers. IntheRemote Serverspage,clickCreate Remote Server Alias. IntheRemote Server Alias Properties,specifyvaluesforthefollowingfields: Field Alias Description ThisisthenamebywhichtheSAPAdapterwillidentifythe CentralizedTransactionStoreconfiguration. YoumustenterSAPGroupStoreinthisfield. Host Name or IP Address ThisisusedtoidentifytheIntegrationServeronwhichthe CentralizedTransactionStoreServerishosted. YoumustentertheserverIPaddressorthehostnameofthe CentralizedTransactionStore. Port Number User Name Password Execute ACL EntertheCentralizedTransactionStoreServerportnumber. EntertheusernametologontotheIntegrationServeron whichtheCentralizedTransactionStoreServerishosted. EnterthepasswordtologontotheIntegrationServeron whichtheCentralizedTransactionStoreServerishosted. SelecttherequiredACLtypefromthedropdownlist. Default:Internal ForgeneralinformationaboutassigningandmanagingACLs, seethewebMethodsDeveloperUsersGuide. Idle Timeout (minutes) DelaytimeuntilanunusedrepositoryconnectiontoSAP Adapteristimedout. Default:0 Use SSL SelectifyouwanttousetheSSLprotocol. Default:No Private Key ToestablishaSecureSocketLayer(SSL)connectionbetween anIntegrationServerandaSAPServer.Eachservermusthave accesstoitsownprivatekey.
184
Field Certificates
Retry Server
4 5
Atthebottomofthepage,youcanviewtheconfigurationdetailsoftheSAP AdapterGroup. TheCentralized StorefieldmustdisplayLocal File SystemforCentralizedTransactionStore ServerandRemote File system <server IP Address>forCentralizedTransactionStoreClients. Important! EnsurethattheIntegrationServerthathoststheCentralizedTransactionStoreis alwaysstartedfirst,beforestartinganyotherSAPAdapterintheSAPAdaptergroup.If theCentralizedTransactionStoreClientscannotfindoraccesstheCentralized TransactionStoreServerduringadapterstartup,theywillnotbeabletostartandwillshut downwithfailure.Inthesameway,itisalsoimportanttoalwaysshutdownall CentralizedTransactionStoreClientsbeforeshuttingdowntheCentralizedTransaction StoreServer.TheCentralizedTransactionStoreClientswillotherwisedisplayruntime errorswhiletryingtopersisttransactionstatusinformation,andtransactionsor transactionchangeswillbelost.
185
C H A P T E R 9 Tr a n s a c t i o n H a n d l i n g
From the SAP Adapter that you want to remove from the CTS 1 IntheSettingsmenuintheIntegrationServerAdministratornavigationarea,click Remote Servers. OntheRemote Serversscreen,click fortheRemoteServerAliasoftheSAP AdapterthatyounolongerwanttousetheCTS. TheSAPAdapterremovestheRemoteServerAlias. 3 ReloadtheWmSAPPackage. TheaffectedSAPAdapterdoesnotregisteritselfwiththeCTSserverduringadapter startup,andwillnowuseitslocalTransactionStoreinsteadoftheCTStopersistall transactions.Bydoingso,theadapteriseffectivelynolongerpartofthelogicalgroup ofadapters.
186
CHAPTER
10
187
Logging
InthedevelopmentandtestphaseitissometimeshelpfultoviewRFCtracesifthereare problemswiththefunctionmodulesyouaretryingtocall.Inordertoavoidtheneedto accessthefilesystemofthemachineonwhichtheIntegrationServerisrunning,youcan viewanddeleteRFCtracefilesandSAPlogfilesfromtheAdministratorUI. AllSAPlogfiles,aswellastheRFCtracefilesarestoredinthepackages/WmSAP/logs directory.AspartoftheSAPAdapterinstallation,instructionswereprovidedtosetthe RFC_TRACE_DIRenvironmentvariabletopointtothatdirectory.(SeethewebMethods SAPAdapterInstallationGuideforinformationaboutsettingthedirectoryfortracefiles.) IftheRFC_TRACE_DIRenvironmentvariablewasnotsetduringadapterinstallation,the SAPAdaptertracefileswillbestoredintherootdirectoryoftheIntegrationServer.You willnotbeabletoviewthetracefilesintheAdministratorUI.
Viewing and Deleting RFC Trace Files and SAP Log Files
To view and delete RFC trace files and SAP log files 1 2 IntheAdministratorUI,browsetoAdapters SAP Adapter Logging.
TheLoggingscreenappears.ThisscreenliststheRFCtracefilesandSAPlogfiles,and showseachfilessizeandcreationdate. RFCtracefilesaresplitintoseveralparts,eachofthemcontainingonetraceentry alongwiththedateandtimeitwascreated.Toviewthelogentriesforaspecific TraceFile,clicktheTraceFilename. LargeSAPlogfilesaresplitintoseveralpartsofabout500K.Toviewthelog entriesforaspecificSAPlogFile,clicktheSAPLogFilename. Inthiswayitisavoidedthatthebrowserhastoloadtoolargedocuments,which wouldtakealongtimeorevencauseatimeout.UsingtheBackbuttonofyour browser,youcanreturnfromthedisplayofoneparttothelistofpartsforthat file.Ifyoutrytodeleteafilethatisstillopen(forexample,becausetheServeris stillwritingtoit),youwillreceiveamessage,andthefilewillnotbedeleted.
ToquicklydeletealltracefilesorallSAPlogfiles,clickDelete All.
188
Specifies TimeneededfortransferringthedatafromIData (pipelinerepresentation)toJCoObjects. TimeneededfortransferringthedatafromJCoObjects toIData(pipelinerepresentation). Timeneededforpreparingexecutionofafunction module(outboundcalls)orinvocationofaservice.This includesrepositoryqueriesforthedatastructuresand thefunctioninterface,openingconnectionstothe involvedsystems,etc. TimeneededintheJColayerforoutboundcalls. Timeneededfortheinvocationofaservicetohandlean inboundrequestintheSAPAdapterafter preparing/marshallingandbeforeunmarshallingthe data.(Listenerperformancedata). Totaltimeneededforhandlinginbound/outboundcalls inSAPAdapterlayer.
Time for marshalling (ms) Time for unmarshalling (ms) Time for preparing (ms)
4 5
Time for rfc calls (ms) Time for SAP Adapter service calls (ms)
The term Requests total Request rate Requests ok Requests with errors
189
The term Components total Components per request Total time Average time Query Requests
Specifies Numberofcomponentsusedinrequests. Averagenumberofcomponentsperrequest. Executiontimeforallrequestsinmilliseconds. Averageexecutiontimeforarequestinmilliseconds. YoucangettheTOP100requests(therequeststhat neededthelongestexecutiontimes.)Torestrictthose entries,youcanspecifytheInfo forandmax. listed RequestsinputsbeforepushingtheShowButton. Enterawildcardlikepatternfortherequestnames,for whichyouwanttheinformation.Youcanuseonlyexact patternsandpatternswithasingle*attheend,suchas client.*.Youcannotmakeentrieswiththeformat *rfc*. Limitsthenumberofrequeststothegivennumber. Afterpushingthebutton,theRequestsOverviewis displayed. Youcangetaccumulatedinformationaboutall components,thathavebeenusedinRequest.Torestrict thoseentriesyoucanspecifytheInfo forinputbefore pushingtheShowButton: EnterawildcardlikepatternfortheComponentnames, forwhichyouwanttheinformation.Youcanuseonly exactpatternsandpatternswithasingle*attheend, suchasclient.*Youcannotmakeentrieswiththe format*rfc*.Afterpushingthebutton,the ComponentOverviewisdisplayed.
Query Components
190
CHAPTER
11
191
C H A P T E R 11 C o d i n g C l i e n t A p p l i c a t i o n s a n d S e r v i c e s
Overview
TheSAPAdapterhasseveralAPIsthatyoucanuseinyourclientapplicationsand services.ThischaptershowshowtousethebuiltinservicesAPItoinvokeSAPRFCs, sendIDocstoanSAPsystemandtoreceiveanIDocfromanSAPsystem.Fordescriptions oftheavailablebuiltinservices,refertoAppendix D,BuiltinServices. FormoreinformationaboutbuildingtheJavaservices,seetheonlineAPIdocumentation installedwiththeIntegrationServerat: webMethods_directory\IntegrationServer\doc\api\Java\index.html ThischapteralsoshowshowtousethewebMethodsSAPAdapterIDocJavaAPIto constructanIDoc.Forinformation,referto webMethods_directory\IntegrationServer\packages\WmSAP\pub\doc\api\index.html.
192
underShared
Imports,includethelines:
com.wm.adapter.sap.idoc.* com.sap.mw.idoc.IDoc
193
C H A P T E R 11 C o d i n g C l i e n t A p p l i c a t i o n s a n d S e r v i c e s
194
segment.setField("ERSDA", segment.setField("ERNAM", segment.setField("PSTAT", segment.setField("MTART", segment.setField("MBRSH", segment.setField("MATKL", segment.setField("MEINS", segment.setField("BLANZ", segment.setField("BRGEW", segment.setField("NTGEW", segment.setField("GEWEI", segment.setField("VPSTA",
"20030303"); "TOPSI"); "KBG"); "FERT"); "L"); "G1113"); "PCE"); "000"); "0.550"); "0.000"); "KGM"); "KBG");
//create and add a new and empty child segment of type E1MAKTM //and fill the segment data segment = segment.addChild("E1MAKTM"); segment.setField("MSGFN", "005"); segment.setField("SPRAS", "D"); segment.setField("MAKTX", "Schachtel mit Keksen"); segment.setField("SPRAS_ISO", "DE"); //create and add a new and empty sibling segment of type E1MAKTM (same //type) and fill the segment data segment = segment.addSibling(); segment.setField("MSGFN", "005"); segment.setField("SPRAS", "E"); segment.setField("MAKTX", "Box of cookies"); segment.setField("SPRAS_ISO", "EN"); //create and add a new and empty sibling segment of type E1MARCM //and fill the segment data segment = segment.addSibling("E1MARCM"); segment.setField("MSGFN", "005"); segment.setField("WERKS", "0001"); segment.setField("PSTAT", "BG"); segment.setField("PLIFZ", "0"); segment.setField("WEBAZ", "0"); segment.setField("PERKZ", "M"); segment.setField("AUSSS", "0.00"); segment.setField("BESKZ", "E"); segment.setField("AUTRU", "X"); //create and add a new and empty sibling segment of type E1MBEWM //and fill the segment data segment = segment.addSibling("E1MBEWM"); segment.setField("MSGFN", "005"); segment.setField("BWKEY", "0001"); segment.setField("VPRSV", "S"); segment.setField("VERPR", "0.00"); segment.setField("STPRS", "15.50"); segment.setField("PEINH", "1");
195
C H A P T E R 11 C o d i n g C l i e n t A p p l i c a t i o n s a n d S e r v i c e s
segment.setField("BKLAS", segment.setField("VJVPR", segment.setField("VJVER", segment.setField("VJSTP", segment.setField("LFGJA", segment.setField("LFMON", segment.setField("PSTAT", segment.setField("KALN1", segment.setField("KALNR", segment.setField("EKALR", segment.setField("VPLPR", segment.setField("VJBKL", segment.setField("VJPEI", segment.setField("BWPEI",
"7920"); "S"); "0.00"); "15.50"); "2002"); "08"); "BG"); "000100126602"); "000100126603"); "X"); "0.00"); "7920"); "1"); "0");
196
ForXRFCdocuments,youcanalsoputthetransactionIDintheheaderofthedocument:
<?xml version="1.0"?> <sap:Envelope xmlns:sap="urn:sap-com:document:sap" version="1.0"> <sap:Header xmlns:rfcprop="urn:sap-com:document:sap:rfc:properties"> <rfcprop:Transaction>0A1104DC080C3C60F9E106A1</rfcprop:Transaction> </sap:Header> <sap:Body> <rfc:SBC_TEST_SAVE xmlns:rfc="urn:sapcom:document:sap:rfc:functions"> <INPUT>Have fun!</INPUT> </rfc:SBC_TEST_SAVE> </sap:Body> </sap:Envelope>
197
C H A P T E R 11 C o d i n g C l i e n t A p p l i c a t i o n s a n d S e r v i c e s
To set up for the example 1 2 SetupanRFCListenerfortheSAPsystemonyourSAPAdapterasdescribedin Listenersonpage 87. SetupacorrespondingRFCdestinationonyourSAPsystemforyourRFCListener usingthetransactionSM59asdescribedinCreatinganRFCDestinationonanSAP Systemonpage 84. CreateaprogramZ_BAPI_RFC_DEMOintheSAPsystemusingthetransactionSE38 Youcanenterthefollowingsourcecode:
REPORT Z_BAPI_RFC_DEMO . *variable companyCodes will take the application result data companyCodes like BAPI0002_1 occurs 1 with header line. *variable header gives SAP Adapter instructions for routing data header like SBCCALLENV occurs 1 with header line. *variable returnCode takes the processing information after the *synchronous call data returnCode type BAPIRETURN. *Fill the SAP Adapter routing instructions header-name = 'sender'. header-value = 'CERCLNT800'. append header. header-name = 'receiver'. header-value = 'CERCLNT750'. append header. *Execute the RFC with destination ISCER CALL FUNCTION 'BAPI_COMPANYCODE_GETLIST' *->ISCER should be maintained in SM59 as alias to SAP Adapter DESTINATION 'ISCER' IMPORTING RETURN = returnCode TABLES COMPANYCODE_LIST = companyCodes SBCHEADER = header[] . *process the BAPI-Return parameter if not returnCode is initial. write: / 'BAPI return parameter:'. write: / ' Code: ' , returnCode-CODE. write: / ' Message: ' , returnCode-MESSAGE. endif. *display the application result loop at companyCodes. write: / companyCodes-COMP_CODE, ' ', companyCodes-COMP_NAME. endloop.
198
Beforeexecutingthisreport,youshouldspecifyaroutingnotificationtotheXML transport.YoucansendtheXMLmessagetoanyserverthatisabletoprocesstheHTTP Postmessageandsendbackacorrectresponse.Inthisexample,thecallwillbesentback tothelocallyinstalledIntegrationServertodemonstrateitsinboundXMLprocessing capabilities. To prepare a routing notification for the BAPI call 1 2 3 4 5 6 OpentheDeveloperandselectNew Adapter Notification.ClickNext.
SelectSAP Adapterfromthelistofavailableadaptertypes.ClickNext. Fromthelistofavailabletemplates,selectRouting Notification.ClickNext. Selecttheroutinglistenerwm.sap.internal.ls:routingListener.ClickNext. Enteranameandselectafolderwheretheroutingnotificationshouldbestored. Selectanyservicethatshouldbeinvokedbythisnotification.ClickNextandthen Finish. Note: Theserviceyouselectedinstep 6willonlybeusediftheoutboundtransport thatischoseninyourroutingnotificationisIS.Forallotheroutboundtransports, thisselectionwillbeoverriddenbyatransportspecificservice.
SpecifyaURLforthetargetsystem.Totestthefunctionalityusingyourlocal IntegrationServersInboundprocessing,enter:
http://localhost:5555/invoke/pub.sap.transport.BAPI/InboundProcess
TohandletheinboundXMLmessage,whichwillnowbesentbacktothelocalIntegration Server,youhavetospecifyasecondroutingnotificationfortheBAPI:
199
C H A P T E R 11 C o d i n g C l i e n t A p p l i c a t i o n s a n d S e r v i c e s
To specify a second routing notification for the BAPI 1 Intheinputfieldattheendofthepage,enterthefollowingdata: a b c 2 3 Sender:CERCLNT800. Receiver: CERCLNT750. msgType:CompanyCode.GetList.
WhenexecutingtheprogramintheSAPsystem,theSAPAdaptersendstheHTTP Requesttotheremotehost,whichlookssimilartothefollowing:
POST /invoke/pub.sap.transport.BAPI/InboundProcess HTTP/1.0 User-Agent: Mozilla/4.0 [en] (WinNT; I) Accept: image/gif, */* Host: localhost:90 Content-type: application/x-sap.busdoc Cookie: ssnid=553891555519 Content-length: 817 <?xml version="1.0" encoding="iso-8859-1"?> <biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1"> <header> <delivery> <message> <messageID>0A125F1315B3D24B0000001E</messageID> <sent>2000-06-20T09:58:00</sent> </message> <to> <address>urn:sap-com:logical-system:CERCLNT750</address> </to> <from> <address>urn:sap-com:logical-system:CERCLNT800</address> </from> </delivery> </header>
200
<body> <doc:CompanyCode.GetList xmlns:doc="urn:sapcom: document:sap:business" xmlns=""> <CompanyCodeList> <item> <COMP_CODE></COMP_CODE> <COMP_NAME></COMP_NAME> </item> </CompanyCodeList> </doc:CompanyCode.GetList> </body> </biztalk_1>
201
C H A P T E R 11 C o d i n g C l i e n t A p p l i c a t i o n s a n d S e r v i c e s
*prepare the distribution information move receiver to receivers-LOGSYS. append receivers. *prepare the BANK addres parameter address-BANK_NAME = 'Demo Bank'. address-REGION = 'BW'. address-STREET = 'Neurottstr. 16'. address-CITY = 'Walldorf'. address-SWIFT_CODE = 'ABCDDE12'. address-BANK_GROUP = 'SB'. address-BANK_NO = '12345678'. address-ADDR_NO = '123'. *send data to ALE CALL FUNCTION 'ALE_BANK_CREATE' EXPORTING BANKCTRY = country BANKKEY = bankkey BANKADDRESS = address TABLES RECEIVERS = receivers EXCEPTIONS ERROR_CREATING_IDOCS = 1 OTHERS = 2 . IF SY-SUBRC <> 0. write: / 'IDoc could not be created'. ELSE. write: / 'IDoc successfully created'. ENDIF. *trigger processing commit work and wait.
To create similar routing notifications Youcancreateroutingnotificationssimilartothosedescribedinthesynchronous example. 1 Intheinputfield,enterthefollowingdata: a b c 2 Sender:enterthelogicalsystemofthesendingsystem. Receiver:enterthelogicalsystemofthetargetsystem. msgType:BANK_CREATE.
Inthetransportfield,selectXML.
202
SpecifyanURLforthetargetsystem.Totestthefunctionalityusingyourlocal IntegrationServersInboundprocessing,enter:
http://localhost:5555/invoke/pub.sap.transport.BAPI/InboundProcess
To handle the Inbound XML Message TohandletheinboundXMLmessage,whichwillnowbesentbacktothelocalIntegration Server,youhavetospecifyasecondroutingnotificationfortheBAPI: 1 Intheinputfield,enterthefollowingdata: a b c 2 3 Sender:enterthelogicalsystemofthesendingsystem. Receiver:enterthelogicalsystemofthetargetsystem. Message-type:Bank.Create.
203
C H A P T E R 11 C o d i n g C l i e n t A p p l i c a t i o n s a n d S e r v i c e s
</delivery> </header> <body xmlns=""> <doc:Bank.Create xmlns:doc="urn:sap-com:document:sap:business"> <BankKey>34981243</BankKey> <BankCtry>DE</BankCtry> <BankAddress> <BANK_NAME>Demo Bank</BANK_NAME> <REGION>BW</REGION> <STREET>Neurottstr. 16</STREET> <CITY>Walldorf</CITY> <SWIFT_CODE>ABCDDE12</SWIFT_CODE> <BANK_GROUP>SB</BANK_GROUP> <POBK_CURAC></POBK_CURAC> <BANK_NO>12345678</BANK_NO> <POST_BANK></POST_BANK> <BANK_BRANCH></BANK_BRANCH> <ADDR_NO>123</ADDR_NO> </BankAddress> </doc:Bank.Create> </body> </biztalk_1>
YoucancheckthecorrectprocessingofyourBAPIcallintheIDocstatusmonitor.
204
205
C H A P T E R 11 C o d i n g C l i e n t A p p l i c a t i o n s a n d S e r v i c e s
206
CHAPTER
12
Security
SAP Adapter Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 User Authentication Between the SAP Adapter and an SAP System . . . . . . . . . . . . . . . . . 208 Installing the SAP Adapter According to Your Security Policy . . . . . . . . . . . . . . . . . . . . . . . 213
207
CHAPTER 12 Security
208
Important! FortheauthenticationviacertificatesagainstanSAPsystem,itisrequiredto enable SNC connectionsfortheRFCConnectiondefinedattheSAPAdapterandontheSAP system.ThesesettingsarelistedinthesectionConfiguringAdapterConnectionson page 56.FordetailedinformationontheSAPsystemandRFCclientsettingsforSNCsee thecorrespondingSAPdocumentation. Important! TheHTTPSportdefinedontheIntegrationServershouldhavetheRequest Client CertificateoptionsetfortheClient Authenticationfield. Tip! FormoreinformationonportsseethewebMethodsIntegrationServerAdministrators Guide. IfyouwanttologontoanSAPsystemviaanIntegrationServerusinganySAPuseranda certificate,youcandosobyprovidingatrustedcertificatefortheIntegrationServer. Important! BeforeyoucanlogontotheIntegrationServerusingatrustedcertificate,you havetoimportthe(personalized)clientcertificateforeachuserfromalocaldirectoryto theIntegrationServerandmapittoanIntegrationServeruser. Forvalidationpurposes,youmustalsoenterthepathtotheCACertificatedirectory.The CACertificatedirectoryspecifiesthenameofyourlocaldirectorycontainingtheroot certificatesofCAsthatthisservertrusts.Youmayspecifythedirectoryusinganabsolute pathoronethatisrelativetothewebMethods_directory\IntegrationServerdirectory. Whenauserlogson(forexample,fromaWebclient)usingthiscertificate,theIntegration SerververifiestherootcertificateintheCACertificatedirectoryandthenpassestheclient certificate,includingtheusername,totheSAPsystem.However,youmustmakesure thatthisusercanaccesstheserviceshewantstoexecuteintheIntegrationServer.Thatis
209
CHAPTER 12 Security
whyyoumustmaptheclientcertificatetothecorrespondingIntegrationServeruser,or alternativelytoa(standard)IntegrationServeruser,dependingontheauthorizations required.IfyouwanttoexecuteaprotectedservicewithintheIntegrationServer,the mappedusermustbeallowedinthecorrespondingACLs(accesscontrollists).Formore informationonACLs,seethewebMethodsIntegrationServerAdministratorsGuide. Example: YouwanttoexecuteaserviceontheIntegrationServerthatretrievessalesorderdatafrom anSAPsystem.ThisserviceisprotectedbyanACL.TheIntegrationServeruserSalesis registeredinthisACLandallowedtoexecutetheservice.Ifyoumapthecertificatetothe userSales,yourSAPusercanalsoexecutetheservice.Inaddition,theSAPusermustbe authorizedtoexecutethefunctionmodulesofthecorrespondingfunctiongroup. TorestricttherightsoftheSAPlogonusersyoushouldcreatespecificuseraccountsinthe SAPsystemwiththeminimumnecessarysetofauthorizations.IfforinstancetheSAP AdapterisusedasapureRFCServer,itwillonlyperformveryfewfunctioncallbacksto thecallingSAPsystem.Thesecallbacksareneededtodeterminethefunctioninterface specification.ToallowforthisitissufficienttouseanSAPlogonuserwiththe authorizationtothefollowingSAPstandardfunctiongroups:RFC1,SDIF,SG00,SRFC. Ifthisusershallbeusedtocallotherapplicationinterfacesaswellyouneedtoaddthe respectivefunctiongroupstotheauthorizationlist.Addthisauthorizationtothe standardauthorizationobjectS_RFCandcreateanauthorizationprofilewhichonly containsthisauthorization.WhencreatingtheSAPuseryoucanthenassignthisprofileto it.FormoredetailsonauthorizationforSAPuserspleaserefertotheSAPdocumentation.
210
IftheSAPAdapteriscalledfromanSAPsystem,thecallisalwaystrusted.Therefore, onlytheusernamefromtheSAPsystemisusedforthelogon.Thisuseristheuserwho triggeredthesynchronousorasynchronouscall.Ifauserwantstoexecuteaservice protectedbyanACL(accesscontrollist),thisusermustbeenteredinthecorresponding ACLthatallowsaccesstothisservice. InboundcallscanbesecuredbySNCthesamewayasoutboundcalls.Tosecureyour inboundconnection,enableSNCforyourlistener.SeeListenersonpage 87fortheSNC parametersyouneedtoconfigureforasecurenetworkconnection. Tip! Intheuserconcept,thedefaultuseriscalledSAPUser(Password:22101999).Ifthe SAPAdapteriscalledbyanSAPuserthatdoesnotexistwithinIntegrationServer,the systemswitchesautomaticallytotheuserSAPUserasthedefaultuser. TheUserSAPUserispartoftheUserGroupSAPUsers.ItfiguresintheSAPUsersACL thatpreventsunauthorizedaccesstoallListenerNotificationsandInboundProcessesof thetransportsrelatedtoanSAPsystem. TheusercalledSAPUser,theUserGroup,andtheACLarecreatedautomaticallywhen youstarttheIntegrationServerandSAPAdapterforthefirsttime. IfanSAPuserhasbeencreatedinIntegrationServerinordertoexecuteallListener NotificationswithinIntegrationServer,youhavetoassignthisuseratleasttotheUser GroupSAPUsers. Important! IfyouwanttoavoidthatanSAPuserwhichhasnotbeencreatedwithinan IntegrationServer,canusethewholeauthorizationrangeoftheSAPUser,youshould assignthisSAPuserindividuallytothecorrespondingUserGroup(s),respectivelytothe correspondingACL(s). Important! TheusernamesintheIntegrationServerarecasesensitive.
Using the SAP Adapter with the SAP Cryptographic Library for SNC
TheSAPCryptographicLibraryisthedefaultsecurityproductdeliveredbySAPfor performingencryptionfunctionsinSAPsystems.YoucanuseitforprovidingSecure NetworkCommunications(SNC)betweenSAPsystemcomponents.Thesapcrypto.libis alsousedtoimplementSingleSignOn(SSO).Thissectiondescribestheproceduresteps thatarerequiredtoruntheSAPAdaptercommunicationusingthesapcrypto.lib.For moredetailedinformationontheinstallationofthe sapcrypto.libandthegenerationof PSE(PersonalSecurityEnvironment)seeUsingtheSAPCryptographicLibraryforSNCinthe SAPOnlineDocumentation(SAPLibrary).
211
CHAPTER 12 Security
SAP Adapter Communication Using the SAP Cryptographic Library for SNC
To use an SAP Adapter with the SAP Cryptographic Library 1 2 3 4 5 InstalltheSAPCryptographicLibrary(seetheSAPOnlineDocumentation) GenerateaPSE(PersonalSecurityEnvironment)forSNC(seetheSAPOnline Documentation) CreatetheServersCredentialsusingSAPGENPSE(seetheSAPOnline Documentation) Exchangethesecurityinformationbetweenthecommunicationpartners(servers):see theSAPOnlineDocumentation. ConfigureyourSAPAdapterandthecorrespondingSAPsystemforSNCuse(see SecurityOptionsinthesectionConfiguringAdapterConnectionsonpage 56and Listenersonpage 87). Optional:AdopttheSECUDIRenvironmentvariable(seetheSAPOnline Documentation)topointtothecorrectlocationofyourPSEfilesbymodifyingthe startupscript: Windows platforms:insertalineinserver.batasfollows:aftertheSETLOCALline setSECUDIR=<psepath> Unix platforms:insertalineinserver.shasfollowsattheverybeginningexport SECUDIR=<psepath>
212
213
CHAPTER 12 Security
214
CHAPTER
13
215
216
217
218
219
220
APPENDIX
Package Contents
Package Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
221
Package Layout
Apartfromthenativelibraries,allofthefilesrelevanttotheSAPAdapterandits persistentstateinformationareinthe<IntegrationServer>/packages/WmSAPdirectory. ThefollowingtabledescribesthedirectoriesandfilesthatmakeuptheSAPpackage directory. Directory code config Contents ContainstheSAPAdapterlibraries,theJCoandSAPIDocClass libraryjars,andsamplesourcecode. Containsthefollowingconfigurationfile: cbr.cnf (content-based routing) logs ns pub, templates Thisfilecontainstheconfigurationparameter forcontentbasedrouting.
222
APPENDIX
Server Configuration
General SAP Adapter Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 server.cnf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
223
Sessionpool size
224
server.cnf
Use Monitor
server.cnf
ThisfileiscreatedwhenyoustarttheIntegrationServerforthefirsttime.Someofthe followingstatementscanbeaddedmanuallyafterinstallingtheSAPAdapter. UsetheEdit Extended SettingsfeatureoftheIntegrationServerAdministratortoviewand editthekeystatements.SeethewebMethodsIntegrationServerAdministratorsGuidefor moreinformation. Tip! YoucanalsoaddandeditkeystatementsbyshuttingdowntheIntegrationServerand manuallyeditingthewebMethods_directory/IntegrationServer/config/server.cnffile. ThefollowingstatementsareaddedautomaticallywhenIntegrationServerandSAP Adapterarestartedforthefirsttime: Setting watt.sap.repo.maxPooledConnections Description Maximalnumberofrepositoryconnectionsin oneRFCconnectionpooltooneSAPsystem (default:10) Delay(minutes)untilanunusedrepository connectiontoanSAPsystemistimedout (default:5) Timeintervalinsecondsbetweenchecks (seconds)whetherunusedpooledrepository connectionshavetimedout Delay(seconds)untilrequestswaitingfora repositoryconnectionfromapooltimeoutin thequeue Timeinterval(minutes)betweenchecksofthe listener.ItischeckedwhethertheRFCHandle isstillvalid.IftheGatewayisrunning,any inactiveListenerisrestartedatthelatestafter thisinterval.
watt.sap.repo.timeout
watt.sap.repo.timeoutCheckPeriod
watt.sap.repo.maxWaitForPool
watt.sap.listener.checkTime
225
Change/addthefollowingstatementstotheserver.cnftoincreaseperformance: Setting watt.sap.rfcxml.version watt.sap.idocxml.escaping watt.sap.xml.prettyPrint Description VersionofRFCXML(XRFC)sent.Validversions:0.9and 1.0(default). VersionofillegalcharacterescapinginIDocXML.Valid versions:4.6and5.0(default) FlagthatindicatesiftheSAPXMLdialectsshouldbe renderedprettyprinted.Thedefaultistrue.Setthe valuetofalsetoremoveallunnecessarywhitespace andthusimproveperformance. Settingittotrue,enablesthesynchronouswritecache. Settingittofalsedisablesthecache.Thisproperty workstogetherwiththewatt.sap.xtn.cacheFlushPeriod and watt.sap.xtn.cacheTimeToLive -properties.Settingthisfeature toOnwillforcethetransactionmanagernottopersist eachupdateofantransactionbutratherkeepthestate changesinmemoryandinsteadpersistitperiodically. Itspecifiesthetimeperiodinminutes,howoftenthe TransactionManagerwillflushyetunsavedchangesin thetransactionCachetothefilesystem. Default:every5minutes. watt.sap.xtn.cacheTimeToLive Thetransactioncacheworksbothasreadandwrite cache.Afteratransactionisreadthefirsttime,itwillbe keptinthecacheforaspecificamountoftime (cacheTimeToLive).Ifthetransactionwasnotaccessed duringthistime,itwillberemovedfromthecacheafter thisperiodhasended()inordertokeepthecachefrom growingindefinitely.
watt.sap.xtn.fastAsyncMode
watt.sap.xtn.cacheFlushPeriod
226
server.cnf
Change/addthefollowingstatementstotheserver.cnftospecifymiscellaneousoptions: Setting watt.sap.aclset Description Ifthispropertyinnotavailableornotsettotrue,then duringthenextstartupoftheIntegrationServer,allSAP AdapterrelevantACLsettingswillberesettotheir defaultvalues. TosendSYSTAT01IDocsfromtheSAPAdapterbackto theSAPsystem,theIntegrationServermustbe registeredasalogicalsystem.Bydefault,thename BUSCONisused.Ifyouwanttouseadifferentname, youcanoverridethedefaultvalueusingthisproperty.
watt.sap.systat01.partnerNumber
227
228
APPENDIX
229
A P P E N D I X C A B A P Ty p e s i n t h e S A P A d a p t e r
ABAP Types
ABAP Type C Description character[s] Dictionary Types CHAR,CLNT, CUKY,LANG, LCHR,UNIT DATS FLOAT Java Type java.lang.String
D F
GregorianCalendar date(yyyyMMdd) IEEEdouble precision64bit floatingpoint 4bytesigned integer numeric character[s] decimalnumber time(HH.mm.ss) binaryoctets 1byteunsigned integer 2bytesigned integer variablelength string variablelength binaryoctets
java.lang.String java.lang.Double
I N P T X b s g y
INT4 NUMC,ACCP CURR,DEC, QUAN TIMS RAW INT1 INT2 STRING RAWSTRING
230
APPENDIX
Built-in Services
SAP Client Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 XRFC Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 IDoc Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 IDoc-XML Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254 Monitoring Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 bXML Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 BAPI Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259 Transaction Administration Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 Transport Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 Sample Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 SAP Listener Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 webMethods SAP Adapter IDoc Java API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
231
Return Values result Example Usethepub.sap.client:connect servicewhenyouwanttoestablishaconnectiontoatargetSAP system.Thismightbeusefulforcreatingasessionpool.Inthemostcommonscenarios,it isnotnecessarytoinvokethisserviceexplicitly,asitisinvokedimplicitly(forexample, whenapub.sap.client:invokeorpub.sap.client:invokeTransactionisissued). Okifconnectionwasestablishedsuccessfully.
232
pub.sap.client:lockSession
LocksanRFCconnectiontoyourIntegrationServersessionsothatyouwillalways exclusivelyusethisRFCconnectionforsubsequentcalls. Input Parameters serverName AliasoftheSAPsystemonwhichthesessionwillbelocked.The namemustmatchaconfiguredRFCconnectionaliasattheSAP Adapter. Optional.Clientforthesession.Ifnoclientisspecified,theclient specifiedintheSAPsystemaliassettingsisused. Optional. Usernameforthesession.Ifnouserisspecified,theuser specifiedintheSAPsystemaliassettingsisused. Optional. Passwordforthesession.Ifnopasswordisspecified,the passwordspecifiedintheSAPsystemaliassettingsisused. Optional. Languageusedduringthesession.Ifnolanguageis specified,thelanguagespecifiedintheSAPsystemaliassettingsis used.
Return Values None. Example Thisservicelocksasessiontotriggeracommit workcommandinsidetheSAPsystem. Thiscausesadatabasecommitandthestartoftheprocessingofposteddata. Note: ThisserviceonlyworkswithSAPsystemsversion4.0AandhigherbecauseBAPIs donotwritedatadirectlytothedatabasebutusethepostingengineinsidetheSAP system. Thedatawillnotbewrittentothedatabaseuntiltheclienttriggersacommit work command.InordertocallaBAPIthatwritesdata,youmustperformthefollowingsteps ontheIntegrationServer: 1 2 3 4 Callthepub.sap.client:lockSessionserviceinordertogetanexclusiveconnectiontothe SAPsystem. PerformtheBAPIcalls. Callthepub.sap.bapi:commit orpub.sap.bapi:rollback service Callthepub.sap.client:releaseSessionserviceinordertoreleasetheexclusiveconnection totheSAPsystemandcleanupusedresourcesontheIntegrationServer.
233
pub.sap.client:releaseSession
ReleasesalockedsessiononanSAPsystem. Input Parameters serverName $client $user $pass $language SAPsystemaliasonwhichthelockedsessionislocated.Thename mustmatchaconfiguredRFCconnectionaliasattheSAPAdapter. Optional.Clientforthesession.Ifnoclientisspecified,theclient specifiedintheSAPsystemaliassettingsisused. Optional.Usernameforthesession.Ifnouserisspecified,the defaultuserisused. Optional.Passwordforthesession.Ifnopasswordisspecified,the defaultpasswordisused. Optional.Languageusedduringthesession.Ifnolanguageis specified,thedefaultlanguageisused.
Return Values Therearenoreturnvalues Example1 Theservicewillreleaseasessionafteracommit workor rollback workcommandhas beentriggeredinsidetheSAPsystem. Note: ThisserviceonlyworkswithSAPsystemsversion4.0AandhigherbecauseBAPIs donotwritedatadirectlytothedatabasebutusethepostingengineinsidetheSAP system. InordertocallaBAPIthatwritesdata,youmustperformthefollowingstepsonthe IntegrationServer: 1 2 3 4 Callthepub.sap.client:lockSessionserviceinordertogetaexclusiveconnectiontothe SAPsystem. PerformtheBAPIcalls. Callthepub.sap.bapi:commitorpub.sap.bapi:rollbackservice Callthepub.sap.client:releaseSessionserviceinordertoreleasetheexclusiveconnection totheSAPsystemandcleanupusedresourcesontheIntegrationServer.
234
pub.sap.client:invoke
InvokesanRFCfunctionmoduleinsynchronousmodeonagivenSAPsystem. Input Parameters Thisservicealsoneedstheinputs(importsandtables)requiredbythefunctionmodule. serverName SAPsystemaliasonwhichthefunctionmodulewillbeinvoked. ThenamemustmatchaconfiguredRFCconnectionaliasatthe SAPAdapter. Nameofthefunctionmoduletobeinvoked. Optional.Clientforthesession.Ifnoclientisspecified,theclient specifiedintheSAPsystemaliassettingsisused. Optional.Usernameforthesession.Ifnouserisspecified,the defaultuserisused. Optional.Passwordforthesession.Ifnopasswordisspecified,the defaultpasswordisused. Optional.Languageusedduringthesession.Ifnolanguageis specified,thedefaultlanguageisused.
235
$encoding $call
pub.sap.client:invokeTransaction
InvokesantRFCfunctionmoduleonagivenSAPsystem. Input Parameters serverName SAPsystemaliasonwhichyouwanttoinvokethefunction module.ThealiasmustmatchaconfiguredRFCconnectionalias attheSAPAdapter. Nameofthefunctionmoduletobeinvoked. Transactionthisinvokeisassignedto. Optional.NameoftheSAPsysteminboundqueue.Specifyavalue incaseofaqRFCscenario Optional.Clientforthesession.Ifnoclientisspecified,theclient specifiedintheSAPsystemaliassettingsisused. Optional.Usernameforthesession.Ifnouserisspecified,the defaultuserisused. Optional.Passwordforthesession.Ifnopasswordisspecified,the defaultpasswordisused. Optional.Languageusedduringthesession.Ifnolanguageis specified,thedefaultlanguageisused.
236
Return Values $runtime $rfctime $encoding $call Totalinvocationtime(ms),includingprocessingtimewithinthe SAPAdapter. Time(ms)spentwithintheRFClibrarytocompletetheinvocation. MIMEcompliantcharactersetcorrespondingtothesessionsSAP codepage. Flagindicatingwhetherpipelinerepresentsarequest(true)ora response(false)ofafunctionmodule.
pub.sap.client:createTID
CallthisserviceifyouwanttoobtainatransactionID(TID;whichisaGUID)that conformstotheformatofSAPTIDs.TheobtainedTIDcanbeusedasaninputvaluefor pub.sap.client:invokeTransaction,pub.sap.client:sendIDoc,andpub.sap.client:confirmTID. Important! IfnoTIDexistsinthepipeline,thenthepub.sap.transport.ALE:OutboundProcess serviceperformsthefunctionofboththepub.sap.client:createTIDand pub.sap.client:invokeTransactionservices.ForIDocs,itisrecommendedthatyouuseeitherthe pub.sap.transport.ALE:OutboundProcessserviceorthecallsequenceofpub.sap.client:createTIDand pub.sap.client:sendIDoc. Input Parameters serverName $client $user $pass $language AliasoftheSAPsystemthatsendstheTID.Thisnamemustmatch aconfiguredRFCconnectionaliasattheSAPAdapter. Optional.Clientforthesession.Ifnoclientisspecified,theclient specifiedintheSAPsystemaliassettingsisused. Optional.Usernameforthesession.Ifnouserisspecified,the defaultuserisused. Optional.Passwordforthesession.Ifnopasswordisspecified,the defaultpasswordisused. Optional.Languageusedduringthesession.Ifnolanguageis specified,thedefaultlanguageisused.
237
pub.sap.client:confirmTID
ConfirmsthetransactionspecifiedbytheTIDonthespecifiedSAPsystem.Thisservice mustbecalledafteratransactionalinvokeinordertocompleteatransactiononthetarget system. Input Parameters serverName SAPsystemaliasonwhichthetransactionshouldbeconfirmed. ThenamemustmatchaconfiguredRFCconnectionaliasatthe SAPAdapter. TransactionIDtobeconfirmed. Optional.Clientforthesession.Ifnoclientisspecified,theclient specifiedintheSAPsystemaliassettingsisused. Optional.Usernameforthesession.Ifnouserisspecified,the defaultuserisused. Optional.Passwordforthesession.Ifnopasswordisspecified,the defaultpasswordisused. Optional.Languageusedduringthesession.Ifnolanguageis specified,thedefaultlanguageisused.
238
pub.sap.client:getAttributes
ConnectstothegivenSAPsystemandreturnsinformationspecifictooneRFCclient connectionsession: Input Parameters serverName AliasoftheSAPsystemfromwhichyouwanttoreceivetheRFC connectionspecificattributes.Thenamemustmatchaconfigured RFCconnectionaliasattheSAPAdapter. Optional.Clientforthesession.Ifnoclientisspecified,theclient specifiedintheSAPsystemaliassettingsisused. Optional.Usernameforthesession.Ifnouserisspecified,the defaultuserisused. Optional.Passwordforthesession.Ifnopasswordisspecified,the defaultpasswordisused. Optional.Languageusedduringthesession.Ifnolanguageis specified,thedefaultlanguageisused.
Return Values DocumentnamedrfcAttributescontainingspecificinformationaboutoneRFCconnection session: destination ownHost partnerHost systemNumber systemID client String.Destinationoftheconnection. Hostname(orIP)ofthemachinetheIntegrationServeris runningon. Hostname(orIP)ofthemachinetheSAPsystemisrunning on. SystemnumberoftheSAPsystem. UniquethreeletterIDofSAPsystem(inlocalnetwork). Clientthesessionisconnectedto.
239
user language ISOLanguage ownCodepage partnerCodepage ownRelease partnerRelease kernelRelease partnerType trace ownType rfcRole CPICConversationID encoding charset bytesPerChar
SAPuserthathasconnectedwiththissession. Logonlanguage. ISOnameforlogonlanguage. SAPcodepagethisconnectionisusing. SAPcodepagetheSAPsystemisrunningon. VersionoftheloadedRFClibraryusedbytheSAPAdapter. ReleaseoftheSAPsystem. KernelreleaseoftheSAPsystem. RFCtypeofthepartner;R/3(3),R/2(2)orexternalRFCserver (E). Flagindicatingwhethertraceisturnedon(true)oroff(false) forthisconnection. RFCtypeoftheSAPAdapter;shouldalwaysbeE. RoleoftheSAPAdapterinthiscall;shouldalwaysbe:C(for client). CPICIDoftheconnection(lowlevelprotocolinformation). IANAencodingthatisequivalenttotheSAPcodepageused, forexample:ISO88591. CharsetthatisequivalenttotheSAPcodepageused,for example:ISO8859_1(usedinJavaconstructors). Numberofmaximumbytesusedpercharinthecodepage.
240
pub.sap.client:getFunctionInterface
LooksupthefunctioninterfacedefinitionofanRFCfunctionmoduleinthegivenSAP system. Input Parameters $rfcname serverName Functionmoduleforwhichtheinterfacedefinitionislookedup. AliasoftheSAPsystemonwhichtheRFCfunctionmoduleis defined.ThenamemustmatchaconfiguredRFCconnectionalias attheSAPAdapter.
Return Values Documentlistnamedparamsthatcontainsallparameterrelatedinformation: paramClass parameter tabName type length decimals optional Classofparameter;I(importing),E(exporting),T(table), X(exception). Nameoftheparameterinthefunctioninterface. NameofthetableintheSAPsystemtheparameterisreferringto. Typeoftheparameter(forexample:CHAR,STRUCTURE,TABLE, ...) Internallengthinbytesoftheparameter. Onlyrelevantfordecimaltypes;numberofdecimalsused. Flagindicatingwhetherparameterisoptional.
pub.sap.client:getStructureDefinition
LooksupthestructuredefinitionofanSAPstructureinthegivenSAPsystem. Input Parameters structName serverName Structurenameforwhichthedefinitionshouldbelookedup. AliasoftheSAPsystemonwhichtheRFCstructureisdefined. ThenamemustmatchaconfiguredRFCconnectionaliasatthe SAPAdapter.
241
Return Values Documentlistnamedfieldsthatcontainsallfieldrelatedinformation. tabLength Lengthofthestructurewhenusedinatable.Thismight differfromthesumofallfieldlengths,asthenumbertypes havetobealignedtomemorysegments. Key fieldName tabName position offset length decimals type Description Nameofthefield. Optional.Nameofthetable/structurein theSAPsystemthefieldisreferringto. Positionwithinstructure. Offsetinbytestothisfield. Internallengthinbytes. Onlyrelevantfordecimaltypes;number ofdecimalsused. Typeofthefield(forexample:CHAR, STRUCTURE,TABLE,...).
fields
242
pub.sap.client:sendIDoc
SendsanIDoctoagivenSAPsystem. Input Parameters serverName iDocList $tid $queueName $client $user $pass $language AliasfortheSAPsystemthatwillreceivetheIDoc.Thealiasmust matchaconfiguredRFCconnectionaliasattheSAPAdapter. ContainstheIDoc(s)asobjectofthecom.sap.mw.idoc.IDoc.DocumentList type. Transactionsthisinvokeisassignedto. Optional.NameoftheSAPsysteminboundqueue.Specifyavalue incaseofaqRFCscenario. Optional.Clientforthesession.Ifnoclientisspecified,theclient specifiedintheSAPsystemaliassettingsisused. Optional.Usernameforthesession.Ifnouserisspecified,the defaultuserisused. Optional.Passwordforthesession.Ifnopasswordisspecified,the defaultpasswordisused. Optional.Languageusedduringthesession.Ifnolanguageis specified,thedefaultlanguageisused.
Return Values $runtime $rfctime $encoding $call Totalinvocationtime(ms),includingprocessingtimewithinthe SAPAdapter. Time(ms)spentwithintheRFClibrarytocompletetheinvocation. MIMEcompliantcharactersetcorrespondingtothesessionsSAP codepage. Flagindicatingwhetherpipelinerepresentsarequest(true)ora response(false)ofafunctionmodule.
243
pub.sap.client:ping
CheckstheresponsetimeofanSAPsystem. Input Parameters serverName RFCconnectionaliasfortheSAPsystemyouwanttoping.The namemustmatchaconfiguredRFCconnectionaliasattheSAP Adapter. Optional.Clientforthesession.Ifnoclientisspecified,theclient specifiedintheSAPsystemaliassettingsisused. Optional.Usernameforthesession.Ifnouserisspecified,the defaultuserisused. Optional.Passwordforthesession.Ifnopasswordisspecified,the defaultpasswordisused. Optional.Languageusedduringthesession.Ifnolanguageis specified,thedefaultlanguageisused.
244
XRFC Services
XRFC Services
pub.sap.rfc:decode
ConvertsanRFCXML(XRFC)stringintothepipelinesothatisinaformatthatcanbe passedtoanSAPsystem. Input Parameters xmlData bytes node String.AnRFCXMLmessage. Optional.BytearraythatcontainsthedatatobedecodedasXRFC. Optional.XMLobjectthatrepresentstheXRFCdata(youwillgeta nodewhenputtinganXMLfileviaFTPwithextension.xml).The servicechecksinthatorderifaninputdocumentisavailable: xmlData,bytes,node.
pub.sap.rfc:encode
ConvertsanRFCcallstoredinthepipelinetoanXMLstringinaformatspecifiedbythe SAPRFCXML(XRFC)specification. Input Parameters ThisserviceneedstheRFCcallsinValuesrepresentationasinput. serverName $encoding SAPsystemusedasarepository.Thisnamemustmatcha configuredRFCconnectionaliasattheSAPAdapter. Optional.Specifiestheencodingusedintheoutputdocuments XMLheader,e.g.iso88591
245
$call $envelope
246
XRFC Services
pub.sap.rfc:createTemplate
CreatesanRFCXML(XRFC)templateforthespecifiedfunctionmodule Input Parameters serverName $rfcname $encoding $call $envelope SAPsystemaliasthatisusedasarepository.Thealiasmustmatch aconfiguredRFCconnectionaliasattheSAPAdapter. Optional.Functionmoduleforwhichyouwanttocreatethe template. Optional.Specifiestheencodingusedintheoutputdocuments XMLheader,e.g.iso88591 Thisflagspecifieswhetheracalltemplate(true)oraresponse template(false)iscreated. Optional.XRFC,bXML,orSOAP.Specifiesthetypeoftemplate generated.
247
IDoc Services
Note: DuetotheintegrationoftheSAPJavaIDocClassLibraryintoSAPAdapter6.5, someserviceparametersinthisparthavechanged.Theymaycontaintheadditional parameteriDocList(acom.sap.mw.idoc.IDoc.DocumentListobject)thatreplacesorextendsthe parametersIDOC_CONTROL(_REC_40)andIDOC_DATA(_REC_40).
pub.sap.idoc:encodeSDATA
ConvertseverySDATAfieldfromaDocumentobjecttoaStringobject.Thisserviceis usuallycalledpriortosendinganIDoctoanSAPsystemviapub.sap.client:invokeTransaction orbyanRFCadapterserviceforfunctionmodule IDOC_INBOUND_ASYNCHRONOUSorINBOUND_IDOC_PROCESS. Note: Thereisalsoaclientservicecalledpub.sap.client:sendIDocthatallowsyoutosendthe iDocListdirectly. Input Parameters serverName SAPsystemaliaswhichisusedasrepositoryfor structureinformationabouttheIDoc.Thenamemust matchaconfiguredRFCconnectionaliasattheSAP Adapter. BothkeysareDocumentlists(Tables)containingthe controlanddatatablesfortheIDoc. TheSDATAfieldisaDocumentobjectcontainingthe keysandvaluesfromthesegmenttable(thenameofthe segmenttableisspecifiedbytheSEGNAMfield). Note: ThisservicehandlesbothIDocversions2and3.The differencebetweenthetwoisthat,forIDocsversion2, theservicelooksforIDOC_CONTROLandIDOC_DATA inthepipeline.ForIDocsversion3,itlooksfor IDOC_CONTROL_REC_40andIDOC_DATA_REC_40. iDocList ContainstheIDoc(s)asobjectof com.sap.mw.idoc.IDoc.DocumentList.
248
IDoc Services
Return Values IDOC_CONTROL IDOC_DATA OR IDOC_CONTROL_REC40 IDOC_DATA_REC40 Bothkeysaredocumentlists(Tables)containingthe controlanddatatablesfortheIDoc. TheSDATAfieldisa1000bytefield. Atthispoint,theIDocinthepipelineisreadytobesent toanSAPsystemviaeitherpub.sap.client:invokeTransaction oranadapterserviceforoneofthefunctionmodules (IDOC_INBOUND_ASYNCHRONOUSor INBOUND_IDOC_PROCESS).
pub.sap.idoc:decodeSDATA
ConvertstheSDATAfieldfromaStringobjecttoaDocumentobjectandimmediately convertsthewholelistofIDocstoacom.sap.mw.idoc.IDoc.DocumentListobjectforfurther processing.WithRelease6.5,theserviceisonlyrequiredifyoureceiveanIDocinthe tablesrepresentationfromasendingsystem.Thatis,youhavecreatedanRFCadapter notificationforfunctionmoduleIDOC_INBOUND_ASYNCHRONOUSor INBOUND_IDOC_PROCESS. Input Parameters serverName SAPsystemaliaswhichisusedasrepositoryfor structureinformationabouttheIDoc.Thenamemust matchaconfiguredRFCconnectionaliasattheSAP Adapter. BothkeysareDocumentlists(tables)containingthe controlanddatatablesfortheIDoc. Atthispoint,theSDATAfieldofeachsegmentconsists ofa1000bytefield. Note: ThisservicehandlesbothIDocversions2and3. Thedifferencebetweenthetwoisthat,forIDocsversion 2,theservicelooksforIDOC_CONTROLand IDOC_DATAinthepipeline.ForIDocsversion3,it looksforIDOC_CONTROL_REC_40and IDOC_DATA_REC_40. Optional.Specifiestheencodingusedintheoutput documentsXMLheader,e.g.iso88591.
$encoding
249
pub.sap.idoc:encodeString
EncodesanIDoctoaStringequivalent,theformatthatisusedbythefileportofanSAP system.TheservicefirstchecksfortheiDocListfield,ifthatparameterisnotpresent,it willlookfortheIDOC_*recordlists. Note: Whensavingtoafile,makesurethatStringissavedwithcorrectencoding. Input Parameters serverName SAPsystemaliaswhichisusedasrepositoryforstructure informationabouttheIDoc.Thenamemustmatcha configuredRFCconnectionaliasattheSAPAdapter. Optional.TheSAPsystemreleasethattheIDocwillbe sentto. Optional.Specifiestheencodingusedintheoutput documentsXMLheader,e.g.iso88591. ContainstheIDoc(s)asobjectof com.sap.mw.idoc.IDoc.DocumentList.
OR IDOC_CONTROL IDOC_DATA OR IDOC_CONTROL_REC40 IDOC_DATA_REC40 Bothkeysaredocumentlists(tables)containingthe controlanddatatablesfortheIDoc.TheSDATAfieldisan orderlyDocumentobjectcontainingthekeysandvalues fromthesegmenttable(thenameofthesegmenttableis specifiedbytheSEGNAMfield). Note: ThisservicehandlesbothIDocsversions2and3.The differencebetweenthetwoisthat,forIDocsversion2,the servicelooksforIDOC_CONTROLandIDOC_DATAin thepipeline.ForIDocsversion3,itlooksfor IDOC_CONTROL_REC_40andIDOC_DATA_REC_40.
250
IDoc Services
pub.sap.idoc:decodeString
DecodesanIDocfromaStringequivalent,theformatthatisusedbythefileportofan SAPsystem. Input Parameters serverName SAPsystemaliaswhichisusedasrepositoryforstructure informationabouttheIDoc.Thenamemustmatchaconfigured RFCconnectionaliasattheSAPAdapter. String.TheiDocinthefileport. Optional.SpecifiestheencodingusedtodecodetheIDocstring, e.g.iso88591.
iDocString $encoding
pub.sap.idoc:iDocToDocument
GeneratesaDocumentrepresentationofanIDoclisttoperformmappingsinFlow language. Input Parameters iDocList conformsTo ContainstheIDoc(s)asanobjectofthetype com.sap.mw.idoc.IDoc.DocumentList. NameofthedocumentstructureoftheIDoc.Thedocument structureisusedasatemplatetodiscriminatebetweendocuments anddocumentlists.WithoutconformsTo,alltablesinthe hierarchicalstructurewillbedocumentlists.
251
pub.sap.idoc:documentToIDoc
Complementaryservicetopub.sap.idoc:iDocToDocument. Input Parameters document Return Values iDocList ContainstheIDoc(s)asobjectsofthetype com.sap.mw.idoc.IDoc.DocumentList. IDocinhierarchicalstructure.
pub.sap.idoc:iDocToTables
GeneratesthetablescompatiblewithSAPAdapterversion4.6fromanobjectcompatible withSAPAdapterversion6.5.DothisbeforesendingtheIDoctoanSAPAdapterversion 4.6inboundtransport. Input Parameters iDocList ContainstheIDoc(s)asobjectofthetype com.sap.mw.idoc.IDoc.DocumentList.
Return Values IDOC_CONTROL IDOC_DATA OR IDOC_CONTROL_REC40 IDOC_DATA_REC40 BothkeysareDocumentlists(tables)containingthe controlanddatatablesfortheIDoc.TheSDATAfieldis anorderlyDocumentcontainingthekeysandvalues fromthesegmenttable(thenameofthesegmenttableis specifiedbytheSEGNAMfield). Note: ThisservicehandlesIDocversions2and3.The differencebetweenthetwoisthat,forIDocversion2,the servicecreatesIDOC_CONTROLandIDOC_DATAin thepipeline.ForIDocversion3,itcreates IDOC_CONTROL_REC_40andIDOC_DATA_REC_40.
252
IDoc Services
pub.sap.idoc:tablesToIDoc
Complementaryservicetopub.sap.idoc:iDocToTables. Input Parameters IDOC_CONTROL IDOC_DATA OR IDOC_CONTROL_REC40 IDOC_DATA_REC40 BothkeysareDocumentlists(tables)containingthe controlanddatatablesfortheIDoc.TheSDATAfieldis anorderlyDocumentcontainingthekeysandvalues fromthesegmenttable(thenameofthesegmenttable isspecifiedbytheSEGNAMfield). Note: ThisservicehandlesIDocversions2and3.The differencebetweenthetwoisthat,forIDocversion2, theservicelooksforIDOC_CONTROLand IDOC_DATAinthepipeline.ForIDocversion3,it looksforIDOC_CONTROL_REC_40and IDOC_DATA_REC_40. Return Values iDocList ContainstheIDoc(s)asobjectofthetype com.sap.mw.idoc.IDoc.DocumentList.
253
IDoc-XML Services
pub.sap.idoc:encode
ServicethatconvertsanIDoclisttoanXMLstringinaformatspecifiedbytheSAPIDoc XMLSpecification. Input Parameters iDocList OR ContainstheIDoc(s)asobjectofthetype com.sap.mw.idoc.IDoc.DocumentList.
BothkeysareDocumentlists(tables)containingthe controlanddatatablesfortheIDoc. TheSDATAfieldisanorderlyDocumentcontainingthe keysandvaluesfromthesegmenttable(thenameofthe segmenttableisspecifiedbytheSEGNAMfield). Note: ThisservicehandlesIDocversions2and3.The differencebetweenthetwoisthat,forIDocversion2, theservicelooksforIDOC_CONTROLand IDOC_DATAinthepipeline.ForIDocversion3,itlooks forIDOC_CONTROL_REC_40and IDOC_DATA_REC_40.
$encoding
Optional.Specifiestheencodingusedintheoutput documentsXMLheader,e.g.iso88591
254
IDoc-XML Services
pub.sap.idoc:decode
ServicethatconvertsanXMLstringinaformatspecifiedbytheSAPIDocXML SpecificationintoanIDocthatisofthetypecom.sap.mw.idoc.IDoc.DocumentListand necessaryforanRFCcall(usingpub.sap.client:sendIDoc). Input Parameters bytes Bytearray.ContainsthedatatobedecodedasIDocXML.
OR
node
xmlData
Example ThisserviceisthefirstservicecalledwhenyouwanttosendanIDocXMLdocumentto anSAPsystem.ThefollowingisasequenceofservicecallsthattakeanIDocinXML format,convertittoacom.sap.mw.idoc.IDoc.DocumentListobject,thenfireitintothe SAPsystem: 1 Invokethisservice(pub.sap.idoc:decode).ThistakestheinputxmlData(theXMLString) andcreatesancom.sap.mw.idoc.IDoc.DocumentListobjectthatisinRFCreadyform. (ThismeansthatitmatchestheRFCcallusedtosendanIDocintotheSAPsystem, andthatthepipelineisalmostintherequiredformat). Invokepub.sap.client:createTID.UsethisservicetorequestatransactionidfromanSAP systemthatcanbeusedforsendingtheIDoctotheSAPsystem.
255
Monitoring Services
pub.sap.monitor.aleaud01:swapSenderReceiverLS
SwitchesSenderandReceiver(logicalsystems)foralistofgivenALEAUD01IDocs. Input Parameters iDocList Return Values iDocList ListofALEAUD01IDocswithswitchedRVCPRNandSNDPRN fields. ListofALEAUD01IDocstobeswitched.
pub.sap.monitor.idoc:trace
InternalserviceusedtotracethestatusofcertainIDocsbacktoeitherthesendingSAP systemortoafurtherprocessingSAPAdapter.ThisserviceisdirectlycalledfromSAP systems. Input Parameters SELECTION_DA TE SOURCE_SYSTE M T_IDOCINFO Return Values T_IDOCINFO ListofIDocswithupdatedtraceinformation. DateparameterpassedtoIDOC_DATE_TIME_GETonthe sendingSAPsystem. ThepartnernumberofthesendingSAPsystem. ListofIDocstobetraced.
256
bXML Services
pub.sap.monitor.systat01:report
ThisservicesendsoutSYSTAT01IDocstothesendingSAPsystemforallIDocsthathave beenreceivedinMonitoringmode.CanbeexecutedexactlyoncefortheIDocsofa transaction. Input Parameters None. Return Values None.
bXML Services
pub.sap.bapi:decode
DecodesbXMLdocumentsandgeneratesacorrespondingpipeline. Input Parameters xmlData OR bytes OR node XMLNodeobjectthatrepresentsthebXMLdata(forexample,you getanodewhenputtinganXMLfileviaFTPwithextension.xml). Theservicechecksinthatorderifaninputdocumentisavailable: xmlData,bytes,node. Return Values $encoding Optional.SpecifiestheencodingfoundinthebXMLdocument, e.g.iso88591. Bytearray.ContainsthedatatobedecodedasbXML. String.AdocumentinbXMLformat.
257
pub.sap.bapi:encode
ConvertsaBAPIcallrepresentedinapipelinetoanXMLstringinaformatspecifiedby theSAPbXMLspecification. Input Parameters objectName bapiName $encoding $call Nameofthebusinessobject. NameoftheBAPI. Optional.Specifiestheencodingusedintheoutputdocuments XMLheader,e.g.iso88591. Optional.Thisflagspecifieswhetherthepipelineshouldbe interpretedasacall(true)orasaresponse(false).Thedefaultis false. Optional.Ifthisobjectisinthepipeline,anExceptiondocument willbecreated. Optional.ContainsmetadatainformationabouttheBAPI,that shouldbeencoded.
$abapexception $metabapi
pub.sap.bapi:createTemplate
GeneratesabXMLdocumenttemplateforthedefinitionofaBAPIinanSAPsystem. Input Parameters serverName SAPsystemaliasfortheSAPsystemthatisusedasarepository. ThealiasmustmatchaconfiguredRFCconnectionaliasattheSAP Adapter. Nameofthebusinessobjecttoencode. NameoftheBAPI. Optional.Specifiestheencodingusedintheoutputdocuments XMLheader,e.g.iso88591. Optional.Thisflagspecifieswhetheracalltemplate(true)ora responsetemplate(false)iscreated.
258
BAPI Services
BAPI Services
pub.sap.bapi:commit
CommitsatransactionwithasingleormultipleBAPIcalls. Note: Youneedtousepub.sap.client:lockSession/releaseSessiontomakesuretokeepyour connectionintransactionscenariosasthetransactioncontextisstoredwiththesessionin theSAPsystem Input Parameters serverName AliasoftheSAPsystemonwhichthetransactionshouldbe committed.ThisnamemustmatchanRFCconnectionaliasatthe SAPAdapter. Optional.Clientforthesession.Ifnoclientisspecified,thedefault clientisused. Optional.Usernameforthesession.Ifnouserisspecified,the defaultuserisused. Optional.Passwordforthesession.Ifnopasswordisspecified,the defaultpasswordisused. Optional.Languageusedduringthesession.Ifnolanguageis specified,thedefaultlanguageisused. Optional.Flagindicatingifcallshouldwaituntildataisreally writtentodatabase.
259
pub.sap.bapi:rollback
RollsbackatransactionwithasingleormultipleBAPIcalls. Note: Youneedtousepub.sap.client:lockSessionor pub.sap.client:releaseSessiontomakesureto keepyourconnectionintransactionscenariosasthetransactioncontextisstoredwiththe sessionintheSAPsystem. Input Parameters serverName AliasoftheSAPsystemonwhichthetransactionshouldberolled back.ThisnamemustmatchanRFCconnectionaliasattheSAP Adapter. Optional.Clientforthesession.Ifnoclientisspecified,thedefault clientisused. Optional.Usernameforthesession.Ifnouserisspecified,the defaultuserisused. Optional.Passwordforthesession.Ifnopasswordisspecified,the defaultpasswordisused. Optional.Languageusedduringthesession.Ifnolanguageis specified,thedefaultlanguageisused.
260
startDate
$dir
Return Values transactions Optional.ADocumentListcontainingonedocumentwithdetail informationforeachtransaction.Thefollowingkeysarealways included: $tid,sender,receiver,msgType,state,date(the date/time,whenthestateofthistransactionswaslastchanged, formattedintheusualLogTimestampFormat). $sortKey Optional.Specifiesthesortkeyvalid:noSort[default],$tid, sender,receivermsgType,dateandstate.Theresulting transactionlistwillbesortedbythegivenattribute. Optional.Specifiesthesortdirection.descendingtriggersa descendingsortorder;anyothervaluetriggersascendingsort order.
$dir
261
pub.sap.transaction:get
Returnsdetailinformationforasingletransaction. Input Parameters $tid Return values sender receiver msgType state date auditLog Optional.Nameofthesenderofthistransaction. Optional.Nameofthereceiverofthistransaction. Optional.Nameofthemessagetypeofthistransaction. Optional.Currentstateofthistransaction. Optional.Creationdateofthistransaction. Optional.ADocumentListcontainingthedateandmessagethat tracksofalleventsthatoccurredduringprocessingofthis transaction. TheTIDofthetransaction
pub.sap.transaction:getMessageBody
Returnsthepipelinecontainingtheactualmessagebody. Note: ThisServicewillonlyworkifthestoringofmessagebodieshasnotbeendisabled. Input Parameters $tid Return values None. TheTIDofthetransaction
262
pub.sap.transaction:log
Addsanewauditlogentrytothegiventransaction,andoptionallychangesthe transactionstatustothegivennewstate. Input Parameters $tid msg state TIDofthetransaction. Optional.Messagestringtobelogged. Optional.String.Validvaluesare: Created Executed Committed Rolledback Confirmed Return Values None.
pub.sap.transaction:setCacheParameter
Thisservicessetsnewruntimeparametersforthecacheofthetransactionstore. Input Parameters writeCache cacheTimeToLive cachFlushPeriod Optional.IfOn,thewritecacheofthetransactionwillbe switchedon.Anyothervaluewillswitchitoff. Optional.Thisvaluesetsthemaximumtimetoliveforacache entry(valueinseconds).Validrange:0100. Optional.Thisvaluesetsthetimeperiodafterwhichunmodified cacheentriesareflushed(valueinseconds).Validrange:0100.
263
pub.sap.transaction:storeConfig
Returnsthecurrentconfigurationandcacheparameterofthetransactionstore. Input Parameters None. Return values storeType writeCache cacheSize cacheTimeToLive cacheFlushPeriod FileSystemforfilebasedtransactionstore. OnorOffdependingonstateofthecache. Numberofentriescurrentlyheldinthetransactioncache. Currentmaximumtimetoliveperiodforacacheentry(in seconds). Currentperiodafterwhichunmodifiedcacheentriesareflushed (inseconds).
pub.sap.transaction:delete
Deletesonetransactionfromthetransactionstore. Input Parameters $tid Return values None. TheTIDofthetransaction
pub.sap.transaction:deleteAll
Deletestheentiretransactionstore.Exercisecareifyouchoosetousethis. Input Parameters None. Return values deletedEntries Totalnumberofdeletedtransactionsthatmatchedthefilter criteria.
264
pub.sap.transaction:sweep
Thisservicecanbeusedtocleanupthetransactionstorethatmatchesthegivenfilter criteria.Forexample,setitupintheSchedulerasfollows: 1 2 3 CreateaFlowService,whichinvokespub.sap.transaction:sweep. IntheFlowService,definetheinputsusingSet Value. CreateaschedulerjobviaServer SchedulerthatexecutestheFlowService.
Input Parameters elapsedTime maxTrxCount sender receiver msgType state Filtercriteria:timeinminutessincethetransactionhasbeen modifiedthelasttime. Optional.Maximumnumberoftransactiontobedeletedinone executionoftheService. Optional.Filtercriteria:nameofthesenderofthetransaction. Optional.Filtercriteria:nameofthereceiverofthetransaction. Optional.Filtercriteria:nameofthemessagetypeofthe transaction. Optional.Filtercriteria:stateofthetransaction.Validvaluesare: Created Executed Committed Rolledback Confirmed Formoreinformationaboutcleaningthetransactionstore,seeAutomaticCleanupofthe TransactionStoreonpage 173. Return Values deletedEntries Totalnumberofdeletedtransactionsthatmatchedthefilter criteria.
265
Transport Services
pub.sap.transport.ALE:InboundProcess
ReceivesanIDocandforwardsittotheroutinglistener. Input Parameters iDocList $tid $action ContainstheIDoc(s)asanobjectofthetype com.sap.mw.idoc.IDoc.DocumentList. Optional.TheTIDofthetransaction. Optional.Oneofthefollowingtransactioncodes: Code
1 4
pub.sap.transport.ALE:OutboundProcess
SendsanIDoctoanSAPsystem. Important! If$actionissetto4,thisservicebehavesthesameasservice pub.sap.client:confirmTID. Input Parameters transportParams Adocumentwiththefollowingkey/valuepair. Key serverName Value AliasoftheSAPsystemtowhichyouwant tosendtheIDoc.Thealiasmustmatcha configuredRFCconnectionaliasatthe SAPAdapter.
iDocList $tid
266
Transport Services
$action
Oneofthefollowingtransactioncodes: Code
1 4
$queueName
Optional.NameoftheSAPsysteminboundqueue. SpecifyavalueincaseofaqRFCscenario.
Return Values $runtime $rfctime $encoding $call Totalinvocationtime(ms),includingprocessingtimewithinthe SAPAdapter. Time(ms)spentwithintheRFClibrarytocompletetheinvocation. MIMEcompliantcharactersetcorrespondingtothesessionsSAP codepage. Flagindicatingwhetherpipelinerepresentsarequest(true)ora response(false)ofafunctionmodule.
pub.sap.transport.ALE:getRoutingInfo_Default
DefaultservicetoretrieveroutinginformationfromalistofIDocs. Note: ThisservicecanalsohandleIDOC_CONTROLandIDOC_DATArecordlists(for IDocsversion3)orIDOC_CONTROL_REC_40andIDOC_DATA_REC_40recordlists(for IDocsversion4)asIDocinputparametersinsteadofiDocList. Input Parameters iDocList ContainstheIDoc(s)asanobjectofthetype com.sap.mw.idoc.IDoc.DocumentList.
Return Values iDocList sender receiver msgType ContainstheIDoc(s)asanobjectofthetype com.sap.mw.idoc.IDoc.DocumentList. Retrievedfromsenderpartnernumberfromtheheaderofthefirst IDoc. Retrievedfromreceiverpartnernumberfromtheheaderofthe firstIDoc. RetrievedfrommessagetypefromtheheaderofthefirstIDoc.
267
pub.sap.transport.IS:InboundProcess
ReceivesamessagefromaremoteIntegrationServerandforwardsittotherouting listener,whichdeterminestheroutingnotificationtousetoroutethemessagebasedon thesender,receiver,andmessagetypespecifiedintheinputparameters.After determiningtheroutingnotificationtouse,itinvokestheflowservicethatprocessesthe matchingroutingnotification.Thiscanbecalledwithanarbitrarymessagetopassitonto theroutinglistener. Important! Itisrecommendedthatyouusethisserviceasthereceivingpointwhenyouare connectingtwoIntegrationServers. Input Parameters Inadditiontotheparametersspecifiedbelow,theinputparametersmustalsoincludethe messagetoberoutedthroughtheSAPAdapter.Useakeyforthemessagethatthe outboundtransportexpects. sender receiver msgType $tid $action Thesenderofamessage. Thereceiverofthemessage. Messagetypeofthemessage. Optional.TheTIDofthetransaction. Optional.Oneofthefollowingtransactioncodes: Code 1 4 Return Values Dependsontransactionandinvokedroutingnotification. Meaning Execute(default) Confirm
268
Transport Services
pub.sap.transport.IS:OutboundProcess
InvokesaserviceonalocalorremotewebMethodsIntegrationServer. Input Parameters transportParams ADocumentwiththefollowingkey/valuepairs. Key folderName serviceName serverAlias Value Foldernamefortheservicetoinvoke. Nameoftheservicetoinvoke. Optional.AliasofthewebMethods IntegrationServeronwhichtheserviceis tobeinvoked. Toinvokeaserviceonaremoteserver: Specifythealiasfortheremoteserver. Thedefaultvalueislocal,which indicatesthelocalserver.Uselocalto invokeaserviceonthelocalserver thatisnotpasswordprotected. Toinvokeapasswordprotected serviceonthelocalserver,setupan aliasforthelocalserver,specifyinga usernameandpasswordthathas accesstothepasswordprotected service.Then,specifythataliasname. valueScope Optional.Thescopeforthesession. SESSIONindicatestheconnectionistobe savedinyourownsession.GLOBAL indicatestheconnectionistobesavedin asharedarea.UseSESSIONwhenthe workbeingperformedrequiresstatebe maintained.
data
$tid
269
$action
Optional.Oneofthefollowingtransactioncodes: Code
1 4
pub.sap. transport.RFC:InboundProcess
ReceivesaninboundRFCoranRFCXMLdocumentthatistoberoutedthroughtheSAP Adapter. Input Parameters Thisservicerequiresthefollowinginputparameters: sbcHeader Valuesobjectthatrepresentsthekey/valuepairsinthe SBCHEADERtable.Forinformationaboutwhattoincludeinthe arrayofrecords,refertoTheSBCHEADERTableonpage 140. Optional.Thenameofthefunctionmodule. Optional.TheTIDofthetransaction. IfyouwanttoprocesstheRFCcallasynchronouslyusingtRFC, specifythetransactionID.Ifyouwouldliketoperforma synchronousRFCcall,donotspecifythisparameter. $action Optional.Thetransactionstate.Specifyoneofthefollowingcodes: Code
1 4
$rfcname $tid
270
Transport Services
pub.sap.transport.RFC:OutboundProcess
InvokesanRFConanSAPsystem.ThisservicecanhandlebothRFCandtRFCcalls. Input Parameters Thisservicerequiresthefollowinginputparameters: transportParams Adocumentwiththefollowingkey/valuepair. Key serverName Description TheSAPsystemaliasfortheSAPsystemonwhich invoketheRFC.Thealiasmustmatchaconfigured RFCconnectionaliasattheSAPAdapter.
$tid
$action
Optional.Thetransactionstate.Specifyoneofthefollowingcodes: Code
1 4
$rfcname $queueName
Return Values Thepipelinecontainstheresultoftheinvokedfunctionmodule. $runtime $rfctime $encoding $call Totalinvocationtime(ms),includingprocessingtimewithinthe SAPAdapter. Time(ms)spentwithintheRFClibrarytocompletetheinvocation. MIMEcompliantcharactersetcorrespondingtothesessionsSAP codepage. Flagindicatingwhetherpipelinerepresentsarequest(true)ora response(false)ofafunctionmodule.
271
pub.sap.transport.XML:InboundProcess
Canbecalled(e.g.usingHTTPpost)witharbitraryXMLdocumentstopassthemonto theroutinglistener. Input Parameters node $tid XMLNodeobjectthatcanbegeneratedbycalling pub.xml:xmlStringToXMLNodeandisautomaticallygenerated whenpostinganXMLdocumentviaHTTP(using text/xml). Optional.TheTIDofthetransaction. $action Optional.Thetransactionstate.Specifyoneofthe followingcodes: Code
1 4
pub.sap.transport.XML:OutboundProcess
UsethisservicetopostanXMLdocumenttoaspecifiedURL. Thistransportserviceincludespub.client:httpthatperformsHTTPPOST.TheXMLtransport isbasicallyusedforpostingXMLdocumentstoexternalWebservers.Ifyouwantto communicatewithanotherwebMethodsIntegrationServer,youcanuse pub.remote:invoke. Input Parameters ThisservicerequiresthefollowinginputparametersfromtheValuesobject. transportParams Adocumentwiththefollowingkey/valuepair. Key url Description TheURLtowhichtopostthedocument.
272
Transport Services
xmlType
document.
SOAP XRFC canbeselectedasadditionalXML
dialect.ThisequalstoXRFC(RFCXML)with aSOAPenvelope(higherthanSOAP1.1). useTextXml Optional.Flagthatoverwritesthecontenttypeof bXML,XRFCandIDocXMLtotext/xml,ifsetto true. Optional.FlagthatallowstoforcetheXML renderingenginestouseUTF8asencodingfor theresultingdocuments. Optional.Theusernametosupplyforauser name/passwordauthenticationchallenge. Optional.Thepasswordtosupplyalongwith httpUserforausername/passwordauthentication challenge.
ONorOFF.IfsettoON,thepipelineisencodedusing bXMLforBusinessObjects.
useUTF8
httpUser httpPassword
273
$action
Optional.Thetransactionstate.Specifyoneofthefollowingcodes: Code
1 4
pub.sap.transport.BAPI:InboundProcess
WhenpostingbXMLdocumentsrepresentingaBAPIofaBusinessObjecttothisservice, itwilltakecareofpassingthedocumenttotheroutinglistener. Input Parameters sbcHeader objectName bapiName Documentthatcontainsthekey/valuepairswithrouting information.WillbegeneratedbythebXMLparser. Optional.Nameofthebusinessobjectthatisrepresentedinthe pipeline. Optional.NameoftheBAPIthatisrepresentedinthepipeline. $action Optional.Thetransactionstate.Specifyoneofthefollowingcodes: Code 1 4 $tid Return Values Dependsontransactionandinvokedroutingnotification. Meaning Execute(default) Confirm
Optional.TheTIDofthetransaction.
274
Transport Services
pub.sap.transport.BAPI:OutboundProcess
ExecutesaBAPIinanSAPsystem.Thistransportservicecanhandlebothasynchronous andsynchronousexecutionofaBAPI. Input Parameters transportParams Adocumentwiththefollowingkey/valuepair. Key serverName Description TheSAPsystemaliasonwhichtoexecutetheBAPI. ThealiasmustmatchaconfiguredRFCconnection aliasattheSAPAdapter. AllowstorestrictthewayhowtheBAPIcanbe invoked: Value
no restrictions
mode
Meaning Willbeexecutedastheclient requested Onlysynchronouscallis allowed,ifclientpassesa $tid(indicatingan asynchronouscall)an exceptionisthrown. Onlyasynchronouscallis allowed,ifclientdoesnot passa$tid(indicatinga synchronouscall)an exceptionisthrown.
synchronous only
asynchronous only
$tid $action
275
Return Values ApipelinethatrepresentstheresponseoranexceptionoftheexecutedBAPI. $runtime $rfctime $encoding $call Totalinvocationtime(ms),includingprocessingtimewithinthe SAPAdapter. Time(ms)spentwithintheRFClibrarytocompletetheinvocation. MIMEcompliantcharactersetcorrespondingtothesessionsSAP codepage. Flagindicatingwhetherpipelinerepresentsarequest(true)ora response(false)ofafunctionmodule.
Specifications
pub.sap.listener:listenerAuthorizationCheck.
ToprovideapplicationspecificauthorizationhandlingwithSNCenabledRFCservers (listeners),theusermightprovideaservicethatimplementsthisspecification.This servicewillbecalledbytheRFCserver(listener)tocheckforauthorization. ThisservicehastoreturnGrantedintheaccessfieldiftherequestshouldbeaccepted. Ifnoserviceisspecifiedaccesswillbegranted.Ifanexceptionhappensduringexecution ofthisserviceoradifferentstringthanGrantedwillbereturnedtheaccesswillbe denied. Input Parameters functionName partnerName key mode Thefunctionthathasbeencalledbyaremoteclient Thepartner(system)namewheretherequestcomesfrom Theauthorizationkeyasbinarydatadependingonthemode Themodeoftheauthorization:(SNC=SecureNetwork compliantauthorization,Basic=Basicauthorization).Currently, modewillalwaysbeSecureNetworkcompliantauthorization (SNC).
276
Specifications
pub.sap.transaport.ALE:aleRoutingInfo_Default
ToallowcontentbasedroutingforallIDocs,theusermightprovideaservicethat implementsthisspecification.Thisservicewillbecalledpriortoselectingtheright routingnotificationbytheroutinglistener. Input Parameters iDocList ContainstheIDoc(s)asanobjectofthetype com.sap.mw.idoc.IDoc.DocumentList.
Return Values iDocList sender receiver msgType ContainstheIDoc(s)asanobjectofthetype com.sap.mw.idoc.IDoc.DocumentList. ContainsthesendervalueasdeterminedbythisALEdefault routinginfoservice. ContainsthereceivervalueasdeterminedbythisALEdefault routinginfoservice. ContainsthemessagetypevalueasdeterminedbythisALE defaultroutinginfoservice.
pub.sap.transaport.ALE:aleRoutingInfo
Toallowmessagetypespecificcontentbasedrouting,theusermightprovideaservice thatimplementsthisspecification.Thisservicewillbecalledpriortoselectingtheright routingnotificationbytheroutinglistenerbutafterthedefaultALEroutinginfoservice wascalled. Input Parameters iDocList sender receiver msgType ContainstheIDoc(s)asanobjectofthetype com.sap.mw.idoc.IDoc.DocumentList. ContainsthesendervalueasdeterminedbythisALEdefault routinginfoservice. ContainsthereceivervalueasdeterminedbythisALEdefault routinginfoservice. ContainsthemessagetypevalueasdeterminedbythisALE defaultroutinginfoservice.
277
Return Values iDocList sender receiver msgType ContainstheIDoc(s)asanobjectofthetype com.sap.mw.idoc.IDoc.DocumentList. ContainsthesendervalueasdeterminedbythisALEdefault routinginfoservice. ContainsthereceivervalueasdeterminedbythisALEdefault routinginfoservice. ContainsthemessagetypevalueasdeterminedbythisALE defaultroutinginfoservice.
pub.sap.transaport.ALE:aleMappingInfo_Default
ToallowmappingforallIDocs,theusermightprovideaservicethatimplementsthis specification.ThisservicewillbecalledpriortosendinganIDoctoanSAPsystemusing thepub.sap.transport.ALE:OutboundProcessservice. Input Parameters iDocList ContainstheIDoc(s)asanobjectofthetype com.sap.mw.idoc.IDoc.DocumentList.
pub.sap.transaport.ALE:aleMappingInfo
ToallowmessagetypespecificmappingforIDocs,theusermightprovideaservicethat implementsthisspecification.ThisservicewillbecalledpriortosendinganIDoctoan SAPsystemusingthepub.sap.transport.ALE:OutboundProcessservicebutafterthedefaultALE mappinginfoservicewascalled. Input Parameters iDocList msgType ContainstheIDoc(s)asanobjectofthetype com.sap.mw.idoc.IDoc.DocumentList. ContainsthemessagetypevalueasdeterminedbythisALE defaultroutinginfoservice.
278
Specifications
pub.sap.transaport.XML:xmlRoutingInfo
ToallowroutingforincomingXMLdocuments,theusermustprovideaservicethat implementsthisspecification.Thisservicewillbecalledpriortoselectingtheright routingnotificationbytheroutinglistener. Input Parameters node XMLNodeobjectthatcanbegeneratedbycalling pub.xml:xmlStringToXMLNodeandisautomaticallygeneratedwhen postinganXMLdocumentviaHTTP(usingtext/xml). XMLinhierarchicalstructure.
OR document Return Values document sender receiver msgType $tid $action XMLinhierarchicalstructure. ContainsthesendervalueasdeterminedbythisXMLroutinginfo service. ContainsthereceivervalueasdeterminedbythisXMLrouting infoservice. ContainsthemessagetypevalueasdeterminedbythisXML routinginfoservice. TheTIDofthetransactionasdeterminedbythisXMLroutinginfo service. Optional.ThetransactionstateasdeterminedbythisXMLrouting infoservice.Oneofthefollowingcodes: Code 1 4 Meaning Execute(default) Confirm
279
Sample Services
sample.sap:handleIDocXMLPost
SubmitanIDocXMLmessagetoALEInboundProcessontheSAPAdapter. Input Parameters xmlData $action String.TheXMLmessageoftheIDocdocumenttobesent. Required. Optional.Thetransactionstate.Specifyoneofthefollowingcodes: Code
1 4
sample.sap:handleRfcXMLPost
SubmitanRFCXMLorbXMLmessagetoanSAPsystemtoinvoketheassociatedRFC function. Input Parameters serverName StringThealiasfortheSAPsystemonwhichtoexecutetheRFC. ThealiasmustmatchaconfiguredRFCconnectionaliasattheSAP Adapter. StringTheXMLmessageoftheRFCXMLdocument. Optional.bXMLorRFCXML,documenttypeusedforthepost.
XMLmessagerepresentingtheresponseofthefunctionmodule.
280
Sample Services
sample.sap:handlebXMLPost
SubmitsabXMLmessagetoanSAPsystemtoinvoketheassociatedBAPI. Input Parameters serverName xmlData mode AliasfortheSAPsystemonwhichtoexecutetheBAPI.Thealias mustmatchaconfiguredRFCconnectionaliasattheSAPAdapter. StringXMLmessagerepresentingaBAPIrequestinbXML. AllowsyoutochoosethewayhowtheBAPIwillbeinvoked: Value
sync async routing
sample.sap.Helpers:writeSAPXMLFile
ThisservicewillconvertRFCsorIDocscomingfromanSAPsystemtoSAPXML(IDoc XMLorRFCXML)andwritetheresulttoanoutputfileintheWmSAP/pubdirectory.To callit,createaroutingnotification,andassignitthisservice. Input Parameters None. Return Values None.
281
sample.sap.Helpers:invokeBapiReturningBXml
ThisinternalserviceisinvokedbyhandleBXmlPost. Input Parameters serverName mode AliasfortheSAPsystemonwhichtoexecutetheBAPI.Thealias mustmatchaconfiguredRFCconnectionaliasattheSAPAdapter. AllowsyoutochoosethewayhowtheBAPIwillbeinvoked: Value
sync async routing
sample.sap.Helpers:invokeAndReturnXml
ThisinternalserviceisinvokedbyhandleRfcXmlPost. Input Parameters serverName TheSAPconnectionaliasfortheSAPserveronwhichtoexecute thefunctionmodule.ThealiasmustmatchaconfiguredSAP connectionontheSAPAdapter. Nameofthefunctionmoduletobeinvoked. Optional.SpecifyTIDfortransactionalinvoke. Optional.SettobXMLtoencodetheresultsofthefunction modulecallinbXMLformat.
282
sample.sap.Helpers:encodeRPCResponse
SampleserviceusedtoencodeaDocument(<key/value>pairs)asRPCXMLmessage. Input Parameters document Return Values xmlData RPCXMLstringrepresentingtheinputdocument. Documentcontainingkey/valuepairs.
sample.sap.idoc.Mappings:orders
ExampleserviceforcontentbasedroutingofORDERSIDocs.Theservicedetermines routinginformation(sender,receiver,msgType)forthegivenIDocoftypeORDERS. Forthedescriptionofinputparametersandreturnvalues,pleaseseeservicespecification pub.sap.transaport.ALE:aleRoutingInfo.
sample.sap.idoc.Mappings:ordrsp
ExampleserviceformappingORDRSPIDocs.Theservicedoessomemappingoffields forthegivenORDRSPIDoc. Forthedescriptionofinputparametersandreturnvalues,pleaseseeservicespecification pub.sap.transaport.ALE:aleMappingInfo.
283
destination ownHost partnerHost systemNumber systemID client user language ISOLanguage ownCodepage partnerCodepage ownRelease partnerRelease kernelRelease partnerType trace ownType rfcRole CPICConversationID encoding charset bytesPerChar
String.Destinationoftheconnection. Hostname(orIP)ofthemachinetheIntegrationServeris runningon Hostname(orIP)ofthemachinetheSAPsystemisrunningon SystemnumberoftheSAPsystem UniquethreeletterIDofSAPsystem(inlocalnetwork) Clientthesessionisconnectedto SAPuserthathasconnectedwiththissession Logonlanguage ISOnameforlogonlanguage SAPcodepagethisconnectionisusing SAPcodepagetheSAPsystemisrunningon VersionoftheloadedRFClibraryusedbytheSAPAdapter ReleaseoftheSAPsystem KernelreleaseoftheSAPsystem RFCtypeofthepartner;R/3(3),R/2(2)orexternalRFCserver (E) Flagindicatingwhethertraceisturnedon(true)oroff(false) forthisconnection RFCtypeoftheSAPAdapter;shouldalwaysbeE RoleoftheSAPAdapterinthiscall;shouldalwaysbe:C(for client) CPICIDoftheconnection(lowlevelprotocolinformation) IANAencodingthatisequivalenttotheSAPcodepageused, e.g.ISO88591 CharsetthatisequivalenttotheSAPcodepageused,e.g. ISO8859_1(usedinJavaconstructors) Numberofmaximumbytesusedpercharinthecodepage
284
APPENDIX
Deprecated Services
List of Deprecated Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
285
286
APPENDIX
287
288
Use the following steps if you are using pub.xml:documentToXMLString 1 2 3 Extendyourdocumentbyaddingtheattribute@encodingasaStringasachildofthe rootelement. Inserttheproperdefaultvalue(e.g.ShiftJIS,ifyoursourcedataisShiftJISencoded). Inthepub.xml:documentToXMLStringService,mapyourdocumenttoinputfield document.
289
290
APPENDIX
291
A P P E N D I X G U s i n g B i z Ta l k E n v e l o p e s w i t h t h e S A P A d a p t e r
Overview
TheSAPAdapterusestheBizTalkXMLenvelopeasthetransportenvelopeforthe transmissionofXMLbusinessdocuments.TheBizTalkenvelopeisimplementedonthe SAPAdapterinaccordancewiththeBizTalkFramework1.0aIndependentDocument SpecificationofJanuary,7th2000. AsBizTalkspecificationsareopentoimplementationspecificinterpretationsofsomeof theprovidedXMLelements,thischapterdescribeshowtheSAPAdaptercopeswith BizTalkenvelopetagsthatarenotspecifiedclearlyenough.BizTalkstronglydifferentiates betweenatransportheaderandanapplicationspecificbody,whichresultsinthe followingoverallstructureoftheBizTalkenvelope:
<biztalk_1 xmlns="urn:schemas-biztalk-org:BizTalk/biztalk-1.0.xml"> <header> <!-- Header and processing information is contained here --> </header> <body> <!-- Business transaction information is contained here --> </body> </biztalk_1>
292
AfullBizTalkXMLheadermaylooklikethis(takenfromtheMicrosoftBizTalk specification):
<?xml version='1.0' ?> <biztalk_1 xmlns="urn:schemas-biztalk-org:BizTalk/biztalk-1.0.xml"> <header> <delivery> <message> <messageID>xyzzy:8</messageID> <sent>1999-01-02T19:00:01+02:00</sent> <subject>Purchase Order</subject> </message> <to> <address>http://www.fabrikam.com/recv.asp</address> <state> <referenceID/> <handle/> <process/> </state> </to> <from> <address>mailto:foo@contoso.com</address> <state> <referenceID>123</referenceID> <handle>7</handle> <process>myprocess</process> </state> </from> </delivery> <manifest> <document> <name>PO</name> <description>Purchase Order</description> </document> </manifest> </header> <!-- body definition here --> <biztalk_1>
293
A P P E N D I X G U s i n g B i z Ta l k E n v e l o p e s w i t h t h e S A P A d a p t e r
294
295
A P P E N D I X G U s i n g B i z Ta l k E n v e l o p e s w i t h t h e S A P A d a p t e r
<sent>
Forexample:
2000-06-19T18:59:02 describesJune19,200018hours59
minutes2seconds.
<subject>
Error Handling
BizTalkdoesnotdescribeitsownerrorhandlingconceptinitscurrentspecification. However,itrecommendsthatyoudefineapplicationspecificerrordocumentstohandle applicationerrors.Forserverrelatederrors,itdescribesusingstandardizedXML exceptiondescriptors. TheSAPAdapterdistinguishesbetweentwomajorgroupsoferrors: ErrorsintheXMLprocessingandconversionlayersoftheSAPAdapter,andcritical errorsintheSAPsystemsthatcauseaterminationoftheconnection. Applicationspecificerrorssuchaserrorsthatwereforeseenbytheapplication developersandthereforedefinedattheinterfacedefinitionintheSAPsystem.For example:areceiptcouldnotbeprocessedbecauseofbusinesslevelproblems.
296
Error Handling
Description Anumberspecifyingtheclassoferror.Compatiblewiththe MicrosoftSOAPXMLframeworkspecification.TheSAPAdapter alwayssetsthisvalueto401toindicateanapplicationspecific error. InternalSAPAdaptercodeforthisexception. Detailsofthespecifiedsubelements<name>and<message> NameofanexceptiontousewiththeSAPsystemastheABAP exceptionidentifier. Errormessagewiththespecifiedsubelement<text>.(Optional; thisisnotalwaysfullyspecified). Thetextoftheerrormessage.
<message>
<text>
297
A P P E N D I X G U s i n g B i z Ta l k E n v e l o p e s w i t h t h e S A P A d a p t e r
Anexampleofanexceptiondocument:
<?xml version="1.0" encoding="iso-8859-1"?> <biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1"> <header> <delivery> <message> <messageID>0A125F1315B39EDB00000013</messageID> <sent>2000-06-19T18:59:02</sent> </message> <to> <address>urn:sap-com:logical-system:SAPCLNT001</address> </to> <from> <address>urn:sap-com:logical-system:SAPADA0001</address> </from> </delivery> </header> <body> <sap:Fault xmlns:sap="urn:sap-com:document:sap:business" xmlns=""> <faultcode>401</faultcode> <faultstring> com.wm.adapter.sap.error.SAPBasicException </faultstring> <detail> <name>SBC_EXCEPTION</name> <message> <text>Business object named Bank2 does not exist in SAP System U9C</text> </message> </detail> </sap:Fault> </body> </biztalk_1>
298
APPENDIX
299
Overview
WiththeXMLformatdefinedintheInterfaceRepository,SAPestablishesastandardized exchangeofbusinessmanagementdataonasemanticlevelacrosstheweb.XML documentswhicharegeneratedaccordingtotheXMLformatanddefinedintheInterface Repositoryarecalledbusinessdocuments. Thenumberofbusinessdocumentsexchangedbetweentwopartnerstoinvokeabusiness managementfunctiondependsontheunderlyinginterfacetypeandtheusagescenario. DuringasynchronouscallofaBAPIorRFC,twobusinessdocuments(requestand responsedocument)areexchanged.Duringanasynchronouscall,onlyarequest documentisexchanged. Characteristicsofbusinessdocumentsare: UseofXMLenvelopes Commonstructureforrequestandresponsedocuments Commonwayofrepresentingparameters Commonerrorhandlingconcepts Note: IDocsdonotsupportallofthesefeatures
300
Overview
301
302
Description Identifiestheexception.Normallyaglobalname. The<Message>elementreferencesanSAP messagethatdescribestheerrorsituation. Messageclass Messagenumber Errordescription The<Attributes>elementcontainsadditional applicationspecificinformation: Tablewithserializedexceptionsthatrepresent singleerrormessages,iferrorcollectionshaveto bereturned.Eachserializedexceptionwithinthe <Collection>elementhasthesamestructureasthe wrapperexception. Namedattributes(AttributenameX=Nameof Attribute)inwhichadditionalapplicationspecific informationcanbereturned
<Collection>(optional)
MoredetailedinformationabouttheXMLformatdefinedintheInterfaceRepositorycan befoundathttp://ifr.sap.com.
303
Additionally,considerthefollowing: ThearrangementofBAPIsaccordingtoabusinessobjectisdirectlyreflectedbythe elementnamesofthebusinessdocument.TherootelementthatidentifiestheRequest businessdocumentcarriestheconcatenationofthebusinessobjectnameandtheBOR methodnameasitsname.Therootelementhasthefollowingcharacteristics: ItcontainsthenamespacereferenceofbusinessdocumentsthatrefertoBAPIs ("urn:sap-com:document:sap:business"). IftheBAPIisaninstancemethod,therootelementcontainsanattributeforeach keyfieldofthecorrespondingbusinessobjectthatisnamedlikethekeyfield. Note: Ifthebusinessobjecthasmorethanonekeyfield,thecorresponding attributesshouldappearinthesamesequenceasthekeyfieldsdefinedinthe BOR. ImportparametersoftheBAPIappearassubelementsoftherootelement.Thesesub elementsarenamedliketheparametersastheyaredefinedintheBOR.Withinthese elements,theSAPinternaldatastructuresarerepresentedinaserializedformin accordancewiththespecificationSerializationofABAPDatainXML(forfurther information,pleaserefertoRelatedDocumentationonpage 13).
304
ThisisthestructureofresponsebusinessdocumentsforBAPIs:
<doc:BusinessObjektName.MethodenName.Response xmlns:doc="urn:sap-com:document:sap:business" [Key1=, Key2=, ]> <BOR_Parameter1>...</BOR_Parameter1> ... </doc:BusinessObjektName.MethodenName.Response>
Additionally,considerthefollowing: ThearrangementofBAPIsaccordingtoabusinessobjectisdirectlyreflectedbythe elementnamesofthebusinessdocument.Therootelementthatidentifiestherequest businessdocumentcarriestheconcatenationofthebusinessobjectname,theBOR methodnameandthesuffix.Responseasitsname.Therootelementhasthe followingcharacteristics: ItcontainsthenamespacereferenceofbusinessdocumentsthatrefertoBAPIs (urn:sap-com:document:sap:business). IftheBAPIisaninstancemethodorafactorymethod,therootelementcontains anattributeforeachkeyfieldofthecorrespondingbusinessobjectthathasthe samenameasthekeyfield. Important! Ifthebusinessobjecthasmorethanonekeyfield,thecorresponding attributesshouldappearinthesamesequenceasthekeyfieldsdefinedinthe BOR. ExportparametersoftheBAPIappearassubelementsoftherootelement.Thesesub elementshavethesamenameastheparametersdefinedintheBOR.Withinthese elements,theSAPinternaldatastructuresarepresentedinaserializedformin accordancewiththespecificationSerializationofABAPDatainXML(forfurther information,pleaserefertoRelatedDocumentationonpage 13). IftheBAPIisafactorymethod,possiblyonlythekeyfieldsofthecreatedinstance willbereturnedtotheclient.Inthiscase,theresponsebusinessdocumentonly consistsofattributes.
305
Theseerrordescriptionshavethefollowingcharacteristics: ErrormessagesoftheBAPIreturnparameteraredisplayedasserializedexception objectsonXMLlevel.Sotherepresentationoftheerrordescriptionintheexception businessdocumentdiffersfromtheoriginalBAPIreturnstructure.Messagesoftype EarerepresentedasexceptionswithnameBapiError.MessagesoftypeAare representedasexceptionswiththenameBapiAbort. Statusmessages(messagesofthetypeS,I,orW)thatarealsopartoftheReturn parameterarestillreturnedasthereturnparameterstructure. Important! AllstatusmessageswillbemappedtotheBAPIRET2structure. TheexportparametersoftheBAPIarenottakenintoaccount. ThedetailedstructureoftheExceptionbusinessdocumentsdependsonwhetherthe returnparameterisastructureoratable.
306
XML Element
<Message>
(0..1)
<ID> <Number> <Text> <Attributes>(optional) <MESSAGE_V1>(optional), <MESSAGE_V2>(optional), <MESSAGE_V3>(optional), <MESSAGE_V4>(optional) <LOG_NO>(optional) <LOG_MSG_NO> (optional) <PARAMETER>(optional) <ROW>(optional) <FIELD>(optional) <SYSTEM> (optional)
307
If,despitetheerrormessages,thereturntablecontainsadditionalmessagesoftypeS,I,or W,thesemessagesaredisplayedinatableofrowtypeBAPIRET2withina<Status> element,whichisasubelementofthe<Attributes>element. IfaBAPIreturntablecontainserrormessages,thefollowingXMLelementscomprisethe resultingexceptionbusinessdocument: Corresponding Information from the Return Parameter BapiError,ifvalueoffieldTYPEisE. BapiAbort,ifvalueoffieldTYPEisA. Thethreesubelementscontainageneric messagethatisusedforallreturntables(for example:DuringtheexecutionoftheBAPI oneormoreerrorsoccurred). XMLrepresentationofeacherrormessage withinthereturntable.Withinthe<item> elements,thedataofasinglereturnmessage isdisplayedasaserializedexceptionobject.
XML Element
<Name>
<Message> (0..1) <ID> <Number> <Text> <Attributes> <Collection> <item> <Name></Name> <Message></Message> <Attributes> (optional) ... </Attributes> </item> <item> (optional) ... </item> ... </Collection>
308
XML Element
<Status> (optional) <item> <ID> (optional) <TYPE> (optional) <NUMBER> (optional) <MESSAGE> (optional) <MESSAGE_V1> (optional) <MESSAGE_V2> (optional) <MESSAGE_V3> (optional) <MESSAGE_V4> (optional) <LOG_NO> (optional) <LOG_MSG_NO> (optional) <PARAMETER> (optional) <ROW> (optional) <FIELD> (optional) <SYSTEM> (optional) </item> <item> (optional) </item> </Status>
Corresponding Information from the Return Parameter The<Status>elementcontainsaserialized tablewithrowtypeBAPIRET2.Withinthe <Status>element,allreturnmessagesoftype S,I,orWthatarealsoreturnedintheBAPI returnparameteraredisplayed.
309
Additionally,considerthefollowing: Therootelementthatidentifiestherequestbusinessdocumenthasthesamenameas thecorrespondingfunctionmodule.Itcontainsthenamespacereferenceofbusiness documentsthatrefertoRFCs("urn:sap-com:document:sap:business:rfc"). ImportparametersoftheRFCappearassubelementsoftherootelement.Thesesub elementshavethesamenameastheparametersastheyaredefinedinthefunction moduleinterface.Withintheseelements,theSAPinternaldatastructuresare representedinaserializedforminaccordancewiththespecificationSerializationof ABAPDatainXML(forfurtherinformation,pleaserefertoRelatedDocumentation onpage 13). Becauseitisnotpossibletodistinguishtablesinthefunctionmoduleinterfacein importtablesandexporttables,alltablesthatshouldbetakenintoaccounthavetobe representedassubelements.
Additionally,considerthefollowing: Thenameoftherootelementthatidentifiestheresponsebusinessdocumentis definedastheconcatenationofthenameofthecorrespondingfunctionmoduleand thesuffix.Response.Itcontainsthenamespacereferenceofbusinessdocumentsthat refertoRFCs("urn:sap-com:document:sap:business:rfc"). ExportparametersandtablesoftheRFCappearassubelementsoftherootelement. Thesesubelementshavethesamenameastheparametersdefinedinthefunction moduleinterface.Withintheseelements,theSAPinternaldatastructuresare presentedinaserializedforminaccordancewiththespecificationSerialization of ABAP Data in XML(forfurtherinformation,pleaserefertoRelatedDocumentation onpage 13).
310
Description Nameoftheexceptionasdefinedinthefunctionmodule interface. The<Message>elementcontainsinformationfromtheSY fields.Couldbeemptyifthemappingwasperformedon anexternalmiddlewaresystem. SYMSGID SYMSGNO Messagetext,whichisdefinedforIDandnumber.In ABAP,evaluatedwithmessage id... into.. ContainslistofSYfields,whichrepresentthevariablesof anerrormessage. SYMSGV1 SYMSGV2 SYMSGV3 SYMSGV4
(0..1)
<ID> <Number> <Text> <Attributes>(optional) <V1>(optional) <V2>(optional) <V3>(optional) <V4>(optional)
311
Additionally,considerthefollowing: Therootelement,whichidentifiesthebusinessdocumentforanIDoc,hasthesame nameasthecorrespondingIDoctype. TheIDocitselfisencapsulatedbytheelement<IDOC BEGIN="1"> ...</IDOC>.The elementcontainstheattributeBEGINwiththefixedvalue1. TheIDoccontrolrecordisdefinedthroughtheelement<EDI_DC40 SEGMENT="1">...</ EDI_DC40>. EachIDocsegmentisrepresentedasaseparateelementthathasthesamenameas correspondingIDocsegment.SAPsegmentsusuallyhavetheprefixE1.These elementscontaintheattributeSEGMENTwiththefixedvalue1,whichdefinesthe beginningofthesegment. Theelementnameforthefieldswithinonesegmentaregivenbythenameofthe correspondingfield.AnXMLdocumentforanIDocmaycontainemptyfields.These fieldsaredisplayedaselementswiththeform<FieldName/>.
312
313
314
Index
A
ABAP debug 60 Dictionary Type 70 program for a coded client 201 types in the adapter 230 wrapper for calling a function module 140 About page 32 Access Control Lists (ACLs), assigning 46 adapter connections built-in services 29 changing at service run time 30 clustering requirements 52 described 28 overview 28 planning for 28 adapter listener notifications. See listener notifications. adapter package 28 clustering requirements 51 loading and unloading 45 adapter services changing connection at service design time 30 changing connection at service run time 30 clustering requirements 52 create 75 description of RFC adapter service 31 function module 74 overview 30 RFC 74 RFC client connection 74 template 74 templates 31 test 76 adapter updates applied, viewing 32 adapter versions clustering requirements 51 administrative services disablng redirection 50 ALE listener notifications create asynchronous 105 create synchronous 101 description 31 Monitor IDocs 81 ALE transport 136 application server 58 authorization service 89
B
BAPI description 23 function module 74 testing connections 68 transport 137 built-in services BAPI services 259 bXML services 257 client services 232 IDoc services 248 IDoc-XML services 254 monitoring services 256 pub.art.connection:setAdapterServiceNodeConnection 29, 30 sample services 280 SAP listener services 283 specifications 276 transaction administration services 261 transport services 266 XRFC services 245
C
client 57 code clients 192 RFC 23 clustering benefits 47 cluster store 47 connection pooling enabled 53 defined 47 description 47
315
Index
disadvantages 48 failover support 47, 48 inbound RFCs 49 load balancing 47, 48 outbound RFCs 48 recommnedations for SAP Adapter 47 replicating packages in clustered environment 49 requirements 51 restrictions for SAP 48, 49 restrictions on transactions 47 scalability 47, 48 configuration disk space 34 log files 35 system memory 37 connection alias 57 connection pooling overview 29 run-time behavior 29 connections copying 65 deleting 66, 186 editing 64 enabling 63 preventing use of 66, 186 SNC connection 62 testing BAPI execution 68 testing RFC execution 67 viewing parameters 64 conventions used in this document 14
disabling redirection of administrative services in clustered environment 50 document type IDoc 122 RFC structure 122 documentation additional 15 conventions used 14 feedback 15 DTD 123
E
editing listener notifications 108 routing service 140 synchronous listener notification 103 enabling listener notifications 106 listeners 91 packages 44 exporting packages, renaming disallowed 45 external RFC server 58
F
fixes, viewing applied 32 forward confirm event flag 81, 131 function module adapter services 74 BAPIs 74 create 110 description 74 Lookup 67
D
Data Dictionary Cache 216 deleting connections 66, 186 listener notifications 109 listeners 96 routing notification 139 dependencies, package 43 disabling listener notifications 109 listeners 97 redirection of administrative services 50
G
gateway host 58, 88 gateway service 58, 88 group access control, assigning 46
I
IDoc description 24
316
generate document type from DDIC 122 generate document type from DTD 123 generate document type from sample IDoc 124 route through routing listener 129
L
language 57 LIBRFC 24 listener name 88 listener notifications behavior of 106 components 80 configuring asynchronous notifications 105 RFC asynchronous notifications 103 RFC synchronous notifications 99 synchronous notifications 101 configuring asynchronous 105 defined 31 deleting 109 disabling 109 editing 108 asynchronous publishable document type 108 notification order 94, 133 enabling 106 prerequisites for configuring 97 testing 106 testing publishable document types 107 types 31 using asynchronous and synchronous 98 viewing 107 viewing notification order 93 listeners copying 95 deleting 96 disabling 97 editing 94 enabling 91 viewing parameters using the Administrator 93 viewing parameters using the Developer 93 load balancing 47, 57 loading adapter packages 45
namespace node packages 45 WmART package 45 log files 35 log transaction status 61, 90 logging about 188 file location 188 RFC trace file 188 Logging screen 188 logon group 57 Lookup function module 67 using Lookup 67
M
Manager (webMethods), using with EJB Adapter 32 memory 37 message server 58 monitoring component response time 189 data captured 189
N
namespace node packages loading and unloading 45 package dependencies 43 notifications. See listener notifications. number of threads 88
O
overriding services default connection at run time 30
P
packages enabling and disabling 44 loading and unloading 45 management overview 28 renaming when exporting (disallowed) 45 replicating in clustered environment 49 SAP package 42 WmSAP 28 packages, adapter
317
Index
loading and unloading 45 packages, namespace node loading and unloading 45 password 57 platforms 34 preventing use of connections 66, 186 program code conventions in this document 14 program ID 58, 88 publishable document type testing in asynchronous notifications 107
R
redir.cnf file 50 replicating packages in a clustered environment 49 repository server 89 repository service 58 response time monitoring 189 RFC code library 24 configure RFC listener 87 create adapter notification 110 create RFC destination 84 description 23 generate document type for a structure 122 invoke from Java service 192 LIBRFC 24 local RFC metadata 89, 217, 218 protocol 24 route through routing listener 129 routing 140 test RFC listener 92 testing connections 67 trace file 188 transactional RFC 23 transactional RFC protocol 23 transport 136 RFC adapter service about 74 create 75 RFC client description 23 workflow 25
RFC listener 23 RFC listener notification 31, 32 RFC protocol 24 RFC server description 23 workflow 25 RFC trace 60, 90 RFC trace files, viewing and deleting 188 RFC_TRACE_DIR environment variable 188 routing RFC 140 routing directly through the adapter 129 routing listener description 24 routing notification components 130 create 134 deleting 139 description 32 transports 134 using wildcards 132 routing service 140 run-time processing connection pools 29
S
SAP code library 24 SAP log file 189 SAP log files, viewing and deleting 188 SAP router string 60 SAPGui note about screen images 15 security SAP adapter as RFC server 210 SAP cryptographic library 211 user name and password 208 X.509 certificate 208 SNC enabled 59, 89 name 59, 89 partnername 59 quality of service 59, 89 setup connection 62
318
store message body 61, 90 structures 122 supported platforms 34 synchronous listener notification editing 103 system ID 58 system memory 37 system number 58
U
unicode listener 90 unloading adapter packages 45 namespace node packages 45 WmART package 45 updates to the adapter, viewing 32 Use SAPGui 60 user name 57
T
testing listener notifications 106 publishable document types 107 TID character length 23 Confirm TID event 81 description 23 for ALE IDoc Monitoring 102 trace files, viewing and deleting 188 transaction centralized transaction store 181 configuring client 184 configuring server 182 deleting 186 considerations about centralized transaction store 53 transaction store 35 transaction ID character length 23 transaction store 35 description 24 transactions managing 170 transaction store 170 transports ALE 136 BAPI 137 for routing notification 134 IS 135 RFC 136 XML 138 tRFC 23 tRFC protocol 23 troubleshooting information 15
V
viewing adapter updates applied 32 listener notifications 107 listener parameters using the Administrator 93 listener parameters using the Developer 93
W
watt.sap.aclset 227 watt.sap.debug.facList 226 watt.sap.debug.level 226 watt.sap.idocxml.escaping 226 watt.sap.listener.checkTime 225 watt.sap.listener.responseTime 226 watt.sap.monitor 227 watt.sap.repo.maxPooledConnections 225 watt.sap.repo.maxWaitForPool 225 watt.sap.repo.timeout 225 watt.sap.repo.timeoutCheckPeriod 225 watt.sap.rfcxml.version 226 watt.sap.snclibpath 227 watt.sap.systat01.partnerNumber 227 watt.sap.throughput 227 watt.sap.xml.prettyPrint 226 watt.sap.xtn.cacheFlushPeriod 226 watt.sap.xtn.cacheTimeToLive 226 watt.sap.xtn.fastAsyncMode 226 webMethods Manager, using with EJB Adapter 32 wildcards for routing notification 132 WmART package
319
Index
load and reload order 45 loading and unloading 45 unload order 45 WmSAP pacakge 28
X
X.509 certificate 208
320