Title: BizTalk Adapter Pack SAP VS2k5 integration
1SAP .NET application(Visual Studio 2005)
Integration
Microsoft CorporationSAP-Microsoft
Competence Center (Tokyo)
2Landscape
Consoleapplication
Table,View
Web application
BAPIRFC
SAP R/3 SAP ERP
XML WebServices
3BizTalk Adapter Pack (SAP) setup procedure
- Console application development
- Table select, .NET Data Provider for SAP
- Console application development
- RFC/BAPI execution, WCF LOB Adapter
- ASP .NET Web application development
- Table select, .NET Data Provider for SAP
- ASP .NET Web application development
- RFC/BAPI execution, WCF LOB Adapter
- ASP .NET Web Service development
- Table select, .NET Data Provider for SAP
4Landscape
Consoleapplication
Table,View
Web application
BAPIRFC
SAP R/3 SAP ERP
XML WebServices
51. Console application development
- Visual Studio 2005 New project Visual C -
Console application - Solution Explorer Reference Add reference
add Microsoft.Data.SapClient,
Microsoft.Adapters.SAP, Microsoft.ServiceModel.
Channels - Customize the SAP connection (from
connectionStrings.Add("CLIENT800LANGENUSERSA
PPASSWD06071992ASHOSTMSSAP01SYSNR00"))
for your SAP system - Customize the SAP command (from cmd.CommandText
"select from ENT1027 where SPRAS 'JA'")
for your SAP system - Paste the code and build it
- ( Option for trouble shooting)
- Place the XXXXXX.exe.config file in the same
folder as the executable, XXXXX to be named the
same as the console application - In case the app is ABC.exe, name the config
file name as ABC.exe.config - Execute the console app from command prompt then
XMLTrace.xml file is generated - Each time the console app is executed delete the
XMLTrace.xml
61. Console application development
- using System
- using System.Collections.Generic
- using System.Text
- using Microsoft.Data.SAPClient
- using Microsoft.Adapters.SAP
- using Microsoft.ServiceModel.Channels
- namespace ConsoleApplication2
-
- class Program
-
- public class ExecTest
-
- public static void Main()
-
- try
-
- System.Console.Write("Client"
) - string strClient
Console.ReadLine()
7(Option) 1. Xxxxx.exe.config for the console app
- lt?xml version"1.0" encoding"utf-8" ?gt
- ltconfigurationgt
- ltsystem.diagnosticsgt
- ltsharedListenersgt
- ltadd name"xmlFile" type"System.Diagnostics.Xm
lWriterTraceListener" initializeData"XmlTrace.xml
" /gt - lt/sharedListenersgt
- ltsourcesgt
- ltsource name"Microsoft.ServiceModel.Channels"
switchValue"Verbose"gt - ltlistenersgt
- ltadd name"xmlFile" /gt
- lt/listenersgt
- lt/sourcegt
- ltsource name"Microsoft.Adapters.SAP"
switchValue"Verbose"gt - ltlistenersgt
- ltadd name"xmlFile" /gt
- lt/listenersgt
- lt/sourcegt
- ltsource name"Microsoft.Data.SAPClient"
switchValue"Verbose"gt - ltlistenersgt
8Visual Studio
1-1. Creating a new console application project
9Visual Studio
1-2. Adding references
10Visual Studio
1-3. Coding
Paste the attached code.
11Visual Studio
1-4. Building/deploying the code
12Visual Studio
1-5. Executing the console application
13BizTalk Adapter Pack (SAP) setup procedure
- Console application development
- Table select, .NET Data Provider for SAP
- Console application development
- RFC/BAPI execution, WCF LOB Adapter
- ASP .NET Web application development
- Table select, .NET Data Provider for SAP
- ASP .NET Web application development
- RFC/BAPI execution, WCF LOB Adapter
- ASP .NET Web Service development
- Table select, .NET Data Provider for SAP
14Landscape
Consoleapplication
Table,View
Web application
BAPIRFC
SAP R/3 SAP ERP
XML WebServices
152. Console application development
- using System
- using System.Collections.Generic
- using System.Text
- using System.ServiceModel
- using Microsoft.ServiceModel.Channels
- using Microsoft.Adapters.SAP
- namespace SapRfcClientSM
-
- class Program
-
- static void Main(string args)
-
- try
-
- // Create client from
configuration - using (RfcClient rfcClient new
RfcClient("SAPBinding_Rfc")) -
- rfcClient.ClientCredentials.Us
erName.UserName "SAP"
16Visual Studio
2-1. Creating a new console application project
17Visual Studio
2-2. Adding references
18Visual Studio
2-3. Adding Adapter Service Reference
19Visual Studio
2-3. Adding Adapter Service Reference
20Visual Studio
2-4. Coding
Paste the attached code.
21Visual Studio
2-5. Building/deploying the code
22Visual Studio
2-6. Executing the console application
23BizTalk Adapter Pack (SAP) setup procedure
- Console application development
- Table select, .NET Data Provider for SAP
- Console application development
- RFC/BAPI execution, WCF LOB Adapter
- ASP .NET Web application development
- Table select, .NET Data Provider for SAP
- ASP .NET Web application development
- RFC/BAPI execution, WCF LOB Adapter
- ASP .NET Web Service development
- Table select, .NET Data Provider for SAP
24Landscape
Consoleapplication
Table,View
Web application
BAPIRFC
SAP R/3 SAP ERP
XML WebServices
25Visual Studio
3-1. Creating a new ASP .NET Web application
project
26Visual Studio
3-2. Designing the user interface
27Visual Studio
3-3. Adding references
283. ASP .NET Web application development (1)
- using Microsoft.Data.SAPClient
- using Microsoft.Adapters.SAP
- using Microsoft.ServiceModel.Channels
- using System.Collections.Generic
29Visual Studio
3-5. Coding
Paste the attached code.
303. ASP .NET Web application development (2)
- protected void Button1_Click(object sender,
EventArgs e) -
- Listltstringgt connectionStrings new
Listltstringgt() - connectionStrings.Add("CLIENT800LANG
ENUSERSAPPASSWD06071992ASHOSTMSSAP01SYSNR
00") -
- foreach (string connStr in
connectionStrings) -
- using (SAPConnection conn new
SAPConnection(connStr)) -
- String str
- str TextBox1.Text
- DataTable dt new
DataTable() - dt.Columns.Add(new
DataColumn("Client", typeof(string))) - dt.Columns.Add(new
DataColumn("Language", typeof(string))) - dt.Columns.Add(new
DataColumn("Country", typeof(string))) - dt.Columns.Add(new
DataColumn("No", typeof(string))) - dt.Columns.Add(new
DataColumn("RegionName", typeof(string))) - conn.Open()
- using (SAPCommand cmd
conn.CreateCommand())
31Visual Studio
3-5. Coding
Paste the attached code.
32Visual Studio
3-5. Coding
33Visual Studio
3-6. Debugging the application
34BizTalk Adapter Pack (SAP) setup procedure
- Console application development
- Table select, .NET Data Provider for SAP
- Console application development
- RFC/BAPI execution, WCF LOB Adapter
- ASP .NET Web application development
- Table select, .NET Data Provider for SAP
- ASP .NET Web application development
- RFC/BAPI execution, WCF LOB Adapter
- ASP .NET Web Service development
- Table select, .NET Data Provider for SAP
35Landscape
Consoleapplication
Table,View
Web application
BAPIRFC
SAP R/3 SAP ERP
XML WebServices
36Visual Studio
4-1. Creating a new ASP .NET Web application
project
37Visual Studio
4-2. Designing the user interface
38Visual Studio
4-3. Adding references
39Visual Studio
4-4. Adding Adapter Service Reference
40Visual Studio
4-4. Adding Adapter Service Reference
414. ASP .NET Web application development (1)
- using System.ServiceModel
- using Microsoft.ServiceModel.Channels
- using Microsoft.Adapters.SAP
42Visual Studio
4-5. Coding
Paste the attached code.
434. ASP .NET Web application development (2)
- protected void Button1_Click(object sender,
EventArgs e) -
- String str
- DataTable dt new DataTable()
- DataRow dr
- dr null
- try
-
- // Create client from
configuration - using (RfcClient rfcClient new
RfcClient("SAPBinding_Rfc")) -
- rfcClient.ClientCredentials.Us
erName.UserName "SAP" - rfcClient.ClientCredentials.Us
erName.Password "06071992" - // Open client
- rfcClient.Open()
- microsoft.lobservices.sap._200
7._03.Types.Rfc.BRFCKNA1 customers - new microsoft.lobservices.
sap._2007._03.Types.Rfc.BRFCKNA10 - // Invoke SD_RFC_CUSTOMER_GET
- str TextBox1.Text
44Visual Studio
4-5. Coding
Paste the attached code.
45Visual Studio
4-5. Coding
46Visual Studio
4-6. Debugging the application
47BizTalk Adapter Pack (SAP) setup procedure
- Console application development
- Table select, .NET Data Provider for SAP
- Console application development
- RFC/BAPI execution, WCF LOB Adapter
- ASP .NET Web application development
- Table select, .NET Data Provider for SAP
- ASP .NET Web application development
- RFC/BAPI execution, WCF LOB Adapter
- ASP .NET Web Service development
- Table select, .NET Data Provider for SAP
48Landscape
Consoleapplication
Table,View
Web application
BAPIRFC
SAP R/3 SAP ERP
XML WebServices
49Visual Studio
5-1. Creating a new ASP .NET Web Service project
50Visual Studio
5-2. Adding references
515. ASP .NET Web Service development
- using System
- using System.Data
- using System.Web
- using System.Collections
- using System.Web.Services
- using System.Web.Services.Protocols
- using System.ComponentModel
- using Microsoft.Data.SAPClient
- using Microsoft.Adapters.SAP
- using Microsoft.ServiceModel.Channels
- using System.Collections.Generic
- namespace WebService4
-
- WebService(Namespace "http//tempuri.org/")
- WebServiceBinding(ConformsTo
WsiProfiles.BasicProfile1_1) - ToolboxItem(false)
- public class Service1 System.Web.Services.We
bService -
52Visual Studio
5-3. Coding
Paste the attached code.
53Visual Studio
5-3. Coding
Rename the namespace.
54Visual Studio
5-3. Coding
55Visual Studio
5-4. Debugging the application
56(No Transcript)