UserManual v1.0
UserManual v1.0
Version: 1.0
1 OVERVIEW ...................................................................................................................1
2 INSTALLATION............................................................................................................3
7 TROUBLESHOOTING ...............................................................................................19
8 SUGGESTED READINGS..........................................................................................21
DocEngine comes in two flavors: Lite and Pro. The Lite version is
distributed freely to Finnish SAP Business One resellers and customers (for
use in Finland only). The Lite version, however, is somewhat limited in
functionality. While the basic functionality is the same in both versions, the
Lite version is only capable of exporting sales invoices and sales credit
1
invoices as well as importing purchase invoices and purchase credit invoices
in Finvoice format. The Lite version supports a maximum of two import
specifications and two export specifications. DocEngine Pro can handle any
type of sales or purchase document (which is supported in the DI API) and
supports an unlimited number of import and export specifications. Future
versions of DocEngine Pro will also allow importing and exporting journal
entries, masterdata etc.
2
2 Installation
DocEngine is compatible with all the Windows versions that SAP Business
One supports. Currently supported SAP Business One versions are SAP
Business One 6.5 and 2004. For database server, only Microsoft SQL Server is
currently supported.
There are separate DocEngine versions for SAP Business One 6.5 and 2004.
PLEASE NOTE!
While the 6.5 version can also be used with SAP Business One 2004
(with the compatibility license and DI API intact), please remember
that also the limitations of DI API 6.5 apply in this case. These
limitations include i.a. the inability to set the payment reference code
when importing purchase invoices.
As a prerequisite for installing DocEngine, you will need to have the .NET
framework version 1.1 installed on the computer. If you are installing from the
distribution CD, the setup program will automatically install .NET framework,
if it not already installed. If you have downloaded the installation package
from the Docengine support website, the installation application will inform
you if the .NET framework has not been installed and discontinue installation.
You can check if the .NET framework has been installed by selecting “Start-
Settings-Control Panel-Add or Remove Programs”. If the .NET Framework is
installed, you will find “Microsoft .NET Framework 1.1” from the list of
currently installed programs.
Additionally, you will need to install a version of the SAP Business One
Data Interface API that is compatible with your SAP Business One
3
installation. Please consult SAP for getting the correct installation package
and installation instructions for DI API.
4
Step 3. Confirm installation
In order to activate the application, you will need to apply for a license key
from your SAP reseller. In order to get the license key, please make sure you
have the following information at hand:
• The OS version and service pack level of the computer where you
installed DocEngine.
5
• The contact information (email address and telephone number) for the
person who will be the main contact person regarding DocEngine in
your company.
When you receive the license key, you will need to supply the license key
information into the registration dialog of DocEngine. Also the name field
must be filled in with exactly the same name as the name that was supplied to
Profiz when requesting the license key.
6
Step 4. Register the application (automatic)
7
3 Using the application
The application supports two different modes: interactive mode and batch
mode. In interactive mode, the application functions as a normal Windows
application. The purpose of the batch mode is to enable running the
application as a scheduled background process that can be started from the
command-line interpreter. The application itself does not include a scheduling
service, but instead it can be called by the Scheduler service of Microsoft
Windows (or by another similar scheduling service).
8
If you are familiar with Data Transfer Workbench (DTW), you will certainly
notice the similarity between the user interface of DocEngine with DTW. This
similarity should make the user interface very intuitive for existing SAP
Business One consultants, most of whom have at least seen the Data Transfer
Workbench.
The application can be started in batch mode from the command line by
calling DocEngine.exe. The only available parameters are the batch type
(import or export) and the name of the document specification (as specified in
the configuration file DocEngine.xml) that identifies the documents and the
format that should be used in the batch.
Import:
Export:
9
4 Using the main functions
4.1 Logging in
To log in to a company database, simply click the “Log on” button in the
taskbar. This will open a login form, prefilled with the user id and IP address
used in the previous session. If this is the first time you are logging in, you will
also need to set the correct IP address for the database server as well as the
user id you wish to use. After setting the IP address, you should click the
refresh button next to the database selection field. This will retrieve the list of
available databases from the server. After selecting the correct database,
simply click the “OK” button to initiate the login process.
PLEASE NOTE! In some cases, the “use trusted” login method might not
work (for a number of reasons, such as the corruption of user data for the
“OBSCommon” user in the database server). To circumvent these problems,
you might want to deselect the “use trusted” checkbox. This will enable the
server userid and server password fields, which should be filled with a valid
SQL Server userid and password.
When DocEngine is first taken in use with a new database, you will need to
let DocEngine create some user defined fields in SAP Business One in order to
enable the export functionality. This is done by first logging in to the database
(as described in chapter 6.1) and then selecting the function “Advanced-
Initialize database”.
The export wizard is started by clicking the “Export” button in the toolbar
(if you are not logged on, this button will be disabled). In the first dialog of the
wizard, you get to select the export specification you wish to use in the export.
Additionally, you can select to do the export as a batch or by selecting
manually the documents to export.
10
When selecting the batch mode, you are given a chance to change the
default settings for the batch run before starting it. In the select mode, you can
select one by one the documents you wish to export.
The import wizard is started by clicking the ”Import” button in the toolbar
(if you are not logged on, this button will be disabled). In the first dialog of the
wizard, you get to select the import specification you wish to use in the import.
Additionally, you can select to do the import as a batch or by selecting
manually the documents to import.
When selecting the batch mode, you are given a chance to change the
default settings for the batch run before starting it. In the select mode, you can
select one by one the documents you wish to import. Additionally, you can
select to import the documents as draft documents or actual documents.
To exit the application, simply select File-Exit or close the main window.
If you are modifying any of the configuration files for DocEngine and wish
to reflect these changes in DocEngine without restarting the application, you
can use the “Reload settings” function which is found in the “Advanced”
menu. If you are logged in to a database while doing this, you will be
automatically be logged off.
11
5 Configurations required in SAP Business One
12
For correct export of the SWIFT identifier in the ePI (electronic payment
initiator) the “SWIFT No” must be specified for all bank branches and
accounts that are referred to in the export. This is done in the Administration-
Definitions-Banking-Define Banks dialog in SAP Business One.
For producing the ePI, also the house bank (specified in the Payment
System tab of the business partner record in SAP Business One) needs to be
correctly set. This information is also used in producing the virtual bank bar
code.
Item codes are perhaps the most challenging issue in the whole integration
process. When exporting documents, the default Finvoice export
configuration will place the SAP Business One item code in the
“InvoiceRow/ArticleIdentifier” field. If there is an alternative item code
(partner catalog number) specified for the item and customer in question, this
will be placed in “InvoiceRow/BuyerArticleIdentifier”. If there is no
alternative item code specified, both “ArticleIdentifier” and
“BuyerArticleIdentifier” will carry the same value. In this case, the receiver
will have to be able to identify the same item code that is being used in the
sending system.
13
6 Modifying the configuration files
There are three kinds of configuration files: the main parameter file
docengine.xml plus a number of export templates and import specifications.
DocEngine.xml is located in the etc folder, which is found below the
installation folder of the application. The export templates are located in the
etc\templates folder and the import specifications are located in the
etc\importspecs folder.
6.1 Docengine.xml
<body>
<templatefile>FinvoiceTemplate.vm</templatefile>
<targetfolder>outbox\</targetfolder>
<prefix>finvoice_export_</prefix>
<variable>DocNum</variable>
<suffix>.xml</suffix>
</body>
</export>
An example of an export specification
14
Please note the <query> tags, which contain the query that is used for
selecting the documents to export. In batch mode, all the documents that
match the query will be exported. In interactive mode, the documents found
will be displayed and you can choose which documents will actually be
exported.
The <header> part is only used in DocEngine Pro. The Lite version does not
support separate header files.
15
The following conversion example shows a query conversion that retrieves
the internal business partner identifier of SAP Business One based on the VAT
ID of the company as specified in the Finvoice document.
<conversion>
<name>Supplier_CardCode_from_TaxID</name>
<type>query</type>
<query>
select cardcode as $0 from ocrd where lictradnum='$1' and cardtype='S'
</query>
</conversion>
An example of a query conversion
• Lastlogin.vm
• Log4net.vm
• VM_global_library.vm
A you can see, the export template is a ’skeleton’ of the actual document to
be exported. It contains both fixed parts as well as dynamic parts which are
populated during the export process. The dynamic parts use a special syntax
that is based on the Velocity Template Language (VTL).
16
This method takes two parameters: the object and the field. The object
parameter is a handle to a logical object created by DocEngine at runtime just
before the export. These handles include the following:
There are also some other methods in addition to the basic $doc.get method.
For instance, it is possible to add a third parameter to the method call that
defines a type conversion that must be done for the field in question. For
instance, the method call $doc.get(“header”,”DocDueDate”,”date”) will return the
contents of the DocDueDate formatted in the Finvoice date format
(YYYYMMDD).
The import specifications are used to specify the fields that are to be
populated in the target document, as well as the position of the desired data in
the XML document that is being processed. It is also possible to define various
types of conversions for a field. The conversions are defined in DocEngine.xml
and they are referred by name from the import specification.
17
Finvoice document received from the supplier as a purchase invoice into SAP
Business One.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Import>
<Import>
<header>
<Instruction>
<memberName>CardCode</memberName>
<memberDataType>string</memberDataType>
<xPath>SellerPartyDetails/SellerOrganisationTaxCode</xPath>
<conversion>Supplier_CardCode_from_TaxID</conversion>
<mandatory>true</mandatory>
</Instruction>
<Instruction>
<memberName>DocDueDate</memberName>
<memberDataType>date</memberDataType>
<xPath>InvoiceDetails/PaymentTermsDetails/InvoiceDueDate</xPath>
<mandatory>true</mandatory>
</Instruction>
</header>
<rows>
<rowPath>InvoiceRow</rowPath>
<Instruction>
<memberName>ItemCode</memberName>
<memberDataType>string</memberDataType>
<xPath>BuyerArticleIdentifier</xPath>
<mandatory>true</mandatory>
</Instruction>
<Instruction>
<memberName>Price</memberName>
<memberDataType>double</memberDataType>
<xPath>UnitPriceAmount</xPath>
<mandatory>true</mandatory>
</Instruction>
<Instruction>
<memberName>Quantity</memberName>
<memberDataType>int</memberDataType>
<xPath>DeliveredQuantity</xPath>
<mandatory>true</mandatory>
</Instruction>
<Instruction>
<memberName>VatGroup</memberName>
<memberDataType>string</memberDataType>
<xPath>RowVatRatePercent</xPath>
<conversion>AP_taxcode</conversion>
<mandatory>false</mandatory>
</Instruction>
</rows>
</Import>
Sample import specification
18
7 Troubleshooting
If you have trouble with processing documents and the error messages
provided by the user interface do not give you enough information to solve the
problem, the first thing to do is to check the log file. Each time DocEngine is
started (or reinitialized in interactive mode), a new log file is created. These
log files are stored in the folder “\etc\DocEngine\logs”. The name of each log
file is determined by the time when the application was started. For instance,
if the application is started on January 12, 2005 at 09:38:59.11 (the last two
digits being the 1/100ths of a second), the name of the file will be
“docengine_log_2005011209385911.log”. With the default settings, the log
will contain only minimal information about successful operations plus more
detailed information about critical errors. However, DocEngine can be set to
operate in “debug” mode and to write a more detailed log (please see the
troubleshooting chapter for more details about this). This is helpful in tracing
the causes of possible trouble scenarios.
When using the batch mode, the only way to see these logs is to go into the
log folder and open the log files one by one in a text editor of choice. In the
interactive mode, logs can viewed directly from the DocEngine user interface.
Simply click the “log files” button and a log selection window will open. This
window displays by default a list of all log files from the current day, with the
latest (recent) log file pre-selected. If you wish to view log files for another
day, just select a different date in the date selection field located on the top of
the log list.
To view the selected log, click the “Display” button. This will open another
form that displays the contents of the log file. You can leave this window open
in the background while running exports and imports. By clicking the
“Refresh” button, you will see the most recent changes in the log file.
19
7.2 Changing the logging level
You can change the logging level by setting the loglevel value in
DocEngine.xml. The relevant values are “INFO”, “DEBUG”, “WARN” and
“ERROR”. For instance, the “ERROR” log level will only make a minimal log
that records actual error situations. “DEBUG”, on the other hand, makes a
detailed log about all the operations done during the session.
There are some obscure DI API error messages you might encounter in the
login process. Many possible error situations return a reasonable error
message that clearly points out the source of the error. However, there are
also some exceptional cases where the error message returned from the DI
API is less informative.
20
8 Suggested Readings
http://jakarta.apache.org/velocity/vtl-reference-guide.html
http://www.developer.com/net/net/article.php/3383961
For more information about the Finvoice standard and ebXML, please
see the following websites:
http://www.fba.fi/finvoice/
http://www.ebxml.org
21
Appendix A – the Apache Software License
22