Your SlideShare is downloading. ×
Salesforce and sap integration
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Salesforce and sap integration

3,175
views

Published on

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

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

Published in: Technology

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,175
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
135
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Sales force IntegrationSridhar Barla
  • 2. Agenda
  • 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. SOAP APIintegration
  • 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. Read data from SFDC
  • 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- sample.com", 80); proxy.Credentials = cr; sobj.Proxy = proxy; LoginResult lr = sobj.login(“dhamodhar@gmail.com.", “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;
  • 8. string sforceQuery = "Select ID,NAME,REC ORDTYPEID, RecordType.N ame,PARENTI D,OWNERID, CREATEDDA TE,CREATED BYID,LASTM ODIFIEDDAT E,LASTMODI FIEDBYID,SA PREF__C, ACCOUNTAC TIVITYSTATU S__C,ACCOU NTCOUNTRY
  • 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. Access Middle ware in SAP
  • 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. 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.  In the following dialogue you have to input the WSDL, in order that the proxy settings can be retrieved automatically
  • 14.  The following screenshot display the consumer proxy. For our example, the default settings are o.k.
  • 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.  Within SOAMANAGER you have to select the respective web service
  • 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. 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. 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. 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. SAP connector 2.0  Download SAP connector from service.sap.com/connectors and install  Open visual studio 2003 and createa class Library project as SAPProxyLib
  • 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.  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.  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.  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.  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.  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.  Create new website in VS2010 Add web reference Sales force WSDL (Enterprise /Partner ) Add reference SAPProxyLib.dll
  • 29. Read data from SAP
  • 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. Read Data from SAP with using SAP connector 3.0
  • 32. using SAP.Middleware.Connector;