dot net 串接 sap

16

Click here to load reader

Upload: learningtech

Post on 15-May-2015

501 views

Category:

Technology


7 download

TRANSCRIPT

Page 1: Dot Net 串接 SAP

.NET 如何串接 SAP2014/3/3 Howard

Page 2: Dot Net 串接 SAP

WHAT IS SAP ? SAP

是歐洲最大的軟體企業,世界上最大的商業應用、企業資源規劃( ERP )解決方案和獨立軟體的供應商,在全球企業應用軟體的市場佔有率高達三成以上

總部設於德國沃爾多夫。 德文: Systeme, Anwendungen und Produkte in der Datenverarbeitung 英文: systems applications and Products in Data Processing

通常 SAP 指的是 SAP 提供的 ERP 系統 ( SAP R/3 )

Page 3: Dot Net 串接 SAP

WHAT IS SAP R/3 ? 是一個基於客戶 / 服務機結構和開放系統的、集成的企業資源計劃系統 ( ERP ) 。

其功能覆蓋企業的財務、後勤(工程設計、採購、庫存、生產銷售和質量等)和人力資源管理、SAP 業務工作流系統以及因特網應用鏈接功能等各個方面。

SAP R/3 is architecture of : database functional module client graphical user interface (GUI)

respective hardware components

Page 4: Dot Net 串接 SAP

.NET FRAMEWORK ? SAP

Page 5: Dot Net 串接 SAP

SAP RFC RFC ( Remote Function Call ,遠程功能調用)

是 SAP 系統之間以及 SAP 與外部系統之間程序通信的基本接口技術,諸多其他更高層的 SAP接口和通信技術,如 BAPI 、 ALE 等,都是基於 RFC 實現的。

SAP 所提供的外部接口包括: 程序通信接口( communication interface )、 文件 I/O 接口( file I/O interface ) 數據接口( data interface )。

RFC 位於程序通信接口中,以實現外部程序對 SAP 系統內部數據的訪問

Page 6: Dot Net 串接 SAP

.NET FRAMEWORK ? RFC SAP

Page 7: Dot Net 串接 SAP

SAP .NET CONNECTOR 3.0 SAP .NET Connector 3.0 is the current version of SAP's development

environment for communication between the Microsoft .NET platform and SAP systems.

This connector supports RFCs and Web services. It allows you to write different applications such as Web form, Windows form, or console applications in the Microsoft Visual Studio.Net.

With the SAP .NET Connector, you can use all common programming languages, such as Visual Basic. NET, C#, or Managed C++.

Page 8: Dot Net 串接 SAP

SAP .NET CONNECTOR 3.0 Using the SAP .NET Connector you can:

Write .NET Windows and Web form applications that have access to SAP business objects (BAPIs).

Develop client applications for the SAP Server.

Write RFC server applications that run in a .NET environment and can be installed starting from the SAP system.

Page 9: Dot Net 串接 SAP

.NET FRAMEWORK NCO 3.0 RFC SAP

Page 10: Dot Net 串接 SAP

HOW TO USE SAP NCO 3 CONNECTOR Install SAPDotNetConnector3 nuget package

The SAP .Net Connector is a set of libraries that handle connections and abstractions between .Net Framework code and SAP BAPIs and RFCs.

Add reference : System.Web

Prepare Connection Settings Name AppServerHost SystemNumber Client User Password Language

Page 11: Dot Net 串接 SAP

HOW TO USE SAP NCO 3 CONNECTOR

public class RfcConfigParameters : Dictionary<string, string>

RfcConfigParameters configParams = new RfcConfigParameters(); configParams.Add(RfcConfigParameters.Name, opt.GetOptionArg("AppServerHost")); configParams.Add(RfcConfigParameters.AppServerHost, opt.GetOptionArg("AppServerHost")); configParams.Add(RfcConfigParameters.SystemNumber, opt.GetOptionArg("SystemNumber")); configParams.Add(RfcConfigParameters.Client, opt.GetOptionArg("Client")); configParams.Add(RfcConfigParameters.User, opt.GetOptionArg("User")); configParams.Add(RfcConfigParameters.Password, opt.GetOptionArg("Password")); configParams.Add(RfcConfigParameters.Language, opt.GetOptionArg("Language"));

Create RfcConfigParameters

Page 12: Dot Net 串接 SAP

HOW TO USE SAP NCO 3 CONNECTOR Create RfcDestination

Get RfcRepository

Invoke RFC

Get RFC Table

RfcDestination rfcdest = RfcDestinationManager.GetDestination(configParams);

RfcRepository rfcRepo = rfcdest.Repository;

IRfcFunction personoutoaFun = null; personoutoaFun = rfcRepo.CreateFunction("ZOA_CALLSAP_RFC_NAME");personoutoaFun.Invoke(rfcdest);

IRfcTable personTable = personoutoaFun.GetTable(“OUTPUT_TABLE_NAME");

Page 13: Dot Net 串接 SAP

HOW TO USE SAP NCO 3 CONNECTOR Convert RFC Table To Data Table

Page 14: Dot Net 串接 SAP

NSAPCONNECTOR

Wrapper library for the SAP .Net Connector 3.0.

Adapts existing api to a more friendly form for the .Net developers. 

NSAPConnector tries to emulate an ADO.Net behavior and usage which is the most common way of dealing with database data in the .Net world.

NuGet NSAPConnector_x86 NSAPConnector_x64

Page 15: Dot Net 串接 SAP

BIZTALK 串接 有 input, output 資料夾 填寫 Request XML 參數,放到 input 資料夾中, 稍等幾分鐘, output 資料夾會產生 Response XML ,即查詢結果