Documente Academic
Documente Profesional
Documente Cultură
White Paper
March 2007
www.microsoft.com/dynamics/nav
Contents
1. Introduction ...............................................................................................................3
1.1 Business Transactions.............................................................................................................................................................. 3
2. System Landscape......................................................................................................5
2.1 Hardware & Software platform............................................................................................................................................. 5
2.2 Installation Prerequisite........................................................................................................................................................... 5
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
1. Introduction
The Multi-site and International Organizations concept refers to a parent or holding company that uses
one business software system, which is integrated with the systems used by its individual subsidiaries or
divisions (the sites). This document describes a business scenario involving a parent company and its
sales offices (sites). In this scenario, the parent company and the sales offices have a vendor-customer
relationship. The sales offices purchase at the parent company and keep stock as a buffer for their own
sales. The end-customers receive deliveries directly from the sales office.
The parent company runs SAP R/3 while its sales offices register sales and other business activities in
Microsoft Dynamics NAV. The business transactions between parent and sales office are supported by
the exchange of messages. The content of this document is focused on the step-by-step
implementation of business processes and integration between SAP and Microsoft Dynamics NAV. It will
deal with both functional and technical issues. The business processes are explained in the first part of
the document; the second part has a more technical nature and describes the Microsoft BizTalk Server
and Microsoft Dynamics NAV Commerce Gateway interfaces and custom SAP R/3 ABAP programming.
1
A demonstration environment has been set up to implement the scenario . The business scenario can
be simulated using a demo script that describes the transactions from the user’s point of view in both
Microsoft Dynamics NAV and SAP. Please refer to this document for practical information concerning
the use of SAP and Microsoft Dynamics NAV application components in relation to the scenario. This
document describes a single sales office setting. In order to build up a similar scenario, the reader is
assumed to have basic knowledge of SAP and/or Microsoft Dynamics NAV.
R/3
Advanced Shipping
Notification +
Purchase Receipt
Delivery
1
The scenario in this document uses Microsoft Dynamics NAV release 4.0. This same scenario can also be implemented
with release 5.0.
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
In this scenario, the SAP parent and Microsoft Dynamics NAV sales office essentially have a vendor-
customer relationship. Information is exchanged; goods are shipped.
1.1.2 Shipping Notification and Delivery from SAP to Microsoft Dynamics NAV
When the complete order can be delivered, a delivery is created after which a goods issue is done in
SAP. Both transactions are manual. The delivery note created in SAP 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 SAP 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 SAP. The
creation of the delivery note, updating the pick quantities and goods issue can be done directly in the
delivery note (one transaction in SAP). When the goods issue is done and the delivery note is saved,
the shipping notification message is automatically triggered and sent to Microsoft Dynamics NAV.
The shipping notification creates an Inbound Microsoft BizTalk Purchase Receipt document in
Microsoft Dynamics NAV. This receipt automatically updates the Expected Receipt Date in the Purchase
Order indicating when the complete order (total quantity of all requested items) will arrive at the sales
office. The SAP shipping notification document number is also captured as the Vendor Shipment no.
in the Microsoft Dynamics NAV Purchase Order.
The mechanism for the interface uses a standard SAP IDOC. The IDOC is generated via the print
program in the order document as soon as the document is saved.
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
2. System Landscape
Microsoft Dynamics NAV Virtual Server: Windows Microsoft Dynamics NAV 4.00 build 19914
and Microsoft BizTalk Server 2003 Microsoft Dynamics NAV Application Server
Server 2004
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
3. System set tings 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 NAV concerning the integration of their processes. The starting point for the SAP
configuration is a running IDES (Internet Demo and Evaluation System). The Microsoft Dynamics NAV
setup details begin at the installation of the Microsoft Dynamics NAV database and client.
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
SAP Transaction: SPRO
Financial Accounting Assign company code 2500 to credit Credit control area 1000 is the standard IDES
control area 1000 control area for Europe.
Controlling Assign company code 2500 to Activate cost accounting functionality for the
controlling area 1000 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 2500 to company code A plant belongs to one company code.
2500
Sales & Distribution Assign sales organization 2500 to Link financial accounting (company code
company code 2500 level) to the sales activities.
Assign sales organization – Define the plant that will provide goods for
distribution channel – plant the sales area.
Logistics Execution Assign shipping point 2500 to plant A shipping point is part of a plant.
2500
Financial Accounting Assign chart of accounts INT to The standard SAP chart of accounts INT is
Global Settings company codes 2500 and 2510 used for both parent and sales office.
General Ledger Define financial statement version 2510 is the company code that corresponds
Accounting – Business 2510 to 2510 in Microsoft Dynamics NAV. The
Transactions – Closing financial statement version is a default SAP
– Documenting standard financial statement containing
assets, liabilities, P&L, financial results, taxes,
and so on. This financial statement was
already available in the system and did not
need improvement.
General Ledger Define financial statement version 2500 is the consolidation company code.
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Accounting – Business 2500 Therefore, we would only like to see the
Transactions – Closing consolidation accounts in the financial
– Documenting statement version. A new financial statement
was needed.
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
The output type does not define one single medium used for creating the output. The image below
shows that there are various methods to output a sales order confirmation. (Printer, fax, EDI) Medium
six allows us to send IDOC messages and will be explained in the next step.
In the second step, the system can link the output type and specific medium to a business partner.
This is useful because you might deal with some business partners who want to have paper forms
while others prefer electronic messages. The condition record created below shows that sales order
confirmations for business partner 2510 are created using medium 6, which means that an electronic
message is created as soon as the sales order has been saved in the SAP system. This is not part of the
customization but is closer to transactional/master data and thus accessed in the standard SAP user
menu as transaction W11.
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
An actual sales order document (transaction VA03 – display) contains the reference to the output type
and shows the status of this output (whether it is paper or otherwise). This is illustrated below. The log
for sales order 9366 show that output type BA00 (order confirmation) has been created in the form of
an IDOC message that has been forwarded for transmission.
At this point, we turn to the configuration of the IDOC subsystem where partner profiles are created for
every business partner, with which the system needs to exchange electronic messages. Partner profiles
are accessed using transaction WE20.
Note: for paper output, the process would stop right here.
10
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
The sales office is represented as a standard customer. A corresponding partner profile has been
created to define that the system will allow three types of IDOC messages to be sent to this particular
business partner (outbound parameters):
In the details of each message type, there are further configuration settings like the basic type and their
message control. A basic type is a hierarchical division of messages types. While a message type is a
generic name for EDI messages, a basic type is the message itself. In other words, a message type
groups one or more basic types. The message control parameters define for which specific output type
an IDOC can be created. For the sales order confirmation, this is output type BA00.
This concludes the setup for the sales order confirmation and invoice messages. The configuration
above allows the automatic creation and transmission of IDOCs and uses standard SAP functionality.
11
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Message Type ORDRSP Purchase order / order confirmation
As indicated earlier, the sales order confirmation will only reach the sales office if the parent company
cannot meet the requirements of the purchase order sent by the sales office.
Sales Invoice
Billing Type F2 Invoice
Shipping Notification
Delivery Type LF Delivery
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 multi-site and international organization 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 allows the parent company to capture its intra-company sales and isolate it
for financial consolidation purposes at a later stage. In order to create this scenario, the sales office is
set up as a standard customer master record in the SAP system. This customer master is referenced
when creating sales orders for the sales office. For this scenario, customer master record 2510 has been
created using transaction XD01.
12
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
3.2.2 Sales Offices as Company Codes in SAP
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 2510 has been created for this purpose in the same way as the
company code 2500 for the parent company.
13
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
3.2.6 End-Customer Masters
The end-customer master data will be interfaced between SAP and Microsoft Dynamics NAV. The
standard SAP customer master data has been used with no modifications. The mechanism for the
interface uses a standard SAP IDOC. Each end-customer will have a SAP customer, and this same
number will be used in Microsoft Dynamics NAV when an end-customer sale is made. End-customer
master data is transferred for demonstrational purposes but is not used in actual sales transactions.
14
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Setup Company Information
Field Description
Timer Interval The interval the NAS uses to poll for XML documents
Customer Inbox The folder name where the customer documents are saved by SAP XI
Consolidation Outbox The folder that is used as standard outbox for consolidation documents
Make sure all these folders exist. Also make sure all these folders have an “Archive” and “Error”
subfolder. Processed documents are moved into the “Archive” subfolder, and documents which result
in an error are moved into the “Error.” subfolder.
After entering and saving this information, the NAS needs to be (re)started. Check the Windows event
log for error or warning messages.
Make sure these folders are available for the user running the NAS from the machine that is running
the NAS.
Drive mappings cannot be used because they probably do not exist in the service context of the user.
15
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Field Description
Rqst. Srv. IP Address IP address of the server that contains the Microsoft BizTalk Server and the
Commerce Gateway Request Server
Rqst. Srv. Port No. Number of the port that the Commerce Gateway Request Server is listening
to
Rqst. Srv. Transport Type Transport type that is used for communicating with your business partner
Appln. Srv./Broker IP Address IP address of Microsoft Dynamics NAV Commerce Gateway Broker
Appln. Srv./Port No. Number of the port that the Microsoft Dynamics NAV Commerce Gateway
Broker is listening to
Microsoft BizTalk Organization The unique identification number that you agree with your partner to use to
ID identify your companies
Use Encryption A check mark in this field indicates that the program is set up to use strong
encryption when sending documents from the client to the Commerce
Gateway Request Server and when receiving documents from the Microsoft
BizTalk Server to the Microsoft Dynamics NAV Application Server
16
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Field Description
Microsoft BizTalk Partner No. Automatically generated Microsoft BizTalk Partner no.
Partner Type Current Microsoft BizTalk partner is a vendor
Partner No. Microsoft Dynamics NAV vendor number for the specific Microsoft BizTalk
partner taken from the Vendor Table
Partner Name Microsoft Dynamics NAV vendor name for the specific Microsoft BizTalk
partner
Microsoft BizTalk Organization The unique identification number that you agree with your partner to use to
ID identify your companies
Destination Address Destination address for the document(s) you are sending
Use Company ID Need to add a company ID to the document you are sending, in order to
allow the receiving company’s Microsoft BizTalk Server to identify the
document
When you exchange documents electronically with your Microsoft BizTalk partners, you must indicate
both the relevant rules of exchange and which type of agreements or documents you want to include
in the Microsoft BizTalk partner agreement for each specific Microsoft BizTalk partner.
The Microsoft BizTalk Partner Setup Header contains the relevant exchange rules for each Microsoft
BizTalk partner, and the Microsoft BizTalk partner setup lines contain data on the included types of
agreements or documents, and indicates whether they are active.
17
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
For purposes of this demo, only the following types of documents were activated and exchanged:
• IC Import Product Catalog – this is an extended version of the standard Product Catalog that
contains more fields.
• Purchase Order – standard version was used.
• Purchase Receipt – standard version was used.
• Purchase Invoice – standard version was used.
Fill the following fields in the Purchase Document tab of the Partner Setup Header with the correct
information:
Field Description
Purchase Item Number Purchase item number that you and your Microsoft BizTalk partner have
agreed to use.
Auto Purchase Receipt Allows you to indicate whether the program should process a Microsoft
BizTalk purchase receipt manually or automatically.
Purch. Order Cnfmn. (Qty) If the quantity of items is different, indicate that the referenced Microsoft
Dynamics NAV purchase order should be adjusted or validated.
Ord Confmn Combd If the direct unit cost is different, indicate whether the referenced Microsoft
Amt/Cost/Disc. Dynamics NAV purchase order should be adjusted or validated.
Purch Ord Confmn. Expd Rcpt If the expected receipt date is different, indicate whether the referenced
18
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Microsoft Dynamics NAV purchase order should be adjusted or validated.
Auto. Purchase Invoice Allows you to indicate whether the program should process a Microsoft
BizTalk purchase invoice manually or automatically.
Purchase Invoice Indicate, for this specific Microsoft BizTalk partner, whether the program
should create a new Microsoft Dynamics NAV purchase invoice or find and
update the referenced Microsoft Dynamics NAV purchase order to reflect the
information in the Microsoft BizTalk purchase invoice.
Inv. Combined Amt/Cost/Disc. If the direct unit cost is different, this field allows you to indicate whether the
referenced Microsoft Dynamics NAV purchase order should be adjusted or
validated
Update Purchase Comments Indicate whether the referenced Microsoft Dynamics NAV purchase order
comments should be added or ignored.
Fill the following fields in the Product Catalog tab of the Partner Setup Header with the correct
information:
Field Description
Product Item No. Indicate what product item number you and your Microsoft BizTalk partner
have agreed to use.
Auto Product Catalog Indicate whether the program should process a Microsoft BizTalk product
catalog manually or automatically
Item Import Action Indicate whether the program should update relevant items, create new
items or update and create new items in the Microsoft Dynamics NAV Item
19
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
table when you validate Microsoft BizTalk product catalogs.
Item Import Destination Indicate to which destination the program will update the items that you
import from the Microsoft BizTalk product catalog. Options are Item Card,
Item Vendor Catalog or both.
Use Vendor Item Number Purchase item number that you and your Microsoft BizTalk partner have
agreed to use.
Def. Gen. Prod. Posting Group Default general product posting group that will be used for all items
imported from inbound product catalogs. The value in this field will be
copied to the Gen. Prod. Posting Group field in the Item table.
Def. Vat Prod. Posting Group Default VAT product posting group that will be used for all items imported
from inbound product catalogs. The value in this field will be copied to the
VAT Prod. Posting Group field in the Item table.
Def. Inv. Posting Group Default inventory posting group that will be used for all items imported from
inbound product catalogs. The value in this field will be copied to the Def.
Inv. Posting Group field in the Item table.
3.4.2 Import of Microsoft BizTalk Inter Company Product Catalog [Items and Purchase Prices)]
• Created new Microsoft BizTalk Product Catalog Schema for new fields, i.e. Costing Method,
Standard Cost, Item Category Code, Product Group Code and Ending Date.
• Added functionality to Auto accept inbound Microsoft BizTalk IC Product Catalog.
• Added “Start date” field to the Vendor Price Table (Item Card -> Purchases -> Prices).
20
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
• Fixed some Microsoft BizTalk PO fields that were not correctly mapped to the corresponding
XML fields.
21
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Form 99008523 Microsoft BizTalk Partner Setup NAVW14.00 Changed
22
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
File system for transport between SAP and Microsoft Dynamics NAV: The file system for transport is
used because this is a very easy transport. It is also the only one that is fully integrated into Microsoft
Dynamics NAV. Another possibility would have been MSMQ (communication components), especially
when both systems are not at the same location.
23
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
4. Master Data Upload to Micros oft Dynamics NAV
Certain SAP master data will need to be uploaded into Microsoft Dynamics NAV to facilitate the
business processes. This master data needs to be present in Microsoft Dynamics NAV before any
sales/purchase activity can take place. There are four sets of master data to be uploaded to Microsoft
Dynamics NAV:
Chart of Accounts
The chart of accounts as it is defined in SAP will be mirrored in Microsoft Dynamics NAV. A Microsoft
Excel file with all the BS/P&L accounts will be integrated in Microsoft Dynamics NAV. This makes end-
of-month financial bookings and consolidation more straightforward. The file is transferred directly to
Microsoft Dynamics NAV for manual integration and does not pass through the SAP XI server. This was
done because it is a one-time setup and would be relatively time-consuming to process through the
SAP XI server.
Product Master and Product Pricing
The standard SAP product master structure is used for purchasing and sales activities.
Two sets of price lists for the products are created. One contains the inter-company pricing
agreements and the other contains end-customer pricing recommendations for the sales offices.
For this scenario, the Product Master and its inter-company price only are interfaced with Microsoft
Dynamics NAV.
The product master with pricing is exported to Microsoft Dynamics NAV using the standard Material
Master IDOC MATMAS03 extended with an additional segment to include the product’s inter company
price.
End-Customer Master
This master data is transferred for technical/demo purposes mostly. End-Customers have SAP sales
offices (the sales offices) assigned to them. Customer master records C1_2510 and C2_2510 represent
two end-customers for sales office 2510 for example. Exported to Microsoft Dynamics NAV using
standard IDOC DEBMAS06.
24
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
25
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
5 Financial Consolidation
End-of-month consolidation will take place in SAP and is done by uploading the total purchasing
amounts from Microsoft Dynamics NAV in an XML file to SAP. Both Microsoft Dynamics NAV and SAP
have the same chart of accounts with identical G/L accounts, so therefore, every account in Microsoft
Dynamics NAV is mirrored in SAP.
2510
165000
Accounts Payable 1 Accounts Payable
145000
Tax Account 2 Tax Account
231100
Loss Freight Variances 3 Loss freight Variances
792000
Finished Goods Inventory 4 Finished Goods Inventory
Inventory inventory
Explanation:
• The graphics above show the matches of the accounts in both systems.
• Accounts payable are the total I/C postings on all accounts payable in Microsoft Dynamics
NAV.
• Finished goods inventory are the totals of the standard cost price of the purchased goods.
26
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
• Loss freight variances are the total of the calculated difference between the standard cost price
and the transfer price.
Showing the results on company 2510 in SAP
The results on company 2510 will be shown when running Balance/Financial Statement named 2510.
Report RFBILA00 is standard functionality used to display the Balance/Financial Statement. This
Financial statement is a standard statement.
Showing the consolidation results on company 2500 in SAP
In order to see the financial consolidation In company 2500, you must run RFBILA00 with Financial
Statement 2500. This financial statement is made with the inter company accounts to show the total
amounts of the consolidation.
27
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
6. Microsoft Bi zTalk Server
The SAP Exchange Infrastructure (XI) is used in the multi-site and international organization scenario as
an integration broker between SAP and Microsoft Dynamics NAV. The communication between SAP
and XI is carried out by IDOCs (SAP standard interfacing documents) and BAPIs (SAP Business
Objects). The picture below shows the interfaces.
28
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
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.
6.2 Interfaces
The interfaces for the multi-site and international organization model are summarized below:
29
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
6.2.2 Microsoft Dynamics NAV Interface Definitions
The document definitions of Microsoft Dynamics NAV are available in Microsoft Commerce Gateway.
The definitions of the documents that are not available in Microsoft Commerce Gateway (customer
master and financial consolidation) are added to Microsoft BizTalk Server manually.
30
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
7. Custo m Abap in the R/3 I DES s ystem
The demo requires custom ABAP programming in R/3.
7.1 Introduction
All the custom ABAP is described in this section. Of course, we are assuming that
you are logged on to the SAP R/3 IDES system.
7.2.1 Z_BAPI_SALESORDER_CREATEFROMD2
This BAPI is creating a new sales order in the SAP system. It is a wrapper for the standard BAPI
BAPI_SALESORDER_CREATEFROMDAT2.
We use a custom wrapper in order to do explicit assumption about the business scenario and generate
an implicit database commit, so the update is made without an explicit call of a second database
commit.
Create a new function with the name Z_BAPI_SALESORDER_CREATEFROMD2.
Check the radio button “Remote-enabled module.” This enables the BAPI to be called from external
systems. Then, go to the Import sub screen and fill in the following data:
31
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Go to the Tables tab:
32
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Utilities->more utilities->Upload/Download->Upload and upload the file
Z_BAPI_SALESORDER_CREATEFROMD2_SOURCE in the folder ABAP Source
7.2.2 Z_BAPI_ACC_GL_POSTING_POST
The next BAPI we have to make is a wrapper for the standard BAPI
BAPI_ACC_GL_POSTING_POST.
In order to make things simpler and to avoid having to call a second BAPI to do the commit end for
making the functional assumptions explicit, we created a custom BAPI.
The steps are the same as in the previous one.
Start transaction SE80 and open function group ZMICROSOFT DYNAMICS NAV (if not already open).
Go to the left navigation tree:
Mark Function Modules and in the context menu, create a new function module with the name
Z_BAPI_ACC_GL_POSTING_POST. Now, go to the Attribute tab and again mark the radio button
“Remote-enabled module”.
33
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Go to the Import tab:
34
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Go to the Tables tab:
Go to the Source tab and upload the following file: Z_BAPI_ACC_GL_POSTING_POST_SOURCE in the
map “ABAP source”. Activate the function group and assign it to a request.
35
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
8. EXTENDE D MATERIAL MA STER IDOC
The Standard MATMAS03 IDOC was extended to include Segment: ZE1KONH. This segment consists of
the material purchase price. The export program was updated to ensure that the Extended MATMAS03
IDOC with the pricing segment could be exported to Microsoft Dynamics NAV.
Below are the steps to extend MATMAS03 IDOC with a new segment for prices.
To create a new segment with the necessary fields for material purchase prices, go to Trx. WE31 and
enter the Segment Type: ZE1KONH – Price list conditions.
Then, select the relevant fields below to be added in this segment. Save and release the segment when
completed.
36
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Field Name Description
1. DATAB Valid-From Date
To Extend the MATMAS IDOC with the new segment, go to Trx. WE30 and create a new Extension
Object: ZPRICES.
This object is the extension of the MATMAS03 IDOC with the new segment: ZE1KONH.
Select the segment: E1MVKEM – Master Material Sales Data and insert the new Segment: ZE1KONH.
37
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
Save and release the extension.
To assign the extension to the MATMAS03 Message Type, go to Trx. WE82 and insert a new entry for
MATMAS03 with the following values:
38
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
39
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
9. UP DATE ABAP PROGRAM FO R EXPORTING EXTENDED
MATMA S IDOC
Importing the SAP Transport Request: MESK900127 (See 10. Appendix for the SAP modification code)
will provide all the necessary ABAP coding and allow you to export the Extended MATMAS03 IDOC
with prices. See instructions below. (The modification files are also part of the installation package
provided.)
1. Uncompress the zip file: MESK900127 containing the SAP Transport ‘MESK900127. This file
consists of the updated Export program for Material Masters.
K900127.MES
This is the control file for the transport. The information about the transport (transport owner,
transport routes, etc., is saved in this file.
This file should be placed on the SAP Server in a directory similar to:
<filesystem>\usr\sap\trans\cofiles\
R900127.MES
The second file is the data file that contains the actual data of the transport request.
This file should be placed on the SAP Server in a directory similar to:
<filesystem>\usr\sap\trans\data\
3. Login to SAP. The user should have authorization rights for SAP’s Transport Management
System (STMS).
4. Follow the steps below to import the configuration settings into SAP IDES 4.7.
i. Goto Trx. STMS
ii. Click on the button (Import Overview) to see the Import Overview
iii. Select (double-click) the system to import the configuration into, i.e. Development
system.
iv. On the Extras menu, select Other Requests -> Add
40
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
vii. Click on the button (Import Request) to import the configuration into the
selected SAP system.
viii. There might be a Warning message that is displayed, but this can be ignored.
41
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
10. Appendix
10.1 Installation Prerequisites
Microsoft BizTalk 2004 & the Microsoft BizTalk SAP Adapter
• Install the .NET Connector 1.0.3 (SetupRuntime .NET Connector 1.0.3) prior to installing the SAP
Adapter for Microsoft BizTalk
• Apply the following patches to the Microsoft BizTalk .NET Connector (in this order):
KB 884553 FIX for: The receipt is not successful when you use the Microsoft BizTalk Adapter 2.0
for mySAP Business Suite to receive an IDOC in Microsoft BizTalk Server 2004
KB 885425 FIX for: You receive a "The adapter failed to transmit message going to send port"
error message in the Microsoft BizTalk Adapter 2.0 for the mySAP Business Suite
IF L_RESULT <> 0.
MESSAGE ID 'EA' TYPE 'E' NUMBER 238
WITH SEGMENTTYP RAISING SEGMENT_NOT_EXISTING.
ENDIF.
*3)
*{ DELETE MESK900127 1
*\ IF RELEASED = SPACE.
*\ READ TABLE LT_SEGDEF INTO L_SEGDEF INDEX 1.
*\ ELSE.
*\ LOOP AT LT_SEGDEF INTO L_SEGDEF WHERE RELEASED <= RELEASED
*\ AND RELEASED <> SPACE.
*\ EXIT. "Take first entry
*\ ENDLOOP.
*\ ENDIF.
*\ IF SY-SUBRC <> 0.
*\ MESSAGE ID 'EA' TYPE 'E' NUMBER 257 WITH SEGMENTTYP
*\ RELEASED RAISING VERSION_NOT_EXISTING.
*\ ENDIF.
*} DELETE
*{ INSERT MESK900127 2
*<AB PROJECT="SAP<->MICROSOFT BIZTALK<->MICROSOFT DYNAMICS NAV" DATE="2005/06/30"
DESCRIPTION=
* "GET LATEST VERSION INDEPENDANT OF RELEASE>
READ TABLE LT_SEGDEF INTO L_SEGDEF INDEX 1.
* </AB>
*} INSERT
42
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
WA_CACHE1-EXPORTLENGTH = L_SEGDEF-EXPLENG.
* wa_cache1-SEGNAM30 = " not used if help = 4.
WA_CACHE1-SEGNAM40 = L_SEGDEF-SEGDEF.
WA_CACHE1-VERSION = L_SEGDEF-VERSION.
APPEND WA_CACHE1 TO EXTERNAL_CACHE1.
EXPORTLENGTH = WA_CACHE1-EXPORTLENGTH.
SEGNAM30 = WA_CACHE1-SEGNAM30.
SEGNAM40 = WA_CACHE1-SEGNAM40.
VERSION = WA_CACHE1-VERSION.
EXIT.
ENDIF.
*4) help = 3 : segnam30 is requested
L_LENG = STRLEN( L_SEGDEF-SEGDEF ).
*4a)
IF L_LENG <= 10.
L_SEGDEF30 = L_SEGDEF-SEGDEF.
** if version 000 strip off last three zeros since in 3.0/3.1 we had
** space as initial version code
** last three characters are version number !
SUBTRACT 3 FROM L_LENG.
IF L_LENG > 5.
ASSIGN L_SEGDEF-SEGDEF+L_LENG(3) TO <TAIL>.
** if the version '000' is created in 4.0 or later and we want to send
** to release < 4.0 we will cut off the last 3 zeros since
** the very same segment defined in 3.0/3.1 will not have this zeros
IF <TAIL> EQ '000' "#EC PORTABLE
AND (
( L_SEGDEF-RELEASED GE '4' ) "#EC PORTABLE
OR ( L_SEGDEF-RELEASED EQ SPACE ) ). "#EC PORTABLE
ASSIGN L_SEGDEF-SEGDEF(L_LENG) TO <HEAD>.
L_SEGDEF30 = <HEAD>.
ENDIF.
ENDIF.
ELSE.
*4b) length of l_segdef-segdef > 10; look in translation table
SELECT * FROM SEGEXTCONV WHERE EXTNAME40 EQ L_SEGDEF-SEGDEF.
ENDSELECT.
IF SY-SUBRC <> 0.
MESSAGE ID 'EA' TYPE 'E' NUMBER 274 WITH L_SEGDEF-SEGDEF
SEGMENTTYP RELEASED RAISING CONVERSION_NOT_AVAILABLE.
ELSE.
L_SEGDEF30 = SEGEXTCONV-EXTNAME30.
ENDIF.
ENDIF.
* 4c) write in cache and give result for 4a (anyway) and 4b(if OK)
WA_CACHE1-SEGMENTTYP = SEGMENTTYP.
WA_CACHE1-RELEASED = RELEASED. "we use here the requested release !
WA_CACHE1-HELP = HELP.
WA_CACHE1-EXPORTLENGTH = L_SEGDEF-EXPLENG.
WA_CACHE1-SEGNAM30 = L_SEGDEF30.
WA_CACHE1-SEGNAM40 = L_SEGDEF-SEGDEF.
WA_CACHE1-VERSION = L_SEGDEF-VERSION.
APPEND WA_CACHE1 TO EXTERNAL_CACHE1.
EXPORTLENGTH = WA_CACHE1-EXPORTLENGTH.
SEGNAM30 = WA_CACHE1-SEGNAM30.
SEGNAM40 = WA_CACHE1-SEGNAM40.
VERSION = WA_CACHE1-VERSION.
ENDFUNCTION.
43
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
SAP BAPISOCreate_Microsoft Dynamics NAVPOxml.xls
SAP Export Program for Extended MATMAS can be found in the following file:
Filename
MESK900127.zip
Sending materials
Although we put price information in the standard IDOC MATMA03, the standard BD10 transaction
ends with an error message. Therefore, use standard BD10 to send a message, and we use an extended
IDOC type ZPRICES. The reason is that the transaction BD10 always checks the generated IDOC, which
is ZPRICES, against MATMAS05; this is “hard coded” by SAP.
In order to modify SAP so that it checks against ZPRICES, the following modifications need to be
applied to the function module “MASTERIDOC_CREATE_MATMAS.”
Please go to SE37, fill in the name of the function module and change to edit mode.
You are now asked to fill in a modification key (if not available it must be required from SAP OSS).
Insert the code between the INSERT tags.
*{ INSERT MESK900127 1
* <AB PROJECT="SAP<->MICROSOFT BIZTALK<->MICROSOFT DYNAMICS NAV" DATE="2005/06/30"
DESCRIPTION=
* "STANDARD SAP TAKES ALWAYS THE LATEST IDOC, BUT IN
* OUR CASE WE ARE USING MATMAS03 EXTENSION ZPROCES INSTEAD
* OF MATMAS05>
* Get IDOC type for this partner and this message type.
* Standard SAP uses hard coded "MATMAS05"
SELECT SINGLE *
FROM EDP13 INTO LV_EDP13
WHERE RCVPRN = F_IDOC_HEADER-RCVPRN
AND RCVPRT = F_IDOC_HEADER-RCVPRT
AND MESTYP = F_IDOC_HEADER-MESTYP.
* </AB>
*} INSERT
* Distribute IDOC
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL = F_IDOC_HEADER
TABLES
44
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
COMMUNICATION_IDOC_CONTROL = T_IDOC_COMM_CONTROL
MASTER_IDOC_DATA = T_IDOC_DATA
EXCEPTIONS
ERROR_IN_IDOC_CONTROL = 01
ERROR_WRITING_IDOC_STATUS = 02
ERROR_IN_IDOC_DATA = 03
SENDING_LOGICAL_SYSTEM_UNKNOWN = 04.
ENDFUNCTION.
Extend ZXMGVU03
*&---------------------------------------------------------------------*
*& Include ZXMGVU03 *
*&---------------------------------------------------------------------*
* <DATA SELECTION>
* MATNR EN SALESORGANISATION
LOOP AT IDOC_data.
CASE IDOC_data-segnam.
WHEN 'E1MARAM'.
MOVE IDOC_data-sdata TO e1maram.
WHEN 'E1MVKEM'.
MOVE IDOC_data-sdata TO e1mvkem.
ENDCASE.
ENDLOOP.
SELECT SINGLE *
FROM a306
WHERE kappl = 'V'
AND kschl = 'PR00'
AND vkorg = e1mvkem-vkorg
AND vtweg = e1mvkem-vtweg
AND pltyp = '01'
AND matnr = e1maram-matnr
AND datab <= sy-datum
AND datbi >= sy-datum.
SELECT SINGLE *
45
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV
FROM konp
WHERE knumh = a306-knumh.
* </DATA SELECTIE>
MOVE-CORRESPONDING:
a306 TO ze1konh,
konp TO ze1konh.
* </FILL IDOC SEGMENT ZE1KONH>
* <ADD SEGMENT TO IDOC>
IDOC_data-segnam = 'ZE1KONH'.
IDOC_data-sdata = ze1konh.
APPEND IDOC_data.
* </ADD SEGMENT TO IDO>
Microsoft Dynamics is a line of financial, customer relationship, and supply chain management solutions that help businesses work
effectively. Delivered through a network of channel partners providing specialized services, these integrated, adaptable business
management solutions work like and with familiar Microsoft software to streamline processes across an entire business.
Address:
Microsoft
Frydenlunds Allé 6
2950 Vedbaek
Denmark
Tel +45 45 67 80 00
Fax +45 45 67 80 01
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.
46
MULTI-SITE AND INTERNATIONAL ORGANIZATIONS: INTEGRATION OF SAP AND MICROSOFT DYNAMICS NAV