Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

26
Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk® Server Regional Sourcing / Manufacturing Facility Provides Products to the Parent Company White Paper This document is based on the integration between a SAP R/3 and a Microsoft Dynamics AX business management system in a demo environment. In particular, it focuses on integration between Microsoft® BizTalk® Server 2009, Microsoft Dynamics AX 2009 and SAP Business Suite. Created by Microsoft Corporation in collaboration with Hitachi Consulting Date: September, 2010 www.microsoft.com/dynamics/ax

Transcript of Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

Page 1: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk® Server Regional Sourcing / Manufacturing Facility Provides Products to the Parent Company

White Paper

This document is based on the integration between a SAP R/3 and a Microsoft Dynamics AX business management system in a demo environment. In particular, it focuses on integration between Microsoft® BizTalk® Server 2009, Microsoft Dynamics AX 2009 and SAP Business Suite. Created by Microsoft Corporation in collaboration with Hitachi Consulting

Date: September, 2010

www.microsoft.com/dynamics/ax

Page 2: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

2

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

1.  INTRODUCTION ................................................................................................ 3 1.1  BUSINESS TRANSACTIONS ....................................................................................................... 3 1.1.1  PURCHASE ORDER FROM SAP TO MICROSOFT DYNAMICS AX ...................................... 4 1.1.2  SHIPPING NOTIFICATION AND DELIVERY FROM MICROSOFT DYNAMICS AX TO SAP 4 1.1.3  INVOICE DOCUMENT FROM MICROSOFT DYNAMICS AX TO SAP ................................... 4 

2.  SYSTEM SETTINGS AND MASTER DATA ...................................................... 4 2.1  SAP CUSTOMIZATIONS .............................................................................................................. 5 2.1.1  CUSTOMIZING THE ORGANIZATIONAL STRUCTURE IN SAP ............................................ 5 2.2  SAP MASTER DATA .................................................................................................................... 6 2.2.1  PARENT COMPANY AS CUSTOMERS TO SALES OFFICE ................................................. 6 2.2.2  SALES OFFICES AS COMPANY CODES IN SAP .................................................................. 7 2.2.3  PRODUCTS USED IN TRANSACTIONS ................................................................................. 7 2.2.4  PRICE LISTS ............................................................................................................................ 7 2.2.5  CHART OF ACCOUNTS ........................................................................................................... 7 2.3  SETTING UP MICROSOFT DYNAMICS AX ................................................................................ 7 2.3.1  POST INSTALLATION SETUP ................................................................................................. 8 2.3.2  CONFIGURING AIF ENDPOINT ID ........................................................................................ 10 2.3.3  MICROSOFT DYNAMICS AX MODIFICATIONS ................................................................... 10 

3.  MASTER DATA UPLOAD TO MICROSOFT DYNAMICS AX ......................... 11 3.1  IDOC SETUP FOR MASTER DATA TRANSFER ...................................................................... 12 

4.  MICROSOFT BIZ TALK SERVER ................................................................... 12 4.1  INTERFACING TO AND FROM SAP ......................................................................................... 13 4.2  INTERFACES .............................................................................................................................. 13 4.2.1  SAP INTERFACE DEFINITIONS ............................................................................................ 13 4.2.2  INTERFACE MAPPINGS ........................................................................................................ 13 4.3  BIZTALK SOLUTION .................................................................................................................. 14 4.3.1  PURCHASE ORDER TO SALES ORDER PROCESS ........................................................... 14 4.3.2  CUSTOMIZING SHIPPING (PRE-DELIVERY NOTIFICATION) ............................................ 18 4.3.3  CUSTOMIZING RECEIPT OF ITEMS .................................................................................... 20 4.3.4  CUSTOMIZING INVOICING ................................................................................................... 21 

5.  SCENARIO DETAILS ...................................................................................... 23 5.1  REGIONAL SOURCING / MANUFACTURING SCENARIO: CENTRAL ORGANIZATION IS USING ITS SUBSIDIARY AS A SUPPLIER OF GOODS .................................................................... 23 5.1.1  SYNCHRONIZATION OF ITEMS AND PRICE LIST .............................................................. 24 5.1.2  PROCESS STEPS .................................................................................................................. 24 

6.  CONCLUSION ................................................................................................. 25 

Page 3: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

3 MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

1. INTRODUCTION Large enterprises consist of multiple small entities such as subsidiaries, branches, locations, departments, and lines of businesses. In often cases, those smaller entities have either different business processes or totally different activities and business models. Most large corporations have implemented a financial solution such as SAP or Oracle (Tier 1 solutions) as their ERP backbone to run most operations. However, some of the local entities are too small to operate with the Tier 1 solutions due to complexity or budget constraints for the cost of implementation. Microsoft Dynamics AX offers a great alternative to those local entities by focusing on delivering flexible industry solutions that are easy to implement, and simple to use for maximum user adoption with minimal training. Microsoft Dynamics ERP two-tier connector allows Microsoft Dynamics AX to be implemented in subsidiaries to lower costs and increase productivity while remain connected to the corporate headquarters financial system. The Microsoft Dynamics ERP Two-Tier Connector for SAP allows Microsoft Dynamics AX to exchange information with SAP Business Suite 6 (SAP) to facilitate collaboration across sites or departments by streamlining business processes going through different systems. This document will describe the Regional Sourcing / Manufacturing scenario for the integration of intercompany procurement and supply-chain processes between local and regional distribution with local fulfillment organizations. In this scenario, the local company will supply its items/products to the other entity running on SAP. The items could be either procured or manufactured by the local subsidiary. The request will be transferred from SAP to AX and supply chain processes will execute. Updates in both environments are completed so users do not have to navigate through multiple user interfaces (UI) to track status of this sourcing and delivery process.

1.1 BUSINESS TRANSACTIONS

The parent company buys products from the local sales office. The parent company is running a corporate legacy system and the local sales office is running Microsoft Dynamics AX. The basic elements of this order-to-stock transaction between local facility and parent are shown in the figure below.

Page 4: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

4

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

In this scenario, the Microsoft Dynamics AX local sales office and SAP parent essentially have a vendor-customer relationship. Information is exchanged, goods are shipped and cash is collected.

1.1.1 PURCHASE ORDER FROM SAP TO MICROSOFT DYNAMICS AX

In this scenario, demand planning is completed at the parent company so internal business rules in the sales office trigger purchase activities. A purchase order containing quantities, prices and a required delivery date is sent from SAP to Microsoft Dynamics AX. An IDOC in SAP is used when a purchase order is created in SAP. BizTalk receives the IDOCs and transforms to a sales order in Microsoft Dynamics AX. A standard Microsoft Dynamics AX sales order is created upon receipt of a purchase order received from SAP. A Microsoft Dynamics AX sales order number is automatically created if the transaction is successful. The sales order captures the SAP purchase order number, which is used as a tracking reference number both by SAP (parent company) and Microsoft Dynamics AX (sales office) throughout the business process. In addition, the sales order number from Microsoft Dynamics AX is captured in the SAP purchase order. The incoming sales order confirmation creates an ‘Order Acknowledgement’ in the SAP purchase order which can be displayed under the ‘Confirmation’ tab of the PO item.

1.1.2 SHIPPING NOTIFICATION AND DELIVERY FROM MICROSOFT DYNAMICS AX TO SAP

When the complete order can be delivered, a delivery is created after which a goods issue is done in Microsoft Dynamics AX. Both transactions are manual. The delivery note created in Microsoft Dynamics AX acts as a pick request for the warehouse to pick the order. The picked quantities are then manually updated in the delivery note. A goods issue in Microsoft Dynamics AX depletes the stock levels in the system and makes a financial posting to reduce the value of the stock. This usually happens when the actual physical goods leave the warehouse to be delivered. A goods issue process results in material and accounting documents being created in Microsoft Dynamics AX. The creation of the delivery note, updating the pick quantities and goods issue can be done directly in the delivery note (one transaction in Microsoft Dynamics AX). When the goods issue is done and the delivery note is saved, the shipping notification message is automatically triggered and sent to SAP. The sale order is sent electronically to the Queue when the Microsoft Dynamics AX packs items to be shipped. This creates a sales order XML data which BizTalk will pick up from the queue. BizTalk will transform this sales order into a shipping notification using a BizTalk

1.1.3 INVOICE DOCUMENT FROM MICROSOFT DYNAMICS AX TO SAP

Since the sales invoice is delivery-based, the outbound delivery and goods issue will first have to be created in Microsoft Dynamics AX before the sales invoice can be created. The sales invoice message consists of the sales price for each item that has been ordered from SAP. The SAP purchase order number is also recorded in the sales invoice. An invoice needs to be created in SAP using the invoices issues from Microsoft Dynamics AX. For this step, a BAPI is called to create an invoice in SAP from an Invoice sent by an external partner.

2. SYSTEM SETTINGS AND MASTER DATA The business transactions described above depend on system settings and master data. The system settings form the organizational and technical structure, and the master data is the basis for content in the business transactions. This section describes the system settings for both SAP and Microsoft Dynamics AX concerning the integration of their processes.

Page 5: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

5 MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

2.1 SAP CUSTOMIZATIONS

In SAP, configuring the system is called “customizing.” This functionality provides all the means to configure the system and make it fit to an organization and its business processes. In other words, the customization does not concern operational data, but rather, the business structure and business process definition. Customizing in SAP is done in the Implementation Management Guide (IMG) and has a tree-like structure. Screenshots of the relevant areas in this structure have been included in the text below.

2.1.1 CUSTOMIZING THE ORGANIZATIONAL STRUCTURE IN SAP

A standard SAP IDES environment has been customized to incorporate the Microsoft Dynamics AX local sales office on an operational and financial level. This paragraph describes the elements that have been customized to create the scenario.

SAP Transaction: SPRO

SAP Implementation guide: Enterprise Structure- Definition

IMG Area Activity Description

Financial Accounting Define company code CUS Create a company code for the parent company.

This is the smallest organizational unit where accounting transactions are registered. There is one single, standard company code for the SAP parent for which a chart of accounts has been defined. All financial transactions which involve the parent company are registered in this company code.

Define company code CEU The Microsoft Dynamics AX local sales offices are represented as separate company codes in the SAP system. The reason for this setup is that it facilitates the financial consolidation of the sales offices.

Logistics- General Define plant CUS Create a site which represents the operating area of the parent company

Define division 00 A division is an organizational part of the sales area through which products are sold to customers.

Sales & Distribution Define Sales Organization CUS All sales are registered on this organizational level.

Define Distribution Channel 12 Part of sales area.

Materials Management Define Storage Location 0001 Physical location where stock is kept.

Logistics Execution Define Shipping Point CUS Point from which deliveries leave the plant.

SAP Transaction: SPRO

SAP Implementation guide: Enterprise Structure- Assignment

IMG Area Activity Description

Financial Accounting Assign company code CUS to credit control area 1000

Credit control area 1000 is the standard IDES control area for Europe.

Page 6: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

6

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

Controlling Assign company code CUS to

controlling area 1000

Activate cost accounting functionality for the company code. Controlling area 1000 is the standard IDES controlling area for Europe. To make postings to cost elements possible (for example, to distribute the costs to a cost center, or to make an internal order), you must assign a company code to a controlling area. For this demo, we used account 792000, which is also presented as a cost element in controlling (because of the SAP standard setup). Of course, the decision to include a controlling area depends on many factors, which are not really relevant for this demo.

Logistics- General Assign plant CUS to company code CUS

A plant belongs to one company code

Sales & Distribution Assign sales organization CUS to company code CUS

Link financial accounting (company code level) to the sales activities.

Assign distribution channel 12 to sales organization CUS

Distribution channels and divisions are linked to sales organizations. The sales area can then be set up using combinations of sales organizations, distribution channels and divisions. For the scenario, a single sales area is used, as there is just one sales channel for intra-company sales.

Assign division 00 to sales organization CUS Set up sales area CUS/12/00

Assign sales organization – distribution channel – plant

Define the plant that will provide goods for the sales area.

Logistics Execution Assign shipping point CUS to plant CUS

A shipping point is part of a plant.

SAP Transaction FS00

Change reconciliation account for vendor

Reconciliation accounts for a vendor or customer are setup in SAP for automatic posting only. Therefore, you cannot post directly to these accounts. Account 165000 needed to be changed to make manual posting possible for this demo. Therefore, we connected 165000 to a general ledger account group without the check for automatic posting. NOTE: This is a necessary setting, without which posting is not possible.

2.2 SAP MASTER DATA

Besides the customizing described above, the SAP environment needs master data to process the business transactions. The following paragraphs describe the master data needed to set up business process integration.

2.2.1 PARENT COMPANY AS CUSTOMERS TO SALES OFFICE

Vendor master record CEU

Page 7: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

7 MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

In an ‘all-SAP’ solution where both parent and sales offices operate within a SAP landscape, the sales offices would be separate plants and/or sales organizations depending on whether they carried inventory or not. This setting would make it possible to register the individual sales activities of every sales office. However, the intercompany procurement and supply chain process scenario demands another approach where end-customer sales are registered at the parent company as monthly net figures provided by the sales office. The replenishment of stock at a sales office takes place in a vendor-customer relationship. This vendor master is referenced when creating the purchase order in SAP. For this scenario, vendor master record CEU has been created using transaction VD01.

2.2.2 SALES OFFICES AS COMPANY CODES IN SAP

Company code CEU

Sales offices are set up as company codes in order to create financial postings for the consolidation at the end of the month. Company code CEU has been created for this purpose in the same way as the company code CUS for the parent company.

2.2.3 PRODUCTS USED IN TRANSACTIONS

The following table displays the material master records that have been set up for selling to the sales office. They are finished products (type FERT) with a standard cost price. Access the material master using transaction MM03.

Material master records 000000000000000001 000000000000000012 000000000000000015 000000000000000016 000000000000000017 000000000000000018 000000000000000019

2.2.4 PRICE LISTS

One price list is an “Inter-company Price List” that provides transfer prices, which are prices that are agreed upon by the parent company and its sales offices as a purchase price. The price lists have been created using the standard SAP price list with no modifications. Only the sales prices (no taxes) are listed. The mechanism for interfacing is using an IDOC.

2.2.5 CHART OF ACCOUNTS

The standard SAP international chart of accounts (INT) is used to do General Ledger accounting in the parent company code CUS and sales office CEU.

Chart of Accounts INT

2.3 SETTING UP MICROSOFT DYNAMICS AX

The organizational structure in a Microsoft Dynamics AX sales office is simple.

Page 8: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

8

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

The next paragraph provides the Microsoft Dynamics AX setup steps for the scenario. The setup is based on the .xpo file bundled with this document.

2.3.1 POST INSTALLATION SETUP

Setup Microsoft BizTalk Management In Microsoft Dynamics AX, go to Basic>Setup> Application Integration

Framework>Global settings to open the Integration Framework global settings form Select Ignore ‘Record Version’ for updates field

By default, the Application Integration Framework (AIF) is validating the record version value in the incoming XML file with the current value in the respective record in the Microsoft Dynamics AX table. An error message regarding the differences in values will not appear since the Ignore ‘Record Version’ for updates field has been selected. For the purpose of this demo scenario, a parameter was created to bypass this default for updates.

Microsoft Dynamics AX AIF Global Settings. A trigger can be set for all or some of the Corporate ERP field in the Sales Order form. In addition, the trigger can be turned off if needed. In Microsoft Dynamics AX, go to Accounts Receivable>Setup>Parameters>AIF tab. Select the Sales Order – Trigger action by AIF field. The Corporate ERP field has the following values:

None Cancelled PurchaseOrderConfirmed

Page 9: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

9 MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

PurchaseOrderSent PurchaseOrderShipped Delivered Invoiced Backorder PickingList PackingSlip ReceivedQtyUpdated PayInvoicedPurchaseOrder Returned

Currently, a trigger is setup for the following Corporate ERP field values:

PurchaseOrderShipped: Do Packslip posting Delivered: Do Invoice posting PickingList: Do PickingList posting PurchaseOrderConfirmed: Do Sales Order confirmation posting

NOTE: The other values can be used as placeholders to attach actions to them. The following is an additional setup step:

o In the Accounts receivable parameters form, select Copy all dollar values from incoming AIF file field to ensure the sales prices, discounts and total line amounts are copied from the incoming AIF file.

Microsoft Dynamics AX – Account Receivable Settings.

Page 10: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

10

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

2.3.2 CONFIGURING AIF ENDPOINT ID

The Endpoint ID field can be set up in the AIF by navigating to Basic>Setup>Application Integration Framework> Endpoints. The endpoint is the external entity that participates in the document exchange. In this scenario, the endpoint is BizTalk and is called RemoteEP.

2.3.3 MICROSOFT DYNAMICS AX MODIFICATIONS

Three fields have been added to the Sales order form. The fields added to the SalesTable table are Corporate ERP, Last External Receipt Id, and Last External Receipt Date.

Corporate ERP field is a non-editable field (enum) and can only be changed by an AIF incoming document. It stores the status of the purchase order relative to the sales order in SAP.

Last External Receipt Id field is a non-editable field and can only be changed by an AIF incoming document. This field stores the ReceiptId of the created Purchase order in SAP. This field is available in the Posting tab of Sales order form.

Last External Receipt Date field is a non-editable field. Microsoft Dynamics AX will set the current date when the Last External Receipt Id is set. This Last External Receipt Date field is available in the Posting tab of Sales order form.

Note: Customer Requisition field is a standard field and can be changed by an AIF incoming document. This field stores the created Purchase Order Id from SAP.

The Send electronically button has been added to the Sales order form to send the Sales order as an XML message to the Gateway queue. The following graphic shows the Sales order form with the Send electronically button in the header:

Page 11: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

11 MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

The following shows the window when the Send electronically button is selected:

3. MASTER DATA UPLOAD TO MICROSOFT DYNAMICS AX For this scenario, the Item Master and its inter-company price only are interfaced with Microsoft Dynamics AX.

Page 12: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

12

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

3.1 IDOC SETUP FOR MASTER DATA TRANSFER

A partner profile should be created in SAP system which introduces a logical system to exchange IDOCs. In this scenario, the logical system is the Microsoft BizTalk server which is the ‘logical’ destination of the outbound IDOCs. The outbound IDOCs can be setup with the following procedures in the URL. http://msdn.microsoft.com/en-us/library/ms942196(BTS.10).aspx There is no business trigger for the distribution of master data; this is done manually using standard SAP transactions. The MATMAS is sent through the following navigation: ALE> Master Data Distribution> Master Data Distribution> Cross-Application> Material.

4. MICROSOFT BIZ TALK SERVER The BizTalk is used in the Microsoft Dynamics ERP Two-Tier Connector scenario as an integration broker between SAP and Microsoft Dynamics AX. The communication between SAP and BizTalk is carried out by IDOCs (SAP standard interfacing documents) and BAPIs (SAP Business Objects). The following displays the communication between SAP, BizTalk, and Microsoft Dynamics AX.

Page 13: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

13 MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

4.1 INTERFACING TO AND FROM SAP

There are two interfacing methods used: IDOC: Outbound IDOCs are documents that can be created by SAP. For example, an IDOC

with all information of the purchase order is sent to another system when a purchase order has been created and saved.

BAPI: BAPIs contain functions that can be executed from outside SAP by using RFC connections.

Choice between BAPI’s and IDOC’s: Due to the complexity of IDOCs, the scenario uses BAPIs for the inbound SAP-interfaces. The structures and tables as input for the BAPIs are less complex than for IDOCs. For the outbound SAP interface, IDOCs are implemented because these are created by SAP and contain far more data than BAPIs can return. If there are high volumes of changes to outbound and inbound messages then IDOCs are preferred due to less administrative processes in BizTalk by leveraging content based routing. For example, IDOCs can be used for Master data such as items, customers, and vendors. BAPIs are preferred for lower volume changes to outbound and inbound messages. The BAPIs provide more control of transaction’s content and operations. For example, a transaction validated in SAP can trigger a required approval which can be sent back to BizTalk.

4.2 INTERFACES

The interfaces for the Microsoft Dynamics ERP Two-Tier Connector model are summarized below:

Interface Source Destination 1. Materials (IDOC MATMAS03) SAP Microsoft Dynamics AX 2. Customers (IDOC DEBMAS03) SAP Microsoft Dynamics AX 3. Purchase Order (IDOC ORDERS04) SAP Microsoft Dynamics AX 4. Sales Order Confirmation Microsoft Dynamics AX SAP 5. Shipment Notification (IDOC DELVRY05) Microsoft Dynamics AX SAP 6. Goods Receipt (IDOC DELVRY01) SAP Microsoft Dynamics AX 7. Invoice (IDOC INVOIC01) Microsoft Dynamics AX SAP

4.2.1 SAP INTERFACE DEFINITIONS

The system integration required for the SAP interfaces are based on SAP BAPIs (Business Application Programming Interface) and IDOCs (Intermediate Documents). A BAPI contains RFCs that are able to perform actions in the SAP system such as creating an order or to upload a financial order. For the BAPIs, there are input/output definitions, which can be imported in BizTalk using the BizTalk SAP Adapter. An IDOC is a standard SAP document that contains business data. There are many standard IDOC message types available such as Material Master, Delivery Document, and Invoice. The IDOCs are intermediate documents defined in SAP. The structure of an IDOC can also be automatically imported in BizTalk using the SAP Adapter. In this scenario, the standard SAP interfacing (IDOCs and BAPIs) is used as much as possible.

4.2.2 INTERFACE MAPPINGS

All data exchange in Microsoft Dynamics AX is completed through XML data generated by AIF. The outbound data is mapped to an SAP request message by BizTalk process (BizTalk Map) and the BAPI response messages. The IDOCs are transformed to inbound XML messages through AIF.

Page 14: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

14

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

4.3 BIZTALK SOLUTION

4.3.1 PURCHASE ORDER TO SALES ORDER PROCESS

In this scenario, a purchase order is created in SAP and should be translated into a sales order in Microsoft Dynamics AX. An IDOC (type ORDERS04) in SAP is used when a purchase order is created in SAP. An RFC Destination of type TCP/IP is configured when a purchase order is saved which directs the Purchase order IDOC to the relevant ALE Port. To make a system RFC compliant, an RFC server program is executed on BizTalk. This Server program has to have a calling interface which is well defined by SAP. An IDOC in SAP is generated as soon as the purchase order is saved and sent through this port. BizTalk receives the IDOCs and transforms to a sales order in Microsoft Dynamics AX. Then, BizTalk calls an AIF Service on Microsoft Dynamics AX and calls the create action on the service. Once a sales order is created, a confirmation number such as the sales order ID is sent back through the same purchase order into SAP. BizTalk sets the sales order ID in the same IDOCs and sends to SAP to update SAP purchase order.

4.3.1.1 SCHEMAS

The following are the schemas utilized.

Schema Name Description

ORDERS04 SAP, Inbound (client)

SalesOrderService_SalesOrder AX

4.3.1.2 CUSTOMIZING MAPS

This section describes the maps. The following maps a SAP purchase order which is sent as an IDOC to Microsoft Dynamics AX. This solution provides a map from SAP ORDERS04 schema to Microsoft Dynamics AX SalesOrderService_SalesOrder. The following table shows the name, segment and elements used from IDOCs and its corresponding Microsoft Dynamics sales order schemas:

Map name: SAPPurchOrder_to_AXSalesOrder.btm

IDOCs Element

Location in IDOC SAP Element Location in sales order

Description

CURCY E2EDK01005 CurrencyCode PurchTable Currency code DELCO E2EDK01005 CustAccount PurchTable Customer

account BELNR E2EDK01005 PurchOrderFormNum PurchTable SAP purchase

Order number NAME1 E2EDKA1003GRP

> E2EDKA1003 DeliveryName PurchTable Recipient name

STRAS E2EDKA1003GRP> E2EDKA1003

DeliveryCity PurchTable City

PSTLZ E2EDKA1003GRP> E2EDKA1003

DeliveryZipCode PurchTable Zip

LAND1 E2EDKA1003GRP> E2EDKA1003

DeliveryCountryRegionId

PurchTable Country code

REGIO E2EDKA1003GRP> E2EDKA1003

DeliveryState PurchTable State/Province

Page 15: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

15 MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

POSEX E2EDP01008GRP> E2EDP01008

LineNum PurchLine Item line number

MENGE E2EDP01008GRP> E2EDP01008

SalesQty PurchLine Quantity

MENEE E2EDP01008GRP> E2EDP01008

SalesUnit PurchLine Unit

BMNG2 E2EDP01008GRP> E2EDP01008

SalesPrice PurchLine Price

IDTNR E2EDP01008GRP> E2EDP19002

ItemId PurchLine Item code

The PO_ReceiveIDOCs_to_SendIDOCs.btm maps almost everything from the Received IDOCs (ORDERS04) to Send IDOCs which has the same schema. The only difference is the destination schema (send IDOCs) that needs to be set to the following elements under EDI_DC40 according to your SAP server environment. This map is used to send a sales order confirmation from Dynamic AX to SAP.

SAP Environment Send Port Configuration: SNDPOR, SNDPRT, SNDPRN SAP Environment Send Port Configuration: RCVPOR, RCVPRT, RCVPRN

4.3.1.3 ORCHESTRATION

This section describes the orchestrations for the purchase order IDOCs (ORDERS04) received into BizTalk. BizTalk saves this IDOC as an XML message in the file system so the CreateSalesOrder.odx orchestration can read and transform to a sales order in Microsoft Dynamics AX. The following displays the orchestration.

Page 16: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

16

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

The following orchestration creates a sales order in Microsoft Dynamics AX using the information extracted from the SAP purchase order IDOCs:

Page 17: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

17 MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

Page 18: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

18

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

4.3.2 CUSTOMIZING SHIPPING (PRE-DELIVERY NOTIFICATION)

A sale order is sent electronically to the Queue when the Microsoft Dynamics AX packs items to be shipped. This creates a sales order XML data which BizTalk will pick up from the queue. BizTalk will transform this sales order into a shipping notification using a BizTalk map for the DELIVERY IDOCs.

4.3.2.1 SCHEMAS

The following displays the schemas.

Schema Name Description

SalesOrderService_SalesOrder Incoming sales order with shipping notification in the AIFSalesStatus

DELVRY05 SAP IDOCs to receive delivery notification to SAP

4.3.2.2 CUSTOMIZING MAPS

The following map is used to map the Microsoft Dynamics AX sales order XML elements to the SAP DELVERY05 IDOCs schema. The following table displays the mapping from Microsoft Dynamics AX sales order XML schema into SAP DELVERY05 IDOCs schema:

Map name: SAPPurchOrder_to_AXSalesOrder.btm

Source: AX Sales order

Location Destination: SAP IDOCs

Location Details

N/A N/A IDOCTYP EDI_DC40 Value of : DELVRY05

MESTYP EDI_DC40 Value of :DESDAV

Send port in SAP SNDPOR EDI_DC40 BASED on SAP Environment

RCVPRT EDI_DC40 Receive Port RCVPRN EDI_DC40 Receive Server SalesId LIFEX E2EDL20003GRP

> E2EDL20003

007 QUALF E2EDL20003GRP> E2EDT13001GRP> E2EDT13001

ShippingDateConfirmed

NTANF

Line number POSNR E2EDL20003GRP> E2EDL24007GRP> E2EDL24007

ItemId SalesLine KDMAT SalesQty SalesLine LFIMG SalesUnit SalesLine VRKME

Page 19: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

19 MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

001 QUALI E2EDL20003GRP> E2EDL24007GRP> E2EDL41000

PurchOrderFormNum

SalesTable BSTNR

LineNum SalesLine POSEX

4.3.2.3 ORCHESTRATIONS

The following orchestration is used to send the DELVRY05 IDOCS into SAP to notify the shipping. This IDOC is created from the incoming Microsoft Dynamics AX sales order using a map described in previous section.

Page 20: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

20

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

4.3.3 CUSTOMIZING RECEIPT OF ITEMS

Once SAP receives the items, it should notify Microsoft Dynamics AX for the receipt of items so the status of sales orders changes in Microsoft Dynamics AX appropriately. This is done using the transaction MIGO which creates the goods receipt for the purchase order and triggering the outbound IDOC to BizTalk. A BizTalk orchestration will receive the Good Receipt IDOCs from SAP and extracts the necessary information using a BizTalk map. Next, it retrieves the sales order from Microsoft Dynamics AX and updates its status.

4.3.3.1 SCHEMAS

The following displays the schemas utilized.

Schema Name Description

SalesOrderService_SalesOrder AX Sales Order DELVRY01 SAP IDOCs

4.3.3.2 CUSTOMIZING MAP

A map is not necessary for this process. A custom C# code in an external assembly is used to extract the purchase order number and the status from the IDOCs.

4.3.3.3 ORCHESTRATION

The orchestration “GoodsReceipt.odx” retrieves the sales order and updates the status field in the Microsoft Dynamics AX sales order.

Page 21: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

21 MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

4.3.4 CUSTOMIZING INVOICING

The last step is sending a Microsoft Dynamics AX invoice to SAP. An invoice needs to be created in SAP using the invoices issues from Microsoft Dynamics AX. For this step, a BAPI is called to create an invoice in SAP from an Invoice sent by an external partner. The standard BAPI is called “BAPI_INCOMINGINVOICE_CREATE” which should be run in transactional mode. However, a custom function module can be leveraged so the transaction is committed internally in SAP rather than from BizTalk with the same input type as the standard BAPI. This provides a much easier implementation in BizTalk and the customization in SAP is not complicated.

Page 22: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

22

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

4.3.4.1 SCHEMAS

The following are the schemas.

Schema Name Description

ZBAPI_INCOMINGINVOICE_CREATE The schema for SAP Custom Function Module TypeLibrary_SalesInvoice.xsd AX standard invoice document schema

4.3.4.2 CUSTOMIZING MAPS

The following map is used for the invoice process.

Location Source Element Location Destination Element

HEADERDATA ns3:INVOICE_IND ns3:DOC_DATE ns3:PSTNG_DATE ns3:COMP_CODE CustInvoiceJour CurrencyCode ns3:CURRENCY CustInvoiceJour InvoiceAmount ns3:GROSS_AMOUNT ns3:CALC_TAX_IND ITEMDATA ns3:INVOICE_DOC_ITEM CustInvoiceJour PurchaseOrder ns3:PO_NUMBER CustInvoiceTrans ns3:PO_ITEM CustInvoiceJour LastExternalRece

iptId ns3:REF_DOC

ns3:REF_DOC_YEAR ns3:REF_DOC_IT ns3:TAX_CODE CustInvoiceTrans LineAmount ns3:ITEM_AMOUNT CustInvoiceJour Qty ns3:QUANTITY CustInvoiceJour SalesUnit ns3:PO_UNIT RETURN ns3:MESSAGE_V1 ns3:MESSAGE_V2

4.3.4.3 ORCHESTRATION

The orchestration displayed below is used to send the incoming Microsoft Dynamics AX invoice to SAP using the BAPI_INCOMINGINVOICE_CREATE. In order to ease the process, a wrapper was created around this BAPI in SAP called ZBAPI_INCOMINGINVOICE_CREATE which simply calls and commits a transaction based on the input data from the Microsoft Dynamics AX invoice. The return structure will inform the BizTalk process for either success in creation of the Invoice or any error thrown with details of the error message.

Page 23: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

23 MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

5. SCENARIO DETAILS

5.1 REGIONAL SOURCING / MANUFACTURING SCENARIO: CENTRAL ORGANIZATION IS USING ITS SUBSIDIARY AS A SUPPLIER OF GOODS

A large company is running a different legacy system in its central operation and in some of its procurement facilities. This is a scenario where the central organization is replenished by the regional manufacturing facilities or local procurement teams. Microsoft Dynamics AX is operated for the regional manufacturing/distribution centers and SAP is operated for the central organization. The central distribution organization is using the local manufacturing/distribution center to supply its other distribution centers. In this case, the local manufacturing/distribution facility can be considered an internal vendor. Scenario description:

Central procurement generates a purchase order for goods to local site. Items are considered to be purchased from a vendor that is, in fact, a subsidiary. In this case, the central organization sends a purchase order to the subsidiary. At the subsidiary level (Microsoft Dynamics AX), this purchase order becomes a sales order

as it would be delivered to a customer. If goods are in stock then the sales order follows the regular process.

Page 24: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

24

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

If goods are not in stock then the purchase order is generated to be delivered once the order is complete.

The status of purchase can be updated through the sales order confirmation. Delivery and returns can be handled Financial flow follows the regular intercompany billing rules

The following displays the scenario transactions that will be detailed in the following sections.

5.1.1 SYNCHRONIZATION OF ITEMS AND PRICE LIST

The following IDOC is sent to BizTalk from SAP. MATMAS which has the both the material master and price

BizTalk transforms the files to the Item Master schema file to be readable by AIF in Microsoft Dynamics AX.

5.1.2 PROCESS STEPS

The following displays the steps for the scenario. Step 1: Enter transaction code ME21N to create a new purchase order. Step 2: Click Save. After the purchase order is saved, the purchase order number will be displayed on the bottom of the screen which can be reference in Microsoft Dynamics AX. In addition, the purchase order is sent to Microsoft Dynamics AX for sales order creation. Step 3: Navigate to Microsoft Dynamics AX > Accounts Receivable > Sales Order Details. The sales order is automatically created and the Corporate ERP field is equal to Purchase Order Sent. The purchase order ID (from SAP) is displayed in the Customer Requisition field. In addition, the sales order confirmation with the quantity and sales order ID will be sent to SAP from Microsoft Dynamics AX.

Page 25: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

25 MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

Step 4: Navigate to SAP and enter transaction code ME23N. View the item detail level and navigate to the confirmation tab to view the order acknowledgement. This line item will contain the details such as sales order ID (from Microsoft Dynamics AX), confirmation category that is 'AB', quantity and time stamp. Step 5: Navigate to Microsoft Dynamics AX > Accounts Receivable > Sales Order Details to process shipment by posting the packing slip. Step 6: Navigate to SAP and enter transaction code ME23N. View the item detail level and navigate to the confirmation tab to view the order acknowledgement. A new line will be created with a confirmation category that is 'LA'. The details include the inbound delivery number, quantity, and date stamp. This inbound delivery can be displayed using the transaction VL33N. Step 7: Enter the transaction code MIGO to issue the goods receipt for the purchase order. After some time, the goods will arrive at the dock. Goods received references the purchase order number and can be found in the ‘PO History’ tab of the purchase order. Step 8: Click the Post button so the goods receipt notification is sent to Microsoft Dynamics AX to SAP. The Goods Receipt ID (from SAP) will be saved in the Last External Receipt ID field in AX. In addition, the date will be set in the Last External Receipt Date field automatically. The Corporate ERP field will be set to "Delivered". Step 9: Navigate to Microsoft Dynamics AX > Accounts Receivable > Sales Order Details. The invoice will be automatically generated in Microsoft Dynamics AX and sent to SAP. The Corporate ERP status is changed to "Invoiced". The SAP receipt ID is also tracked. Step 10: Navigate to SAP and enter transaction code MIR4. The incoming invoice from Microsoft Dynamics AX is verified and created using MIRO with the details such as invoice amount, tax amount, and invoice date. This invoice also has a reference to the earlier created goods receipt of PO and inbound delivery.

6. CONCLUSION The Regional Sourcing / Manufacturing scenario details the Two-Tier ERP deployment approach where a large corporation would use a Tier 1 financial application (such as Oracle or SAP) to run its headquarters. The smaller entities such as subsidiaries, branches or departments would standardize to use Microsoft Dynamics AX. Microsoft Dynamics AX allows the smaller entities to run their business processes with a globally available industry ready solution to take advantage its ease of use, flexibility, quick implementation and training that result in lower cost of ownership. To take full advantage of this Two-Tier implementation strategy, Microsoft Dynamics AX proposes to directly connect to the corporate ERP system to streamline cross entity collaboration. This realistic scenario can be used as template for implementations where there is a need to run business processes across Microsoft Dynamics AX and SAP.

Page 26: Integration of SAP and Microsoft Dynamics AX with Microsoft BizTalk ...

26

MICROSOFT DYNAMICS AX TWO-TIER CONNECTOR – REGIONAL SOURCING / MANUFACTURING SCENARIO

The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, this document should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication.

This white paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT.

Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

© 2010 Microsoft Corporation. All rights reserved.

Microsoft, Microsoft Dynamics, the Microsoft Dynamics logo, Microsoft BizTalk Server and Microsoft .NET are trademarks of the Microsoft group of companies.

Microsoft Dynamics is a line of integrated, adaptable business management solutions that enables you and your people to make business decisions with greater confidence. Microsoft Dynamics works like and with familiar Microsoft software, automating and streamlining financial, customer relationship, and supply chain processes in a way that helps you drive business success.

U.S. and Canada Toll Free (888) 477-7989

Worldwide (1) (701) 281-6500

www.microsoft.com/dynamics