Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
Windows Server

BizTalk Server 2010 : Installation of WCF SAP Adapter (part 3) - IDOC schema generation

6/30/2013 5:17:58 PM

5. IDOC schema generation

With the installation and configuration of the SAP Adapter out of the way, we are now going to focus on IDOCs. We will be exploring the following features of IDOCs:

  • What are IDOCs

  • How to Generate IDOC schemas and understanding important properties

What are IDOCs?

IDOC stands for Intermediate Document and is a SAP specification that is used for exchanging information within SAP systems and with external systems such as BizTalk. SAP resources think of IDOCs much like BizTalk resources think about XSD schemas. The difference being that IDOC structures resemble flat files whereas XSD schemas are based upon XML.

SAP has a consistent structure that includes a Header segment that contains metadata associated with the IDOC. The Header is consistent across all IDOC types but the body of the IDOCs will be different based upon the function that the IDOC supports. SAP has specific IDOC structures for different system functions. An HR Timesheet IDOC is going to look very different from a Purchase Order. Each IDOC will have segments that are specific to the IDOC. We can think of segments much like we think of XML Nodes. If you ask an SAP resource if the IDOC has repeating nodes, they may not understand your question. But, if you ask if an IDOC has repeating segments, they will instantly understand.

How to generate IDOC schemas

Now that we have some basic knowledge of IDOCs, let's go ahead and generate an IDOC to gain a better understanding. Much like we previously generated Schemas for SQL Server, we will be leveraging the Consume Adapter Service. We can launch this wizard by right mouse clicking on our BizTalk project and selecting Add — Add Generated Items...Consume Adapter Service.

  1. We are now in familiar territory having used this wizard . This time around we want to select the sapBinding from the Select a binding dropdown.

  2. We now need to configure a URI and can do so by clicking the Configure button. The first area that we need to address is the Security tab. Within this tab, we have a few different options when it comes to Client credential type:

    • None

    • Windows

    • Username

    • Certificate&;

    I am going to go out on a limb and suggest that we will never run into a situation where we don't have to provide credentials so we will not be using None. The SAP system that is being used for this walkthrough does not reside on the Windows platform so that is not an option. If your SAP system supports Windows Authentication then using this type of authentication is worth considering. There are no specific requirements around proving our identity so Certificate is not required. This leaves us with providing a standard Username and Password. Generally, these credentials are assigned by a SAP Security Administrator and sometimes a BASIS Administrator. These are the same type of credentials that users provide when accessing SAP through the SAP GUI except with additional privileges.

  3. The next tab that we want to focus on is the URI Properties. The base properties that we need to populate include:

    • Application Server Host

    • System Number&;

    • Client

    The Application Server Host is the name of the physical SAP Application server, or more likely a virtual DNS alias. This value will most likely be unique across the various SAP landscapes, that is, DEVELOPMENT/TEST/PRODUCTION.

    The System Number is a unique numerical identifier for a particular instance of SAP. Client, in this context, is used to separate data within an SAP system. For instance if you have subsidiaries sharing an SAP system, but want to have segregated data, then you could create multiple clients that will allow you to distinguish one company's data from another. If you are familiar with Dynamics CRM, Client would be the equivalent of an Organization. This number will most likely be the same across the various SAP landscapes but you may have multiple values in co-hosting situations. These are all values that you will most likely get from a BASIS Administrator.

  4. The final tab that we need to be concerned with is the Binding Properties tab. Within this tab, we will specify some attributes related to how BizTalk will interact with SAP. It is important to note that many of these settings can be changed within the BizTalk Administration console when you are ready to configure your application. Within the next screenshot, we will concentrate on two particular properties:&;

    • ReceiveTimeout — Probably one of the most important production properties to set. This property specifies the duration that BizTalk will wait for an inbound message before shutting down. The default value is 10 minutes which is hardly enough time. If we don't modify this setting, we may have some undesirable results in a Production environment when BizTalk stops listening for IDOCs once this threshold has been exceeded. The maximum value is 24.20:31:23.6470000 (24 days). To learn more about this property, please see the following blogpost: http://kentweare.blogspot.com/2010/03/biztalk-adapter-pack-sap-binding.html

    • EnableBizTalkCompatibilityMode — Specifies whether the BizTalk Layered Channel Binding Element should be loaded which will allow BizTalk transactions to flow to SAP. This value should always be set to true when using the WCF-SAP Adapter in BizTalk.

  5. There are some additional properties within the Binding Properties tab that are of interest to us:&;

    • EnableSafeTyping — Not all SAP data types have .NET data type equivalents. By enabling safe typing, BizTalk will have "looser" requirements about types when trying to bind an SAP data type to a .NET data type. It is important to understand how this property may change the behavior of your app. If you are expecting a Date from SAP, it is quite possible that the data will be converted to a string when this property is set to True. Speaking from personal experience, I have not had to set this property to true when integrating with IDOCs but have had to change the property when calling RFCs and BAPIs.

    • GenerateFlatFileCompatibleIDOC — This property specifies whether the <appinfo> node should include segment types, or segment definitions, for parsing flat file IDOCs. By setting the property to True, it does not mean that you have to use Flat Files in order to process the IDOCs. It is a good idea to leave this value set to true as it provides you flexibility in the future to use Flat File if so desired.

    • ReceiveIDOCFormat — Previously with the SAP Adapters that were based upon the .NET Connector, you had to process the IDOC as a Flat File. This is no longer the case with the WCF version of the Adapter. We now have the opportunity to send and receive messages as XML without the use of Flat File Schemas and Pipelines. If we specify Typed then we will receive the message as an XML message. We also have the ability to specify String or RFC. If we want to use a Flat File Schema/Pipeline then we need to specify String. If we want to receive the IDOC as a WCF message with RFC parameters then we want to specify RFC. Do note that these properties can be modified when we configure our receive location inside of the BizTalk Administration console.&;

  6. Now that we have our configuration set, click the OK button to return to the main wizard.

  7. As long as we have configured the Wizard properly, we can now click the Connect button to establish a connection to SAP.

  8. The next question that we need to ask ourselves is whether this is an Inbound or Outbound operation. It is important to remember the context in which this question is being asked. The question is being asked from a BizTalk perspective. Will this IDOC be an Outbound Operation from BizTalk or an Inbound Operation to BizTalk? Since we are sending an IDOC to SAP then we will want to specify a Client (Outbound operations).

  9. If we wanted to receive an IDOC from SAP, we will want to specify Service (Inbound operations):

  10. The next area to focus on is the Search in category function. In order for this function to work we need to specify the Select a category as we cannot search SAP's entire BAPI, IDOC, RFC, and TRFC catalogue. For the purpose of this demonstration, we will select IDOC.

  11. Within this text box, we can provide wild card searches and then click on the green arrow to execute the search. In this case, we can provide the term CONF, which will search for Confirmation IDOCs.

  12. We will see our results populated in the Available categories and operations: list. The particular IDOC that we are interested in is the CONF32 IDOC. Once we have this IDOC selected, we can click Add and then the IDOC will be added to the Added categories and operations: list box.

  13. With the old, .NET Connector-based adapter one IDOC equaled one BizTalk XSD schema. This is no longer the case. The Consume Adapter Service Wizard will generate multiple schemas for each IDOC. The reason for this is the Wizard will create schemas for specific SAP types that then get imported into a Master, or Parent, Schema. If you have many IDOCs within your solution this can get very confusing unless you provide a Filename Prefix. If we provide a prefix, like CONF32, all schemas will start with this prefix, which will allow us to organize and differentiate our schemas.&;

  14. Once we have provided this prefix, we can click the OK button and our IDOC schema will get generated.

  15. While this method is convenient, it comes with some baggage. When you click the OK button, it will download every version of the IDOC from your SAP system. This may leave you with way more schemas than you are interested in and may also result in timeouts from the Consume Adapter Server Wizard as there is just too much data to retrieve.

  16. Another option that we have is to browse the IDOC catalogue and find the exact version of the IDOC that we are interested in. As you can see by the following image, there are many different versions of the IDOC within our SAP systems. Select the version of the IDOC that you are interested in, click the Add button. Had we used the steps previously mentioned by downloading all versions, our BizTalk Solution would have become extremely bloated. By browsing to the exact version that we are interested in, we will only download that version and any supporting schemas that contain the complex types.&;&;

  17. We now have an opportunity to provide a Filename Prefix. If we do not provide a Prefix, the wizard will provide a very generic filename that will not differentiate it from other SAP schemas. We should use a descriptive prefix so that we can easily differentiate this schema from other schemas that we will have in our solution. We can click the OK button to have the schemas added to our BizTalk solution.

  18. We will now find that six artifacts have been added to our solution. The main schema that we are interested in is CONF32IDOCOperation.CONF32.700.3.Send.xsd. The remaining schemas are there to support sending the IDOC and we also have a binding file that contains the values that we used to configure the Consume Adapter Service Wizard.&;

  19. The Consume Adapter Service Wizard allows us to generate a single IDOC schema or multiple IDOCs at the same time. When dealing with multiple schemas, we need to be careful that the IDOCs do not share underlying common types that could lead to compilation errors. In order to avoid these compile time errors, we can check the Generate unique schema types check box. By doing so we will increase the number of schemas that are added to our solution. The additional schemas will include unique namespaces, which allows us to avoid the compile time errors.&;

Note: New for BizTalk 2010 is the ability for the SAP URI to be saved between launches of the Consume Adapter Service Wizard. Previously, we would have had to populate the entire URI configuration each time we wanted to generate Schemas. This is a significant timesaver and extremely convenient feature that has been added. Please be aware that if you are using Username as the client credential type that you will still need to provide the password each time you run the wizard.

Other -----------------
- Exchange Server 2007 : Leveraging the Capabilities of the Outlook Web Access Client - Getting to Know the Look and Feel of OWA 2007
- Exchange Server 2007 : Leveraging the Capabilities of the Outlook Web Access Client - Logging On to OWA 2007
- Exchange Server 2007 : Leveraging the Capabilities of the Outlook Web Access Client - What’s New in OWA 2007?
- SQL Server 2012 : Data Architecture (part 2) - Smart Database Design
- SQL Server 2012 : Data Architecture (part 1) - Information Architecture Principle, Database Objectives
- Microsoft Dynamic AX 2009 : .NET Business Connector - Usage Scenarios for .NET Business Connector
- Microsoft Dynamic AX 2009 : .NET Business Connector - Inside .NET Business Connector
- Microsoft Dynamic AX 2009 : .NET Business Connector - Introduction
- Windows Server 2012 : Installing and Managing Hyper-V in Full or Server Core Mode - Installing Windows Server 2012 and Microsoft Hyper-V Server 2012
- Windows Server 2012 : Installing and Managing Hyper-V in Full or Server Core Mode - Enabling the Hyper-V role
- First look: Apple Watch

- 10 Amazing Tools You Should Be Using with Dropbox

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
Top 10
- Microsoft Excel : How to Use the VLookUp Function
- Fix and Tweak Graphics and Video (part 3) : How to Fix : My Screen Is Sluggish - Adjust Hardware Acceleration
- Fix and Tweak Graphics and Video (part 2) : How to Fix : Text on My Screen Is Too Small
- Fix and Tweak Graphics and Video (part 1) : How to Fix : Adjust the Resolution
- Windows Phone 8 Apps : Camera (part 4) - Adjusting Video Settings, Using the Video Light
- Windows Phone 8 Apps : Camera (part 3) - Using the Front Camera, Activating Video Mode
- Windows Phone 8 Apps : Camera (part 2) - Controlling the Camera’s Flash, Changing the Camera’s Behavior with Lenses
- Windows Phone 8 Apps : Camera (part 1) - Adjusting Photo Settings
- MDT's Client Wizard : Package Properties
- MDT's Client Wizard : Driver Properties
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro