370 likes | 615 Views
Extending mySAP.com with COM+ and .NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation. Agenda. Conversing with R/3 R/3 Protocols Formats Gotchas Technologies SAP DCOM Connector Connector Architecture Mechanics Administration Configuration & Tuning
E N D
Extending mySAP.com with COM+ and .NETPeter RussoProgram ManagerEnterprise Program ManagementMicrosoft Corporation
Agenda • Conversing with R/3 • R/3 Protocols • Formats • Gotchas • Technologies • SAP DCOM Connector • Connector Architecture • Mechanics • Administration • Configuration & Tuning • Troubleshooting • 4.6d Features • tRFC, qRFC, Outbound Calls • Futures
Protocols • Native • GUI (Diag) • RFC • HTTP (In 6.2.0) • Batch (File Transfer) • Batch Input • Direct Input • ALE (File Transfer or RFC)
Protocols (cont) • Each has a proprietary format • Each is platform independent • RFC client libraries for all platforms • Each meets different business programming needs • Implementation overlap • RFC calls can be wrapped as IDOCs • Screen transactions can be wrapped as RFCs • IDOCs can be submitted via RFC
Formats • RFC has COM, CORBA, Java wrappers • SAP COM Connector • Actional • Visual Age • SAP has defined an XML format for IDOCs (4.6B or greater) • SAP Business Connector exposes RFC invocations as XML
Gotchas • Guaranteed delivery into and out of R/3 is not trivial • tRFC mechanism provides exactly once guarantees (not a two phase commit) • Supports both inbound and outbound • Restricted use of RFC • Strict programming conventions for both client and server programs • If in order inbound (to R/3) message delivery is also required, SAP provides a queued version of tRFC called qRFC • 4.6c or greater versions of R/3
Technologies • New features in the 4.6D SAP Com Connector (SAP) • tRFC and qRFC Support • Supports GUIDs as TIDs • Custom IDOC submission dll • Generic RFC server • BTS Connector Resource Kit (MS) • IDOC submission AIC • IDOC tRFC server component
Connector Architecture • Components and Release Level • Technologies
Connector Architecture - Components • Librfc32.dll (version 4.6d) • W2K SP1 - or • NT 4.0 (SP4 or greater) • NT Option Pack • MTS 2.0 (including SDK) • IIS 4.0 • Management Console (MMC) • MDAC 2.5 or greater • CC Administrator • Object Builder • VS 6.0 (SP4) or greater
Connector Architecture -- MDAC • OLEDB • Componentized data access • Common abstraction for tabular data • Specialized extensions for OLAP, etc. • ADO (ActiveX Data Objects) • Simple high level interface to data objects • RDS (Remote Data Servcies) • Allows data to be passed across http/dcom to the client • Static “client-side” cursoring over result sets • Ability to return Recordsets from business objects across machine boundaries
Connector Architecture – SAP Technologies • R/3 4.x features • Much lower latency by • streamlined communication technology • R/3 automatically switches between different operation modes with respect to workload • round-trip times are comparable with database request. • Clean up of user context without logoff • DCOM Connector automatically detects the version on the target system and uses these features
Mechanics A View of the Object Life Cycle • Object Instantiation and MTS • Connecting to R/3 • Destination and Logon Handling • RFC pooling • Method Invocation • Data marshalling • Object Cleanup • Special Considerations for Transactions
BO Mechanics - Object Instantiation R/3Application Server Clients MTS RFC DCOM Librfc32.DLL BAPI ABAP Objects ISAPConnector ITab Type Mapping RFC-C-API RFC-COM-API
Mechanics - Object Instantiation • MTS runtime intercept all method calls prior to executing your code • Handle transaction management, layered security model, MTS-specific concurrency model • MTS puts its class factory between COM and you • MTS creates a context wrapper for each class instance that sits between the stub and you • Only visible concept in MTS is the package • Packages are a collection of in-process servers that trust one another • Security checks are performed for the package • No security checks are performed between components in a package
MechanicsDestination & Logon Handling • Destination configuration • Destination property set in component at invocation • Default destination can be assigned to object • Gateway default destination (4.5a - ‘NONE’) is eliminated • User Mapping & Security (options) • Hardcode UserID & Password into the component :-( • Default UserID & Password with a destination in registry • Use roles and NT users to further control component access :-) • Collect explicit logon info from user & pass to component • Use single sign-on and internal R/3 mapping tables (4.6x)
Mechanics - RFC Pooling R/3 RFC connection automatically provided by DCOM Connector from pool of connections when required by method invocation. DCOM RFC ResourceDispenser Void connection
ADO-Recordset SAP-IRowset RDS-IRowset Mechanics Table Handling via RDS & ADO R/3Application Server Output Tables DCOM RFC BO BAPI ABAP Objects itab Dim myRS as Recordset Set Foo = New Bar1 Foo.GetCustList(‘*’, myRS)
Configuration & Tuning • Connector Global parameters • Set in the Admin Consolevia Monitor -> Parameters • Set in System Environment • Connector Destination parameters • Set in the Admin Console via Destinations -> Edit • Connector Component parameters • Set in the Admin Console via Components • Set in MTS Management Console • R/3 RFC parameters • Set in R/3 profile
Troubleshooting • RFC trace (set per destination) • Trace = 1 • RFCxxxxxx.trc • Dev_rfc.trc • TableDump = 1 • ST05 • SAPGUI debugging • Check MTS Security & Roles
Troubleshooting • Debugging into R/3 • AdviseRFCGuiSink() Client Sapgui RfcGuiSink Librfc32.dll
Review of RFC Quality of Service • RFC: • Synchronous call • Client waits until the processing is completed • Supports input and output parameters • Easy in ABAP: Call .... DESTINATION Dest ..... • Easy in C: RfcCallReceive() • Easy in VB and script: SAP DCOM Connector, SAP Automation, C call
client client client server server server Review of RFC Quality of Service • Problem with RFC when errors occur: • Where did the error take place? • Should the failed call be repeated? Check data+ customizing and retry Can retry Don't retry
Review of RFC Quality of Service: • tRFC • Guaranteed to execute only once • External tRFC is always synchronous • ABAP tRFC is asynchronous • Only supports input parameters • Easy in ABAP: Call ... DESTINATION Dest IN BACKGROUND TASK ...... • Easy in C: RfcCallIndirectEx () • Easy in VB: SAP DCOM Connector, C call • External program must ensure: • Transaction ID management, • Scheduling for retry after any errors • A particular order for execution cannot be guaranteed
Review of RFC Quality of Service: tRFC client server RfcCreateTransID Get TID Store TID and DATA Insert TID, + Call Execution RfcIndirectCallEx Delete TID and DATA RfcConfirmTransID Delete TID
Review of RFC Quality of Service: • qRFC • Guaranteed to execute only once and in the specified sequence • Execution is asynchronous • Not integrated in the ABAP runtime. qRFC is controlled by calls to system function module • In ABAP, you can choose between • queuing on the caller system: outbound queue (APO) • queuing on the called system: inbound queue (CRM) • The RFCSDK offers support for queues in the SAP system: • inbound queues for external clients, • outbound queues for external servers. • However, external programs can also perform their own external queuing (MSMQ, BizTalk....)
Review of RFC Quality of Service: • qRFC continued: • External program must ensure : • Transaction ID management, • Scheduling for renewed submission after an error • “Someone” must activate the queue • SMQR for queue registration • Programmatic • SAP System may schedule a retry after errors for the execution
tRFC and qRFC support in the 4.6d RFCSDK • tRFC, qRFC have been integrated into the DCOM Object Builder. • Requires tRFC and qRFC support in the R/3 target • Simply select level of service required when building the proxy • Note: only one level of service per proxy object • When you use the relevant options, the generated proxies expose the following new methods: • CreateNewTid() • QueueName() • Confirm() • ActivateQueue() • GUID’s can be used for TID’s • Facilitates connection with services that already associate GUIDS with messages/data
COM for ABAP Service Outbound COM Gateway R/3Application Server Some COM Object (D)COM RFC
SAP DCOM Connector Server Middleware : Details Outbound COM Gateway R/3Application Server Some COM Object NT-Service (D)COM RFC Generic stub Metadata (mapping table + type library of target)
Details - (single threaded mode) Outbound COM Gateway CIP-C GW R/3Application Servers Some COM Object Com4Abap (D)COM Generic stub Metadata (mapping table + type library of target)
COM for ABAP Service • Requirements: • R/3 • Pre-4.6d systems require transport of function group • Can be transported to 3.x systems • Connector server • W2K SP1 • NT4, SP5, MTS, MDAC 2.5
What’s next? • .Net Extensions to the Connector • Soap enabled Web Services • Managed Classes • Transparent upgrade to R3 6.2.0 • VS 7 Integration
The SAP .Net Connector • Allows to easily build .NET Applications to integrate with mySAP Solutions using Visual Studio.NET • Supports all Releases of R/3 and mySAP.comAccess the SAP Web Application Server from any .NET Application via SOAPAccess all SAP components via SAP RFC • Availability to be announced soon
SAP .NET Connector Architecture Visual Studio.NET mySAP Technology Microsoft .NET BOR DDIC Interface repository Component Generator Design time VB C++ C# … Common Language Runtime Web Services .NET Connector Runtime Application RFC RFC Layer Run time SOAP SOAP Layer .NET Connector Component (generated) SAP .NET Connector
The SAP Add-In for Visual Studio.NET • Build .NET Applications for mySAP using Visual Studio.NET • .NET Web Services • ASP.NET Web Applications • WinForms Applications • SAP AddIn Visual Studio seamlessly integrates with Visual Studio.NET • Interactively add SAP BAPIs into any .NET application from within the IDE
The End Questions ?