Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

BizTalk Server 2010 : Installation of WCF SAP Adapter (part 4) - IDOC Deep Dive, Building a BizTalk application — Sending IDOC

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
6/30/2013 5:19:59 PM

6. IDOC Deep Dive

It is now time to take a closer look into the structure of IDOCs to better understand some of the segments that a BizTalk Developer must understand.

In each IDOC schema, you can expect the following elements:

  • EDI_DC40

  • SAP table(s), that is, E2CONF5

  • guid

The EDI_DC40 node is also referred to as the Header node, or record. Within this node we will discover several fields that we need to populate including:

Element Name Purpose
IDOCTYP The basic structure of the IDOC.
CIMTYP The structure of the custom extension. If an SAP basic structure is extended, a name must be given for the extension.
MESTYP A logical representation of the message. The name should provide a business contextual meaning.
SNDPOR Sending System Port
SNDPRN Sending System/Partner
SNDPRT Sender Partner Type
RCVPRT Receiver Partner Type
RCVPRN Receiving System/Partner
IDOCTYP The basic structure of the IDOC

Depending upon the IDOC there may be one or more SAP tables that are represented within the IDOC. In the case of the CONF32 IDOC, there is only one called E2CONF5. Within this segment, or node, there are a number of fields that we need to populate.&;

Element Name Purpose
LDATE Logical date/actual date of the confirmation. In our situation we are just going to provide the current date.
BUDAT Posting date of the confirmation. In our situation we are just going to provide the current date.
LTIME Logical time/actual time of the confirmation. In our situation we are just going to provide the current time.
ERTIME Entry time of the confirmation. In our situation, we are just going to provide the current time.
ARBPL Work center
AUFNR This field is where the Order Number for the job is submitted.
VORNR Order Numbers, usually have an Operation associated with them so we can leverage this field to provide the Operation Number.
ISMNW The duration of the work that was performed.

Finally, a GUID element exists that associates itself with the SAP transaction ID (TID). We can provide our own GUID, or let the adapter provide a GUID.&;

7. Building a BizTalk application — Sending IDOC

