Realtime Anbindung an SAP ERP 14.07.2014, 15:00 NovaTec Consulting GmbH Leinfelden-Echterdingen, München, Frankfurt am Main, Berlin, Jeddah / Saudi-Arabien
Showcase - Push SAP Terminauftrag NovaTec 09.09.2015 3
Motivation..by the end of Q2 2014, Microsoft and SAP will support SAP Business Suite software, SAP Business All-In-One solutions, SAP Mobile Platform, SAP Adaptive Server Enterprise (SAP ASE) and the developer edition of the SAP HANA platform on Azure....users need to know right away what is happening in their environment with instant full control of their clients. Web Services, WCF, Web API: none of them was specifically designed for asynchronous environments with real-time collaboration.. NovaTec 09.09.2015 4
Herausforderungen Herausforderungen SAP - Stack vs. Microsoft-Stack Push Technologie Lösung SOAP / Odata SignalR NovaTec 09.09.2015 5
Herausforderungen Pull (http, Ajax, SOAP) Push (SignalR, WebSockets) NovaTec 09.09.2015 6
SAP Geschäftsprozess Kundenauftrag NovaTec 09.09.2015 7
SAP Geschäftsprozess Kundenauftrag Transaktion VA01 Tabellen VBAK und VBAP Transaktion SE11 Transaktion SE16N NovaTec 09.09.2015 8
Demo https://dwxsap.com NovaTec 09.09.2015 9
Showcase - Push SAP Terminauftrag NovaTec 09.09.2015 10
SAP User Exits Abb. Transaktion CMOD NovaTec 09.09.2015 11
SAP User Exits VBAK: Verkaufsbeleg Kopfdaten VBUK: Kopfstatus und Verwaltungsdaten NovaTec 09.09.2015 12
SAP User Exits Abb. SAP-ABAP Include NovaTec 09.09.2015 13
SAP ABAP HTTP GET Funktionsbaustein Abb. SAP-ABAP Funktionsbaustein NovaTec 09.09.2015 14
SAP - SOAP call aus.net NovaTec 09.09.2015 15
HTTP Anbindung der ABAP Funktionsbausteine SOAP URL mit WSDL erzeugt C# Proxy Klassen: NovaTec 09.09.2015 16
SOAP Klassen NovaTec 09.09.2015 17
SOAP Request für Detail Daten NovaTec 09.09.2015 18
OData & SAP Netweaver Gateway NovaTec 09.09.2015 19
OData & SAP Netweaver Gateway NovaTec 09.09.2015 20
SAP Netweaver Gateway Service Builder Abb. Import Daten Modell mit Transaktion SEGW NovaTec 09.09.2015 21
SAP Netweaver Gateway Client Abb. Transaktion /IWFND/GW_CLIENT NovaTec 09.09.2015 22
SAP Class Builder NovaTec 09.09.2015 23
Showcase - Push SAP Terminauftrag NovaTec 09.09.2015 24
HTTP Abb. HTTP Kommunikation NovaTec 09.09.2015 25
AJAX Abb. AJAX NovaTec 09.09.2015 26
Polling Abb. Polling NovaTec 09.09.2015 27
Push Technologie: WebSockets Abb. WebSockets NovaTec 09.09.2015 28
Push Technologie: WebSockets und JavaScript http://caniuse.com/websockets NovaTec 09.09.2015 29
Push Technologie: Server-Sent Events Abb. Server-Sent Events NovaTec 09.09.2015 30
Push Technologie: Long polling Abb. Long polling NovaTec 09.09.2015 31
Push Technologie: Herausforderungen Verschiedene Protokolle (WebSockets, Server-Sent Events..) Verwaltung connected users Verwaltung subscriptions Receiving and processing actions Monitoring submissions Verschiedene clients NovaTec 09.09.2015 32
SignalR 2.0 Basically, SignalR isolates us from low-level details, giving us the impression of working on a permanently open persistent connection between the client and the server.. Abb. SignalR stack NovaTec 09.09.2015 33
SignalR 2.0 Abb. SignalR stack NovaTec 09.09.2015 34
Showcase - Push SAP Terminauftrag NovaTec 09.09.2015 35
.net SAP Kommunikation mit MVC Server public class SapController: Controller { // Action Method Notify called from SAP via HTTP public ActionResult Notify(string VBELN) { ParameterizedThreadStart pts = new ParameterizedThreadStart(WorkThreadFunction); Thread thread = new Thread(pts); thread.start(vbeln); return Content(DateTime.Now.ToString()); } public void WorkThreadFunction(object VBELN) { // Pull Details from SAP via SOAP Z_DWX_GET_DETAILService sap = new Z_DWX_GET_DETAILService(); sap.credentials = SapConfig.SAPLogin; sap.url += "?sap-client=900&sap-language=de"; KNA1 sapresultkna1 = null; VBAK sapresultvbak = null; VBAP[] sapresultvbap = new VBAP[] { }; } sapresultkna1 = sap.z_dwx_get_detail(vbeln, ref sapresultvbap, out sapresultvbak); NovaTec 09.09.2015 36
.net SignalR Push mit MVC Server public class SapController: Controller { public void WorkThreadFunction(object VBELN) {.. // Push Data from MVC-Controller to Clients via SignalR Order order = new Order { SAP_VBAK = sapresultvbak, SAP_VBAP = sapresultvbap, SAP_KNA1 = sapresultkna1 }; string orderdetailsjson = new JavaScriptSerializer().Serialize(order); var context = GlobalHost.ConnectionManager.GetHubContext<SapHub>(); context.clients.all.pushneworder(order.vbeln, orderdetailsjson); } } NovaTec 09.09.2015 37
Showcase - Push SAP Terminauftrag NovaTec 09.09.2015 38
.net SignalR client Install-Package Microsoft.AspNet.SignalR.Client public partial class Form1 : Form { private void Form1_Load(object sender, EventArgs e) { HubConnection hub = new HubConnection("https://dwxsap.com//"); ; IHubProxy proxy = hub.createhubproxy("saphub"); Action<string> del = (string s) => listbox1.items.add(s); hub.error += (Exception ex) => { listbox1.invoke(del, ex.message); }; proxy.on<string, string>("pushneworder", (text, orderdetailsjson) => { Order order = new JavaScriptSerializer().Deserialize<Order>(orderDetailsJson); } } listbox1.invoke(del, text); listbox1.invoke(del, order.vbeln); listbox1.invoke(del, order.audat); }); hub.start(); NovaTec 09.09.2015 39
.net SignalR Kommunikation NovaTec 09.09.2015 40
.net SignalR Kommunikation NovaTec 09.09.2015 41
.net-client - HubConnection NovaTec 09.09.2015 42
.net Client HubProxy NovaTec 09.09.2015 43
KendoUI Mobile Pure JavaScript and HTML5 GUI Framework Mobile Support and Responsiveness Rich Views and Models With MVVM jquery-based customizable themes, templates http://telerik.com NovaTec 09.09.2015 44
Literatur ABAP-Programmierung für den Vertrieb mit SAP Kundeneigene Erweiterungen Hunger, Klein Galileo Press ISBN: 978-1-59229-318-6 NovaTec 09.09.2015 45
Literatur SAP Interface Programming Wegelin, Englbrecht Galileo Press ISBN: 978-1-59229-318-6 NovaTec 09.09.2015 46
Literatur Signal R Programming in Microsoft ASP.NET Jose M. Aguilar Microsoft Press ISBN: 978-0-7356-8388-4 NovaTec 09.09.2015 47
Literatur OData and SAP Netweaver Gateway Bönnen et al. Galileo Press ISBN: 978-1-59229-907-2 NovaTec 09.09.2015 48
Push Technologies: SignalR 2.0 http://www.github.com/signalr/ http://signalr.net/ http://www.asp.net/signalr/ NovaTec 09.09.2015 49
Fazit SAP und Microsoft wachsen zusammen.net Programmierer werden auf SAP Systeme zugreifen NovaTec 09.09.2015 50
Fragen? NovaTec Consulting GmbH NovaTec Zentrale Dieselstr. 18/1 D-70771 Leinfelden-Echterdingen Telefon: +49 711 22040-700 Fax: +49 711 22040-899 E-Mail: info@novatec-gmbh.de Internet: www.novatec-gmbh.de Niederlassungen Berlin Potsdamer Platz 11 D-10785 Berlin München Landshuter Allee 8-10 D-80637 München Frankfurt Friedrich-Ebert-Anlage 36 D-60325 Frankfurt am Main Naher Osten P.O. Box 140611 Jeddah 21333, Saudi-Arabien