none
How to get data into database from sap? RRS feed

  • Question

  • Hi,

    Some modules are created in SAP. Using sapBinding, genarating unique schema files, if I get the autogenerated schema files into my visual studio project, I would be able to understand the structure of the schema. The same columns are created in my database(similar to the autogenerated schemas). But, how exactly will I get the data from sap?

    Will I have to have a receive location as SAP folder where in the SAP guys put xml file of data in?Please reply asap

    Thanks

    Nidhin

    Wednesday, October 5, 2016 11:20 AM

Answers

All replies

  • Hi Nidhin,

    Performing an operation on an SAP system using BizTalk Server involves procedural tasks described in Building Blocks for Developing BizTalk Applications. To receive an RFC call from the SAP system, these tasks are:

      • Configure your SAP system to send RFC to an external application, in this case the SAP adapter.
      • Create a BizTalk project and generate schema for the RFC that the SAP adapter will be receiving from the SAP system.
      • Create messages in the BizTalk project for receiving messages from the SAP system and sending responses.
      • Create an orchestration to receive an RFC from the SAP system, process it, and send the response to the SAP system.
      • Build and deploy the BizTalk project.
      • Configure the BizTalk application by creating physical send and receive ports.

    Refer: Receiving Inbound RFC Calls by Using BizTalk Server

    You need to Perform the following steps mentioned in the article below to configure a WCF-SAP receive port for receiving messages from SAP system using the BizTalk Server Administration console.

    Refer: Deploying Adapters for Receiving Messages from SAP System

    Receiving an IDOC involves the SAP adapter to act as an RFC server to receive a special RFC call from SAP. The SAP adapter can receive IDOCs acting as an RFC server or a tRFC server. For more information about receiving an IDOC with the adapter behaving as a tRFC server, see Receiving IDOCs from SAP in a Transactional Context by Using BizTalk Server.

    The SAP adapter surfaces two different operations to receive IDOCs:

    • Receive operation enables adapter to receive IDOCs having a strongly-typed schema. 
    • ReceiveIdoc operation enables adapter to receive IDOCs having a weakly-typed schema. This operation receives IDOCs as a string in an XML message under the <idocData> tag.

    Refer: Receiving IDOCs from SAP by Using BizTalk Server


    Rachit Sikroria (Microsoft Azure MVP)

    Wednesday, October 5, 2016 11:36 AM
    Moderator
  • Hi Nidhin

    SAP can either trigger an IDoc to BizTalk or invoke a RFC call hosted by BizTalk server. Both are native approaches in SAP, and is a better fit than xml drop. Note that you can still have the xml file drop, but the IDoc/RFC approach is recommended.

    For the IDoc option refer-

    https://msdn.microsoft.com/en-us/library/cc185169(v=bts.10).aspx

    For the RFC option refer-

    http://kentweare.blogspot.sg/2012/03/sap-calling-rfc-hosted-in-biztalk.html

    https://msdn.microsoft.com/en-us/library/cc185318(v=bts.10).aspx


    Thanks Arindam


    Wednesday, October 5, 2016 11:51 AM
    Moderator
  • Hi Nidhin,

    You are right you need to set up a receive POrt to receive data from the SAP system.

    You first need to installl and set up the SAP adapter in your Biztalk environment for this...you can refer to Sandros guide posted below. Make sure that you fololow the instructions in it as is.

    BizTalk Server 2013 R2: WCF-SAP Adapter Step-by-Step Installation Guide

    Once you do that then you can create a wcf-sap receive location using the sapbinding to recieve data from SAP.

    Refer below links for the concept so that you can implement them (I think You are using IDOC ..as per your other SAP related questions)

    Receiving IDOCs from SAP by Using BizTalk Server

    Configuring a Port Using the WCF-SAP Adapter

    Regards,


    Mandar Dharmadhikari

    Wednesday, October 5, 2016 11:56 AM
  • Hi,

    Is there an other way of getting data from SAP apart from they manually putting the xml file containing data into the sap folder and I using that folder into my Biztalk as a receive location?

    They would just push some data, but how will I know if I am receiving it actually?

    Thanks,

    Nidhin

    Thursday, October 6, 2016 10:36 AM
  • You can have instrumentation to know if you are receiveing data or not. You can use the BAM feature to log the starting of the process at the SAP recive port and then track important data in the SAP message that way you will know if you are receiving data.

    You can have logging in you Biztalk app to track the data.

    Regards,


    Mandar Dharmadhikari

    Thursday, October 6, 2016 10:42 AM
  • Hi Nidhin

    Apart from file based approach, you also have IDoc and RFC options, which are preferable.

    Now regarding understanding if they are actually sending the data -

    You can enable tracking on the ReceivePort in BizTalk. You can then check the "Tracked Service Instances" in Admin Console.

    If errors are happening in the receive process, you can either check "Suspended Instances" or the Windows event logs for errors.

    You may want to understand how to use the BizTalk Admin Console to check for execution in BizTalk-

    https://msdn.microsoft.com/en-in/library/aa560120.aspx


    Thanks Arindam

    Thursday, October 6, 2016 10:52 AM
    Moderator
  • Hi,

    I used sapBinding of Consume Adapter Service in Visual Studio and got the SAP inbound schema's into my Visual Studio.

    Creating a table with the same columns as that of the sap schemas in sql database, I have created a simple stored procedure that would insert the data that I get from SAP into my SQL database.

    Using sqlBinding, I got this procedure generated into my Visual Studio. Then, after creating Orchestration that would take input form the SAP schema and send it into my generated procedure, I successfully deployed it.

    In the admin Console, I have used pipelines as XMLTransmit and has provided the required details.

    But, I am not able to get the SAP data into my SQL database. I have used BAM to track the data, but even the deployed table in BAMPrimaryImport database is not updated,even after the SAP IDOC data is pushed.

    Is this something form the SAP side or in BizTalk? How to debug this?

    Thanks and Regards,

    Nidhin Nambiar

    Monday, October 24, 2016 7:29 AM
  • Hi Nidhin,

    If the data is coming into Biztalk ptroperly then issue is with Biztalk else with SAP.

    Do you see any warnings , errors in the event logs??/ Also I suggest yopu import the binding file generated from the add generated items wizard to create the sendport which will insert the data in the Biztalk.

    How have you used the BAM?? Via Tracking Profile Editor or BAM APis?

    Regards


    Mandar Dharmadhikari

    Monday, October 24, 2016 8:17 AM
  • Hi Nidhin

    Does your SAP Receive Location show in Enabled state in Admin Console?

    Are documents being triggered from SAP side?

    Also, check for errors/events in Application event logs.

    The first thing you have to track is if you can get the data from SAP to BizTalk - BizTalk Admin Console and the event viewer will help you debug this part, as noted earlier-

    You can enable tracking on the ReceivePort in BizTalk. You can then check the "Tracked Service Instances" in Admin Console.

    If errors are happening in the receive process, you can either check "Suspended Instances" or the Windows event logs for errors.

    You may want to understand how to use the BizTalk Admin Console to check for execution in BizTalk-

    https://msdn.microsoft.com/en-in/library/aa560120.aspx


    Thanks Arindam

    Monday, October 24, 2016 8:18 AM
    Moderator