Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Salesforce and sap integration


Published on

This is topic is presented by Sridhar Barla (Technical Lead at GE) in Chennai salesforce platform developer meetup

Published in: Technology
  • Follow the link, new dating source: ❶❶❶ ❶❶❶
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ❶❶❶ ❶❶❶
    Are you sure you want to  Yes  No
    Your message goes here
  • Hello Karanraj, thanks for sharing your knowledge about this topic with us. I am facing the same challenge at the moment. I have already created the consumer proxy to the corresponding WSDL. I have also implemented the LOGIN-Method successfully. Unfortunately I am facing problems regarding the SEARCH-Method. Therefore I wanted to check your coding within the slideshare-presentation. However, I cannot find any coding on page 24/25 - it is empty. Could you please post some coding for calling SEARCH-Method successfully? Thank you very much in advance. Best regards, Maurice
    Are you sure you want to  Yes  No
    Your message goes here

Salesforce and sap integration

  1. 1. Sales force IntegrationSridhar Barla
  2. 2. Agenda
  3. 3. Agenda  Platform APIs : Breif History – SOAP – Bulk – REST – Also : calouts & APEX WS  Intégration use case for SOAP API – Intégration Sales force Data with SAP – Intégration sales force data with Primavera
  4. 4. SOAP APIintegration
  5. 5.  Create a middle ware web service in .Net 2003/2005/2008/2010 Add Sales force WSDL (Enterprise /Partner ) file as web reference in middle ware web service Create a Web method As Get_Quote() Implement logic to read data from quote object
  6. 6. Read data from SFDC
  7. 7.  SforceService sobj = new SforceService(); System.Net.NetworkCredential cr = new System.Net.NetworkCredential(“sridhar", "taralika", “chennai"); System.Net.WebProxy proxy = new System.Net.WebProxy("http-proxy-", 80); proxy.Credentials = cr; sobj.Proxy = proxy; LoginResult lr = sobj.login(“", “testpasswordplusRFwWSPB4PPjWdjpDO3VC2yts"); sobjj.Url = lr.serverUrl; sobj.SessionHeaderValue = new SessionHeader(); sobj.SessionHeaderValue.sessionId = lr.sessionId; QueryResult quoteDetails = null; sobj.QueryOptionsValue = new QueryOptions(); sobj.QueryOptionsValue.batchSize = 1000; sobj.QueryOptionsValue.batchSizeSpecified = true;
  9. 9.  bool bContinue = true; while (bContinue) { if (quoteDetails .records != null) { if (quoteDetails .records.Length > 0) { quoteListObj.Add(quoteDetails ); //handle the loop + 1 problem by checking the most recent queryResult if (quoteDetails .done) bContinue = false; else quoteDetails = sobj .queryMore(accDetails.queryLocator); } } else { bContinue = false; } }
  10. 10. Access Middle ware in SAP
  11. 11.  Make sure, that the proxy configuration is ok. In SAP other wise you won’t have a chance to connect to an external web service. To check proxy settings use SM59 transaction code
  12. 12. Create Consumer Proxy in SAP  At first you have to generate a consumer proxy. A proxy class will be generated  Generation can be triggered out of SE80:
  13. 13.  In the following dialogue you have to input the WSDL, in order that the proxy settings can be retrieved automatically
  14. 14.  The following screenshot display the consumer proxy. For our example, the default settings are o.k.
  15. 15. Next step is to create a logical port  The logical port is necessary to call the external web service. You create the logical port with transaction SOAMANAGER.  Within SOAMANAGER you have to go for the Single Service Administration:
  16. 16.  Within SOAMANAGER you have to select the respective web service
  17. 17.  After applying the selection, you just push the button for creation of logical port and use the default setting. Be sure to input the correct URL for the WSDL into the creation dialogue and write down the logical port name. This will be used in your ABAP coding. Also make sure, that the proxy settings are entered
  18. 18. ABAP Coding  The following sample coding consumes the external web service. It uses the created consumer proxy and the logical port to request the quote for the symbol SAP. After successful calling, the structure out keeps the actual values for the SAP stock.
  19. 19. SAP integration Integrate Sales force and SAP with using middle ware technology as .NET SAP .NET connector – SAP connector 2.0 – SAP connector 3.0 Sales force WSDL (Enterprise /Partner )
  20. 20. SAP connector versions and .NET versions  SAP connector 2.0 supports Visual studio .NET 2003 only and this connector supports XP not windows 7  SAP connector 3.0 supports all Visual studio versions.
  21. 21. SAP connector 2.0  Download SAP connector from and install  Open visual studio 2003 and createa class Library project as SAPProxyLib
  22. 22.  After you add the proxy, you will notice that the system automatically adds the necessary references to your project as well as creates a WSDL file called SAPProxy1.wsdl. This file will show up as a blank screen in Visual Studio, as shown in figure below:
  23. 23.  Once the proxy has been added, its time to add the SAP Server to your project. Click View, then click Server Explorer and you will see that an option for SAP is included in the list. Click the SAP entry and it will expand and show "Application Servers". Right click this and select "Add Application Server". A dialog box similar to Figure below will appear
  24. 24.  This is where you will need to set your parameters for establishing a connection to your SAP server. Change the Destination Type property to “Custom”, then add the necessary values for the following properties: – User Name – Password – AppServerHost – SAPRouterString – HTTP Port – Client – System Number These variables will depend on your SAP installation. Check with your SAP Administrator for the specific settings in your environment.
  25. 25.  Once you have the properties set, you can then establish your connection to SAP. Expand the new server, then expand the Functions entry. This will provide a list of all ABAP functions that are contained in your SAP environment. See figure below:
  26. 26.  The next step is to locate the function that you wish to call. When you find it, simply drag and drop it onto theSAPProxy1.sapwsdl file. It will automatically create several objects and even code files that relate to your particular function (note that you need to be viewing all files in your project to see the code files that the process creates):
  27. 27.  Right click the solution and Build the project Then system generate dll like SAPProxyLib.dllThis class library you can use any .NET version application
  28. 28.  Create new website in VS2010 Add web reference Sales force WSDL (Enterprise /Partner ) Add reference SAPProxyLib.dll
  29. 29. Read data from SAP
  30. 30.  SAPProxyLib.SAPProxy1 BAPI = new SAPProxyLib .SAPProxy1(); DataSet salesOrder = new DataSet(); string conStr = "ASHOST=xx.xx.xx.xx SYSNR=0 CLIENT=10 USER=IM_SREE PASSWD=sappass LANG=EN"; BAPI = new SAPProxyLib .SAPProxy1(conStr); System.Net.NetworkCredential cr = new System.Net.NetworkCredential(“1236456", “password", “chennai"); System.Net.WebProxy proxy = new System.Net.WebProxy(“proxyservername", 80); proxy.Credentials = cr; BAPI.Proxy = proxy; BAPI.Connection.Open(); SAPProxy1.BAPIRET2 ret = new SAPProxy1.BAPIRET2(); SAPProxy1.ZPROJOUT proj = new SAPProxy1.ZPROJOUT(); SAPProxy1.ZPROJOUTTable prjOut = new SAPProxy1 ZPROJOUTTable(); BAPI.Zbapi_Proj_Sales_Details(startdate, ref prjOut);// if (prjOut.Count > 0) { salesOrder.Tables.Add(prjOut.ToADODataTable()); if (salesOrder.Tables[0].Rows.Count > 0) { foreach (DataRow salesDetails in salesOrder.Tables[0].Rows) { }
  31. 31. Read Data from SAP with using SAP connector 3.0
  32. 32. using SAP.Middleware.Connector;