The application that we are going to build will receive Vehicle Timesheets from our Work Order Management system, transform the data and construct a CONF32 Confirmation IDOC. You may be asking yourself "Vehicles have Timesheets"? Yes they do! This scenario is an example of a real world solution where we have employees in the Energy sector out working on the maintenance of energy infrastructure. Much like we would expect to track the time that an employee spends on a job, we also want to track the time of equipment that has been used. A Vehicle makes up a significant portion of the overall costs on the job and therefore we want to ensure these costs are recorded in SAP. The, out-of-the-box, CONF32 IDOC allows us to send this information to SAP without customization.

  1. The first task that we are going to take on is generating the CONF32 IDOC. To simplify this process, we can leverage the steps discussed in the How to Generate IDOC schemas section in this chapter. The end result is that we should have the following schemas:

  2. The next area that we need to focus on is generating a schema that represents the XML that the Work Order Management system will be sending. A simple schema called VehicleTime.xsd exists in this chapter's source code.

  3. We now need to construct a map called VehicleTime_to_CONF32.btm. Within this map, we will have two tabs. The first tab that we are going to build is the Control Record tab. Within this tab, we need to provide SAP with metadata about the IDOC that we are about to send. SAP will use this information to determine how it should process the IDOC. SAP will also use the Partner information provided to determine if the BizTalk user that is submitting the IDOC has the appropriate permissions to do so.

  4. The following table contains the values that have been provided to each node. This information is generally static, but it is a good idea to store this information in a common Helper class so that if you have to make a change you can do so in one place. For the purpose of this chapter, we will simply embed this information with String Concatenate functoids. Do note that some values like SNDPOR, SNDPRN, and RCVPRN will most likely be different on your SAP system.

    Node Value
    /EDI_DC40/TABNAM EDI_DC40
    /EDI_DC40/IDOCTYP CONF32
    /EDI_DC40/CIMTYP CONF32
    /EDI_DC40/MESTYP CONF32
    /EDI_DC40/SNDPOR MTSIDOC
    /EDI_DC40/SNDPRT LS
    /EDI_DC40/SNDPRN MTSIDOC
    /EDI_DC40/RCVPRT LS
    /EDI_DC40/RCVPRN MTSIDOC
    /E2CONF5/SATZA I20
    /E2CONF5/ISMNE H

  5. The next tab that we want to create is the Data tab. Within this tab, we will focus on the data that is being passed from the Work Order Management system and perform any formatting required for SAP.

    Note: A new feature of the BizTalk 2010 mapper is the ability to display only nodes that are currently mapped. To enable this feature, click on the Switch to relevance tree view for destination schema button. When selected, the BizTalk mapper will only display nodes that are currently being mapped. This feature is very helpful when mapping SAP IDOCs that have many nodes.


  6. With the BizTalk Map complete we can focus on the BizTalk Orchestration that will be responsible for orchestrating the events between the Work Order Management System and SAP. The Orchestration will be responsible for the following functions:

    1. Receiving the Work Order Management request that includes the Vehicle Time.

    2. Transforming this request into the SAP CONF32 IDOC request.

    3. Receiving the SAP CONF32 IDOC Response.

    4. Writing the SAP CONF32 IDOC Response to disk so that we can verify whether the exchange with SAP was successful.

  7. Since we are not using a Flat File schema and will opt to use the SOAP messaging capability of the SAP adapter, we can now deploy our application by right mouse clicking on the solution and selecting Deploy Solution.

  8. Once inside the BizTalk Administration Console, we will discover that an application called Chapter04-SAPIDOCs now exists.

  9. Within this application, we can find a Receive Port called ReceiveVehicleTimeSheet and a Receive Location called ReceiveVehicleTimeSheetFromDisk. This Receive Location will use the FILE adapter, the BizTalkServerApplication Receive handler and the XMLReceive Receive Pipeline.

  10. We will have two Send Ports with the first one being the Send Port that will be used to communicate with SAP. The Consume Adapter Wizard generated a binding file that we could use to generate a Send Port automatically. The issue with this approach is that the binding file will use the WCF Custom adapter, which does not allow us to manipulate the SAP connection details easily. Since we often create our SAP IDOC schemas in non-Production environments, it is not likely that we will be able to take full advantage of the generated Binding file anyways as our targets will be different within each BizTalk environment.

  11. The name of the SAP Send port is SendCONF32IDOC. It will use the WCF-SAP custom adapter, the BizTalkServerApplication Send Handler, the XMLTransmit Send pipeline, and the XMLReceive pipeline. By clicking the Configure button, we can further explore the properties that are exposed by the SAP Adapter.

  12. The General tab will expose our Endpoint Address and SOAP Action header. To further explore the Address URI we can click on the Configure button.

  13. The configure button on the General tab is one of the key differentiators between using the WCF-Custom adapter, with SAP Binding, and the WCF-SAP adapter. As you can see in the following image the WCF-SAP Adapter provides us more options when configuring our SAP configuration. The key properties that we want to populate are:

    1. Application Server Host

    2. System Number

    3. Client

  14. If you are unsure of the values for your organization, please contact your BASIS administrator.

  15. The next tab that we need to be concerned with is the Credentials tab. On this tab we will provide the BizTalk credentials that will be used to communicate with SAP. We do have the ability to specify a Username/Password combination or an SSO Affiliate application. For the purposes of this chapter, we will simply provide a Username/Password.

  16. The next Send Port that we need to create is the Send Port that will write the SAP IDOC response to disk. The name of this Send Port is SendIDOCResponseToDisk, and it will use the FILE Adapter, a Send Handler of BizTalkServerApplication, a Send Pipeline of PassThruTransmit.

  17. We now need to configure our Orchestration to use the Receive Port and Send Ports that we just created.

  18. We can now start our application so that it is ready for Application Testing.

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
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server