Can You Export Data From Sharepoint to Sap

  • Updated engagement Jul xv, 2015
  • 16.1k
  • 0

In this article you will learn how to integrate SharePoint using .NET.

Contents

  • Introduction
  • Pre-requisites
  • Process
    • Web.config 2
    • User_Control.cs two
      • Fetch Data from SAP two
      • Submit the data to SAP 3
  • Exceptions Expected and solution to information technology 4

Introduction

There tin exist a scenario where we need to fetch data from SAP and submit the updates to SAP using the functions given by the SAP squad from the SharePoint screen.

To enable the preceding we will exist writing .Net code using NCo3015_Net40_x64 MSI.

Pre-requisites

  1. Ensure the following ports are opened from the entore SharePoint front end and app servers to the SAP Server:

    3200, 3201, 3300, 3301, 3600, 3601

  2. SQL port 1433 to be opened between SharePoint front finish and app servers to SQL Server.
  3. Download SAP NCO 3.0 bundle (NCo3015_Net40_x64 MSI) and install it on all servers (Development, UAT, Production [Front Cease, App, Distributed Enshroud and and so on (if any) servers]). One time installed, the following folder would be created and four DLL files are copied to that

    C:\Program Files (x86)\SAP\SAP_DotNetConnector3_Net40_x64

Procedure

  1. Open Visual Studio 2012.
  2. Create an Empty SharePoint Project.
  3. Add a User Control then phone call the user command in the Visual Web Part.
  4. Copy the four DLL files from C:\Program Files (x86)\SAP\SAP_DotNetConnector3_Net40_x64 to the awarding's bin folder (C:\inetpub\wwwroot\wss\Virtualdirectories\<Port Number>\bin).
  5. Add a reference of sapnco.dll and sapnco_utils.dll to the project from the bin folder.
  6. Write lawmaking in the User Command. The following lawmaking volition just connect to SAP and fetch/submit the data. No Business logic is covered here.
  7. Deploy / Public the WSP file on the App server (or respective server) and web application.

Web config

Add the following entry in the appsettings of the web.config file location at the application bin folder (C:\inetpub\wwwroot\wss\Virtualdirectories\<Port Number>\web.config).

Note: For product, these entries are required on all Front end Stop server'due south web.config file.

  1. <add key= "SAPIP"  value= "20.Xxx.20.XX"  />
  2. <add key="SAPUSERID"  value= "XXXX"  />
  3. <add fundamental="SAPPWD"  value= "XXXX"  />
  4. <add key="SYSTEMNO"  value= "XX"  />

User_control.cs

Fetch information from SAP

  1. RfcConfigParameters rfc =new  RfcConfigParameters();
  2. rfc.Add(RfcConfigParameters.Proper noun,"mySapName" );
  3. rfc.Add(RfcConfigParameters.AppServerHost, ConfigurationManager.AppSettings["SAPIP" ].ToString());
  4. rfc.Add(RfcConfigParameters.Customer,"700" );
  5. rfc.Add together(RfcConfigParameters.User, ConfigurationManager.AppSettings["SAPUSERID" ].ToString());
  6. rfc.Add(RfcConfigParameters.Countersign, ConfigurationManager.AppSettings["SAPPWD" ].ToString());
  7. rfc.Add(RfcConfigParameters.SystemNumber, ConfigurationManager.AppSettings["SYSTEMNO" ].ToString());
  8. rfc.Add(RfcConfigParameters.Language,"EN" );
  9. rfc.Add(RfcConfigParameters.PoolSize,"5" );
  10. rfc.Add(RfcConfigParameters.PeakConnectionsLimit,"10" );
  11. rfc.Add(RfcConfigParameters.ConnectionIdleTimeout,"500" );
  12. RfcDestination rfcDest = RfcDestinationManager.GetDestination(rfc);
  13. RfcRepository rfcRep = rfcDest.Repository;
  14. IRfcFunction function = rfcRep.CreateFunction("<<SAP Function Name>>" );
  15. IRfcTable UserInfo = function.GetTable("<<SAP Table to Read>>" );
  16. function.SetValue("Field1" , txtTextBox.ValidationDate);
  17. function.SetValue("Field2" , Page.Request.QueryString[ "xxx" ].ToString());
  18. function.SetValue("Field3" , txtTextBox3.Text.ToString());
  19. function.Invoke(rfcDest);

Submit the data to SAP

  1. RfcConfigParameters rfc = new  RfcConfigParameters();
  2. rfc.Add(RfcConfigParameters.Proper name,"mySapName" );
  3. rfc.Add(RfcConfigParameters.AppServerHost, ConfigurationManager.AppSettings["SAPIP" ].ToString());
  4. rfc.Add together(RfcConfigParameters.Client,"700" );
  5. rfc.Add(RfcConfigParameters.User, ConfigurationManager.AppSettings["SAPUSERID" ].ToString());
  6. rfc.Add together(RfcConfigParameters.Countersign, ConfigurationManager.AppSettings["SAPPWD" ].ToString());
  7. rfc.Add(RfcConfigParameters.SystemNumber, ConfigurationManager.AppSettings["SYSTEMNO" ].ToString());
  8. rfc.Add together(RfcConfigParameters.Linguistic communication,"EN" );
  9. rfc.Add(RfcConfigParameters.PoolSize,"5" );
  10. rfc.Add(RfcConfigParameters.PeakConnectionsLimit,"ten" );
  11. rfc.Add(RfcConfigParameters.ConnectionIdleTimeout,"500" );
  12. RfcDestination rfcDest = RfcDestinationManager.GetDestination(rfc);
  13. RfcRepository rfcRep = rfcDest.Repository;
  14. IRfcFunction function = rfcRep.CreateFunction("<<SAP submit Role Name>>" );
  15. IRfcTable tabular array = function.GetTable("<<SAP Tabular array to update>>" );
  16. DataTable dtmodified = (DataTable)Session["xxxxx" ];
  17. foreach  (DataRow row in  dtmodified.Rows)
  18. {
  19.    table.Append();
  20.    table.SetValue("field1" , "Value1");
  21.    table.SetValue("field2" , "Value2");
  22.    table.SetValue("field_n" , "Value_n");
  23. }
  24. function.Invoke(rfcDest);

Exceptions expected and solution to it

  1. Could not load a file or associates sapnco.dll / sapnco_utils.dll.

    Solution

    Ensure to re-create the four DLLs from C:\Program Files (x86)\SAP\SAP_DotNetConnector3_Net40_x64 to the application bin folder (C:\inetpub\wwwroot\wss\Virtualdirectories\<Port Number>\bin).

  2. SharePoint 2013 layouts pages breaking with "Exception 'Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode:SubStatus:The asking timed out".

    SolutionRun the following Power Beat script to increase the response time.

    First run the following commands to see the health of the distributed cache that includes the status.

    1. $SPFarm = Get-SPFarm
    2. $cacheClusterName ="SPDistributedCacheCluster_"  + $SPFarm.Id.ToString()
    3. $cacheClusterManager = [Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheClusterInfoManager]::Local
    4. $cacheClusterInfo = $cacheClusterManager.GetSPDistributedCacheClusterInfo($cacheClusterName)
    5. $cacheClusterInfo
    To resolve the issue, suggested to run following Power Crush commands that increase the distributed cache time out values to 10 seconds.
    1. $settings = Get-SPDistributedCacheClientSetting -ContainerType DistributedLogonTokenCache
    2. $settings.ChannelOpenTimeOut =10000
    3. $settings.RequestTimeout=10000
    4. Set-SPDistributedCacheClientSetting -ContainerType DistributedLogonTokenCache -DistributedCacheClientSettings $settings
    5. $settingsverify = Get-SPDistributedCacheClientSetting -ContainerType DistributedLogonTokenCache
    6. $settingsverify
    7. $settingsa = Become-SPDistributedCacheClientSetting -ContainerType DistributedViewStateCache
    8. $settingsa.ChannelOpenTimeOut = 10000
    9. $settingsa.RequestTimeout=10000
    10. Set-SPDistributedCacheClientSetting -ContainerType DistributedViewStateCache -DistributedCacheClientSettings $settingsa
    11. $settingsaverify = Get-SPDistributedCacheClientSetting -ContainerType DistributedViewStateCache
    12. $settingsaverify
    13. $set = Get-SPDistributedCacheClientSetting -ContainerType DistributedViewStateCache
    14. $set.MaxBufferSize = 33554432
    15. Set-SPDistributedCacheClientSetting -ContainerType DistributedViewStateCache -DistributedCacheClientSettings $set up
    16. Get-SPDistributedCacheClientSetting -ContainerType DistributedViewStateCache
    17. $set = Get-SPDistributedCacheClientSetting -ContainerType DistributedLogonTokenCache
    18. $set.MaxBufferSize = 33554432
    19. Set-SPDistributedCacheClientSetting -ContainerType DistributedLogonTokenCache -DistributedCacheClientSettings $set
    20. Go-SPDistributedCacheClientSetting -ContainerType DistributedLogonTokenCache
  3. SAP.Middleware.Connector.RfsCommunicationException: Location CPIC (TCP/IP) on the local host with Unicode Error Partner "xx.thirty.twenty.30:3301" not reached time. Connexion timeout counter.

    Solution

    Ensure the following ports are opened from the Front end Finish, App Servers to the SAP Server.

    3200, 3201, 3300, 3301, 3600, 3601

meyercoltake78.blogspot.com

Source: https://www.c-sharpcorner.com/UploadFile/krishna21e/sap-sharepoint-integration-using-net/

0 Response to "Can You Export Data From Sharepoint to Sap"

Enregistrer un commentaire

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel