extending mysap.com with com+ and.net peter russo program manager enterprise program management...
Post on 19-Dec-2015
218 views
TRANSCRIPT
Extending mySAP.com with COM+ and .NET
Peter 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
Mechanics - Object InstantiationClients MTS
R/3Application
ServerDCOM
BAPI BAPI ABAP ObjectsABAP Objects
RFC
BO ITab
Type Mapping
ISAPConnector
RFC-C-API
RFC-COM-API
Librfc32.DLL
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)
DCOM
Mechanics - RFC Pooling
RFC ResourceDispenser
Void connection
R/3 RFC connection automatically provided by DCOM Connector from pool of connections when required by method invocation.
Mechanics Table Handling via RDS & ADO
DCOM
BAPI BAPI ABAP ObjectsABAP Objects
BORFC
itab
SAP-IRowset
RDS-IRowset
ADO-Recordset
Output Tables
Dim myRS as RecordsetSet Foo = New Bar1Foo.GetCustList(‘*’, myRS)
R/3Application
Server
Configuration & Tuning Connector Global parameters
Set in the Admin Console via 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
Librfc32.dllRfcGuiSink
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
Review of RFC Quality of Service Problem with RFC when errors occur:
Where did the error take place? Should the failed call be repeated?
client server client server client server
Can retry Check data+ customizing
and retry
Don't retry
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:
Insert TID,+ CallExecution
Review of RFC Quality of Service: tRFCclient server
Get TID
Store TIDand DATA
RfcIndirectCallEx
Delete TIDand DATA
Delete TIDRfcConfirmTransID
RfcCreateTransID
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
RFC
R/3Application
Server
(D)COM
Outbound COM
Gateway
Some COM
Object
SAP DCOM Connector Server Middleware : Details
RFC
R/3Application
Server(D)COM
Outbound COM Gateway
Some COM
Object
Metadata
(mapping table + type library of target)
NT-Service
Generic stub
Details - (single threaded mode)
R/3Application
Servers(D)COM
Outbound COM Gateway
Some COM Object
Metadata
(mapping table + type library of target)
Com4Abap
Generic stub
CIP-C GW
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 Connector1. Allows to easily build .NET Applications to
integrate with mySAP Solutions using Visual Studio.NET
2. Supports all Releases of R/3 and mySAP.comAccess the SAP Web Application Server from any .NET Application via SOAP Access all SAP components via SAP RFC
3. Availability to be announced soon
Common LanguageRuntime
SAP .NET Connector Architecture
.NETConnectorRuntime
WebServices
VB C++ C# …
Visual Studio.NET
Microsoft .NET
ComponentGenerator
SAP .NET
Connector
mySAP Technology
BOR
DDIC
Interface repository
RFC
SOAP
RFC Layer
SOAP Layer
Application
Design
time
Run
time.NET Connector
Component (generated)
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 SAP Add-In for Visual Studio.NET
The End
Questions ?