extending mysap.com with com+ and.net peter russo program manager enterprise program management...

37
Extending mySAP.com with COM+ and .NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

Post on 19-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

Extending mySAP.com with COM+ and .NET

Peter RussoProgram ManagerEnterprise Program ManagementMicrosoft Corporation

Page 2: 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 Troubleshooting 4.6d Features

tRFC, qRFC, Outbound Calls Futures

Page 3: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

Protocols Native

GUI (Diag) RFC HTTP (In 6.2.0)

Batch (File Transfer) Batch Input Direct Input

ALE (File Transfer or RFC)

Page 4: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 5: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 6: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 7: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 8: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

Connector Architecture

Components and Release Level Technologies

Page 9: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 10: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 11: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 12: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 13: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 14: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 15: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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)

Page 16: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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.

Page 17: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 18: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 19: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

Troubleshooting

RFC trace (set per destination) Trace = 1

RFCxxxxxx.trc Dev_rfc.trc

TableDump = 1 ST05

SAPGUI debugging Check MTS Security & Roles

Page 20: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

Troubleshooting Debugging into R/3

AdviseRFCGuiSink()

Client

Sapgui

Librfc32.dllRfcGuiSink

Page 21: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 22: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 23: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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:

Page 24: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

Insert TID,+ CallExecution

Review of RFC Quality of Service: tRFCclient server

Get TID

Store TIDand DATA

RfcIndirectCallEx

Delete TIDand DATA

Delete TIDRfcConfirmTransID

RfcCreateTransID

Page 25: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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....)

Page 26: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 27: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 28: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

COM for ABAP Service

RFC

R/3Application

Server

(D)COM

Outbound COM

Gateway

Some COM

Object

Page 29: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 30: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 31: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 32: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

What’s next?

.Net Extensions to the Connector Soap enabled Web Services Managed Classes Transparent upgrade to R3 6.2.0 VS 7 Integration

Page 33: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 34: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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)

Page 35: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

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

Page 36: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

The SAP Add-In for Visual Studio.NET

Page 37: Extending mySAP.com with COM+ and.NET Peter Russo Program Manager Enterprise Program Management Microsoft Corporation

The End

Questions ?