baan erp · ole with baan erp user manual iii this document provides the following information...
TRANSCRIPT
BAAN ERPOLE with BAAN ERP User Manual
A publication of:
Baan Development B.V.P.O.Box 1433770 AC BarneveldThe Netherlands
Printed in the Netherlands
© Baan Development B.V. 1998.All rights reserved.
The information in this documentis subject to change withoutnotice. No part of this documentmay be reproduced, stored ortransmitted in any form or by anymeans, electronic or mechanical,for any purpose, without theexpress written permission ofBaan Development B.V.
Baan Development B.V.assumes no liability for anydamages incurred, directly orindirectly, from any errors,omissions or discrepanciesbetween the software and theinformation contained in thisdocument.
Document Information
Code: U7027A USGroup: User DocumentationEdition: ADate: March 1998
i
OLE with BAAN ERP User Manual
1 Introduction 1-1Definitions, acronyms, and abbreviations 1-1Overview 1-2
2 OLE installation 2-1Introduction 2-1Installing BAAN OLE 2-1Install Excel .xls and .xla files 2-1To reference Baan.xla 2-1
3 Using OLE with BAAN ERP 3-1Application worksheet controls 3-1Implementation guidelines 3-2Getting started 3-5All applications 3-5MPS forecasts 3-5Financial budgets 3-6Sales budgets 3-6
4 Worksheets 4-1Introduction 4-1InputSpecs worksheet 4-2BaanOle module sheets 4-3BAAN button subroutine 4-3Build worksheet subroutine 4-5Input specification worksheet 4-6Error worksheet 4-7
5 Technical information 5-1Baan.xls worksheet subroutines 5-1StartProcess 5-1EndProcess 5-1PrintReport 5-2Errorsheetsub 5-2PrinterrorinExcel 5-2Printtotals 5-3Processallrecords 5-3CreateRecord 5-4
Table of contents
Table of contents
OLE with BAAN ERP User Manual
ii
ConnectBaan 5-4DisconnectBaan 5-4SendtoBaan 5-5ValidateRanges 5-5Checkinputspec 5-6BuildWorksheet 5-6Baan.xls worksheet functions 5-7Getarg 5-7Getlastarg 5-7CvtString 5-7Colnumtoletter 5-7
OLE with BAAN ERP User Manual
iii
This document provides the following information about the OLE withBAAN ERP product:
n Chapter 1 includes basic introductory information, a list of definitions,acronyms, and abbreviations used in this document, and an overview of OLEwith BAAN ERP.
n Chapter 2 provides an installation procedure.
n Chapter 3 explains how to use OLE with BAAN ERP to upload Excel datainto a BAAN application.
n Chapter 4 provides basic information about the content and purpose ofworksheets.
n Chapter 5 provides technical information about worksheet subroutines andfunctions.
About this document
About this document
OLE with BAAN ERP User Manual
iv
OLE with BAAN ERP User Manual
1-1
The OLE tool allows you to transfer data between BAAN applications and Excelworksheets. You can use the OLE module in the BAAN Utilities package tocontrol and report on OLE functions. You can import OLE data into thefollowing BAAN functions:
n Financial Budgetsn Sales Budgetsn MPS Forecasts
Sample spreadsheets for these functions are provided as Excel worksheets. Youcan maintain and manipulate data in these worksheets and then upload the datainto a BAAN application.
Definitions, acronyms, and abbreviationsExcelMicrosoft’s OLE-compliant PC spreadsheet product.
Excel worksheetAn individual page of an Excel workbook (spreadsheet) that contains data orprogramming logic. Worksheets are used in the transfer of OLE data to BAANapplications.
Input specification sheetA worksheet in Excel that contains the specifications to build an applicationworksheet. This sheet contains the appropriate name settings for columns, rows,and ranges. The input specification sheet provides mapping from Excel fields toBAAN application fields and can be customized to meet specific datarequirements.
OLEAn object-oriented technology designed for creating, arranging, and accessingobject-based components across process boundaries and machine boundaries.
UploadData transferred from one system to another by means of an automated process.
VBA (Visual Basic for Applications)Microsoft’s subset of the Visual Basic programming language that is used forExcel.
1 Introduction
Introduction
OLE with BAAN ERP User Manual
1-2
OverviewThe implementation and use of OLE with BAAN ERP requires MicrosoftWindows 95 or higher or Windows NT. The BW driver is the connection forOLE with BAAN ERP. In addition, you must have Microsoft Excel loaded.
OLE with BAAN ERP allows you to maintain budget data and forecast data onyour PC and use this data to update the appropriate BAAN application. Theapplication areas include:
n Financial Budgets: you can upload budget data to add new data or replaceexisting information.
n Sales Budgets: you can upload sales budget data to add new data or replaceexisting information.
n MPS Forecasts: you can upload MPS forecast data to add or replaceinformation for an existing MPS plan. You cannot create a new plan using theupload function.
Download capabilities exist with information being returned from BAAN ascodes, messages, and error reporting. However, you cannot download existingBAAN application records into Excel.
To perform error reporting in the BAAN application, you must use a reportwindow. You can also send the error report back to Excel where it is stored in aworksheet called ERROR, or you can print the error report with a print session.
To start the update process, use a job scheduling function.
OLE with BAAN ERP User Manual
2-1
IntroductionThis chapter describes the procedure used to install OLE with BAAN ERP.
The prerequisites for installation are:
n The BW driver must be installed; see the BW Installation Guide for details.n Microsoft Excel must be installed.n The files from the $BSE/BaanOle/* directory must be installed.
Installing BAAN OLEThe following example uses the MPS Forecast workbook. You can also initiatethe procedure from the Financial Budget workbook or the Sales Budgetworkbook. After you have referenced the Baan.xla file, you do not need to repeatthe procedure.
Install Excel .xls and .xla files
Place the following files in the Excel directory:
n FINBUDG.xls: Financial Budgets workbookn MPSOLE.xls: MPS Forecast workbookn SLSBUDG.xls: Sales Budget workbookn Baan.xla: BAAN subroutines that work with the application workbooksn Baan.xls: Source code for Baan.xla
To reference Baan.xla
1 Launch Excel.
2 Click Open on the File menu.
3 Open the MPSOLE.xls workbook.
4 Click the BaanOle worksheet tab.
2 OLE installation
OLE installation
OLE with BAAN ERP User Manual
2-2
5 Click References on the Tools menu (as displayed in Figure 2-1 below).
Figure 2-1, Tools menu in BaanOle worksheet
OLE installation
OLE with BAAN ERP User Manual
2-3
6 When the References dialog box shown in Figure 2-2 appears, scroll to findBaan.xla and select it. If you cannot find Baan.xla, click the Browse button tosearch your drive(s).
Figure 2-2, Reference dialog box
OLE installation
OLE with BAAN ERP User Manual
2-4
7 When the Add Reference dialog box shown in Figure 2-3 appears, choose theBAAN icon with the small red identifier. This icon represents the Baan.xlafile. Click Open.
Figure 2-3, Add reference dialog box
OLE installation
OLE with BAAN ERP User Manual
2-5
8 When the References dialog box shown in Figure 2-4 appears, you will seethat Baan.xla is checked. Click OK.
Figure 2-4, Reference dialog box
9 Click Save on the File menu.
The installation is complete.
OLE installation
OLE with BAAN ERP User Manual
2-6
OLE with BAAN ERP User Manual
3-1
This chapter explains how to use the application worksheets to upload data toBAAN applications with the MPS Forecast workbook as an example. Theinformation is also relevant for the Financial Budget and Sales Budgetworkbooks.
Application worksheet controlsFigure 3-1 shows an example of the MPS worksheet in the MPSOLE.xls file.Before learning how to use the worksheet, you need to understand how thebuttons work.
Figure 3-1, MPS forecast worksheet
BAAN buttonClick this button to start the upload/download process to the BAAN application.
3 Using OLE with BAAN ERP
Using OLE with BAAN ERP
OLE with BAAN ERP User Manual
3-2
Build Worksheet buttonClick this button to build the Excel worksheet with the Input Specification sheet.When completed, the worksheet displays all field names, and name ranges arebuilt for columns and rows.
Print Error Option buttonsClick BAAN to print error information from the BAAN application.
Click Excel to print error information on the Excel ERROR worksheet.
Implementation guidelinesUse the following instructions to build an MPS worksheet and upload data intoan MPS plan.
1 Open the MPSOLE.xls workbook.
2 Click the MPS worksheet tab. The MPS Forecast Worksheet appears (seeFigure 3-2).
3 Click the Build Worksheet button. The worksheet should now containcolumn heading 2 (see Figure 3-3).
Figure 3-2, MPS forecast worksheet - example 1
Using OLE with BAAN ERP
OLE with BAAN ERP User Manual
3-3
Figure 3-3 MPS forecast worksheet - example 2
Notice that although the worksheet has been protected, the cells below theheadings are available for entry. Columns and rows cannot be inserted.
You can enter data into the appropriate rows or columns, or copy and paste datafrom other workbooks.
Refer to Figure 3-4.
Using OLE with BAAN ERP
OLE with BAAN ERP User Manual
3-4
In the MPS Forecast Worksheet (see Figure 3-4) you must highlight theworksheet area that contains the multiple-occurring fields before you click theBAAN button. An example of a multiple-recurring field is MPS Period. SeeChapter 4, Worksheets, for an explanation of multiple occurring fields.
Figure 3-4 MPS forecast worksheet - example 3
When you click the BAAN button, the highlighted area (shown in Figure 3-4)will be uploaded to the BAAN application along with the other information incolumns A, B, C, D, and rows 9 through 11.
Using OLE with BAAN ERP
OLE with BAAN ERP User Manual
3-5
Getting startedThis section provides some additional information for using OLE withBAAN ERP.
All applications
Use the following steps to upload data into BAAN applications:
1 If the InputSpecs have changed, click Build Worksheets to make or modifythe InputSpecs worksheet (see Chapter 4, Worksheets).
2 Determine if the results on the spreadsheet are correct.
3 If the results are not correct, modify the InputSpecs worksheet (see Chapter 4,Worksheets), and rerun the Build Worksheets process.
4 Type or copy data into the worksheet.
5 Select a print error option by clicking the Excel or BAAN option button.
6 Click the BAAN button to start the upload process.
MPS forecasts
The following fields are included in the MPS Forecast worksheet:
MPS Forecasts Worksheet
Field Description
ADDREPLACE Add or replace forecast
SCENARIO Used as part of the key
PLANLEVEL Used as part of the key
PLANITEM Used as part of the key
PERIOD Used as part of the key
FORECAST The forecast amount
The InputSpecs worksheet is delivered with values in the Period, Start Value andIncrement columns. You need to change these values before uploading data toBAAN. See Chapter 4, Worksheets, for instructions on making modifications tothe InputSpecs worksheet.
Only existing MPS forecasts can be added to or replaced.NOTE:
Using OLE with BAAN ERP
OLE with BAAN ERP User Manual
3-6
Financial budgets
The following fields are included in the Finance Budgets worksheet:
Finance Budget Worksheet
Field Description
Company Number Used as part of the budget key
Budget Number Used as part of the budget key
Year Used as part of the budget key
Account Number Account number
Dimension 1 - 5 Account dimension
Quantity 1 - 2 Quantity amount for budget
Period 1 - 12 Budget amounts per period; 12 is not alimitation on the number of periods
Depending on a company’s business, the Budget Periods can be different thanthose supplied with the InputSpecs worksheet. Follow the instructions in Section4.4, Input specification worksheet, for modifying the InputSpecs worksheet.
The upload process will add new budget information or replace existing budgetinformation.
Sales budgets
There are five worksheets in the Sales Budgets workbook:
Sales Budget Worksheets
Field Description
Qty Quantities
AltQty Alternate quantities
AmtProfit Profit amounts
AmtDiscount Discount amounts
AmtTurnover Turnover amounts
NOTE:
Using OLE with BAAN ERP
OLE with BAAN ERP User Manual
3-7
The following fields are included on the Sales Budget worksheets:
Sales Budget Worksheets
Field Description
ADDINSERT Add or insert
Sort Code Used as part of the sales budget key
Year Used as part of the sales budget key
Period Used as part of the sales budget key
Sales Rep An employee number
Area Sales area
Line of Business Line of business
Item Group Item group
Quantities Quantities for budgets
Alternate Quantities Alternative quantities for budgets
Turnover Amounts Turnover amounts
Discount Amounts Discount amounts
Profit Amounts Profit amounts
All the fixed parts of the record are entered in the Qty worksheet.
All the variable parts of the record are entered on all the worksheets.
NOTE:
Using OLE with BAAN ERP
OLE with BAAN ERP User Manual
3-8
OLE with BAAN ERP User Manual
4-1
IntroductionThis chapter describes the Excel worksheets supplied with OLE withBAAN ERP.
These worksheets include:
Excel Worksheets
Worksheet Description
InputSpecs Contains the input specifications to build anapplication worksheet with various data.
ERROR Contains error information about the field value,column, row, and error message as well as printedstatistics for the read, processed, and rejectedrecords.
BaanOle A module sheet that contains the VBA code that runsthe specific application and the Build Worksheetprocess.
Application-specific Contains all the fields and buttons necessary to run anOLE with BAAN ERP application.
4 Worksheets
Worksheets
OLE with BAAN ERP User Manual
4-2
InputSpecs worksheetThe following table provides the cell name, cell description, and valid values forthe InputSpecs worksheet:
Input Specs Worksheet
Cell Name Cell Description Valid Values
WorksheetName
The name of the worksheet in a workbook.The actual worksheet must exist in theworkbook. User defined.
NameRanges
The name used to map Excel information toBAAN information and to identify the fieldname on the ERROR worksheet. Userdefined.
Cannot be empty
Column The column number of name range. Can beput anywhere on the worksheet. User defined.
Numeric only
Row The row number where an additional field canbe used as input. Use with type OR.
Numeric or empty
RecSequence
The position in the record that is sent toBAAN. This position must not be changedbecause record positions are used by theBAAN DLLs. Because the first three recordpositions are used internally in BAAN, the firstrecord sequence must be 4.
Numeric only;cannot be 1, 2, or 3
Type There are three field types: static fields on arecord, multiple occurring fields, and fields thatare on other rows.
If static, the value is a space, or the field canbe left empty.
Empty (or space):static field
If multiple, the value is OC. OC: multipleoccurrences
The value for fields on other rows is OR. OR: On anotherrow
Number ofOccurs
A multiple occurring field must have a numbergreater than 1 to indicate the number ofperiods that occur.
A field on another row (OR) that is related to amultiple occurrence field (OC) will have anumber of occurrences.
Numeric or empty
Worksheets
OLE with BAAN ERP User Manual
4-3
Start Value The value used for a date value that is usedwith a number of occurrences.
Empty or valid date
FillDate The information in this cell identifies whetherthe date is a day, week, or month. This date istaken from Excel Fill/Series/Date and formatsall columns based on the number ofoccurrences with a date value.
Empty orday/month/year
Increment The value that is added to the start value. Numeric or empty
BaanOle module sheets
BAAN button subroutine
DownLoadtoBaan is the main subroutine included in all BaanOle module sheets.This subroutine controls the processes of assembling the records, running theBAAN application, sending the data to the application, and printing errorinformation.
Use the following Excel parameters to pass various data to the varioussubroutines. See Chapter 5, Technical information, for a list of the Baan.xlsworksheet subroutines.
n worksheetname is the name of the main worksheet if there is more than one.
n dllname is the actual DLL name that you must use for the specific BAANapplication.
n dllfname (function name) is the actual function with the DLL in BAAN.
Worksheets
OLE with BAAN ERP User Manual
4-4
Figure 4-1 shows the BaanOle module sheet for the MPS Forecasts workbookand the DownLoadtoBaan subroutine.
Figure 4-1, DownLoadtoBaan subroutine
Worksheets
OLE with BAAN ERP User Manual
4-5
Build worksheet subroutine
The subroutine included in all BaanOle module sheets is called BuildWks. Thissubroutine controls the building of all the names of the worksheet and alsosupplies formatted dates.
Use the following Excel parameters to pass various data:
n Worksheet name is the name of the main worksheet if there is more than one.n Row number is the starting row number where the heading will be placed.
Figure 4-2 shows the BuildWks subroutine on the BaanOle module sheet.
Figure 4-2, BuildWks subroutine
Worksheets
OLE with BAAN ERP User Manual
4-6
Input specification worksheetReview the InputSpec worksheet to determine if all necessary fields arerepresented.
Figure 4-3 shows the InputSpecs worksheet from the MPSOLE.xls workbook.
Figure 4-3, InputSpecs worksheet
If the values for Forecast and Period in the Number of Occurs column aredifferent, make any change necessary to ensure that these fields match. Thesevalues must be exactly the same.
If the values for Start Value, FillDate, Increment, and Edit Rule are inconsistent,change these values as well.
If anything is changed on the InputSpec worksheet, you must rebuild the MPSworksheet by clicking the Build Worksheet button on the MPS worksheet.
NOTE:
Worksheets
OLE with BAAN ERP User Manual
4-7
Error worksheetThe following table describes the information available on the ERRORworksheet.
ERROR Worksheet
Data Description
Field name Value from the Name Ranges from the InputSpecsworksheet
Field value Value from the cell
Column Actual column letter for the field value
Row Actual row number for the field value
Error Message Error message from BAAN application
Batch Number System-generated number; format isYYMMDDHHMMSS
Excel Record Information
Data Description
Records Sent Number of records sent to BAAN. A recordconsists of all fixed portions of a row and one ormore variable positions.
Records Processed Number of records that were accepted
Records Rejected Number of records that were rejected
Worksheets
OLE with BAAN ERP User Manual
4-8
Figure 4-4 is an example of the ERROR worksheet.
Figure 4-4, ERROR worksheet
OLE with BAAN ERP User Manual
5-1
This chapter contains technical information about the Baan.xls worksheetsubroutines and functions.
Baan.xls worksheet subroutines
StartProcess
DescriptionThis subroutine initializes record counters, establishes the batch number,validates the InputSpecs with the name ranges, establishes the connection toBAAN, and selects all the cells that are highlighted. The print in Excel or BAANis also determined.
Excel parametersWorksheet name is taken from the BaanOle module sheet.
Subroutines calledValidateRanges, ConnectBaan
Functions calledNone
EndProcess
DescriptionThis subroutine starts the print report subroutine and displays a message thatindicates the batch number and number of records sent.
Excel parametersNone
Subroutines calledPrintReport
Functions calledNone
5 Technical information
Technical information
OLE with BAAN ERP User Manual
5-2
PrintReport
DescriptionThis subroutine determines if the report will print in BAAN or Excel based onthe option buttons on the application worksheet. This subroutine will start theprint DLL in BAAN and send a variable to print in BAAN or Excel. If theprinting is performed in Excel, a repetitive routine is run in Excel to get all theerror records from BAAN. PrinterrorinExcel is run after the record has beenreturned from BAAN with the error information. After all the error records havebeen retrieved, Printtotals is run.
Excel parametersNone
Subroutines calledSendtoBaan, PrinterrorinExcel, Printtotals
Functions calledGetarg, Getlastarg
Errorsheetsub
DescriptionThis subroutine creates information on the ERROR worksheet. If the ERRORworksheet does not exist, it will be created. In addition, heading information isformatted.
Excel parametersNone
Subroutines calledNone
Functions calledNone
PrinterrorinExcel
DescriptionThis subroutine displays error information. The error information is obtainedfrom BAAN as the last argument. Use the getarg function to retrieve the fieldname, field value, field row, field column, and error message.
Excel parametersNone
Technical information
OLE with BAAN ERP User Manual
5-3
Subroutines calledNone
Functions calledGetarg
Printtotals
DescriptionThis subroutine displays read, processed, and rejected BAAN records. Thissubroutine also displays sent, processed, and rejected Excel records. Use thegetarg function to retrieve the read, processed, and rejected BAAN records. Theread, processed, and rejected Excel records are variables that are local to Excel.
Excel parametersNone
Subroutines calledNone
Functions calledNone
Processallrecords
DescriptionThis subroutine is where the records are assembled according to the mappingfrom the InputSpecs worksheets with the Column, Rec Sequence, and Type. Thecell value, column name (letter), and name range are combined with a pipe [ | ]delimiter into one field.
For example:
DLLFNAME(“1996|C|FINBUDYEAR”)
An array is used to store the information, which creates the record sent to BAAN.The two arrays used in this processing have been created in the ValidateRangessubroutine. The first array is used to build the fixed part and the variable part ofthe record. If there are entries in the second array, those will be processed aswell. Once the array has been filled, the record is created and sent to BAAN. Seesection ValidateRanges for additional information about arrays.
Excel parametersNone
Subroutines calledCreateRecord, SendtoBaan
Technical information
OLE with BAAN ERP User Manual
5-4
Functions calledColnumtoletter
CreateRecord
DescriptionThis subroutine formats the record from the array. The format of the record isDLLFUNCTION(“FLD1VALUE|FLD1COLUMNNO|FLD1NAME”).
Excel parametersNone
Subroutines calledNone
Functions calledNone
ConnectBaan
DescriptionThis subroutine establishes the connection to BAAN. Baan4.Application is thename that must be used because it is used in the BW registry file.
Excel parametersNone
Subroutines calledNone
Functions calledNone
DisconnectBaan
DescriptionThis subroutine disconnects the BAAN application.
Excel parametersNone
Subroutines calledNone
Functions calledNone
Technical information
OLE with BAAN ERP User Manual
5-5
SendtoBaan
DescriptionThis subroutine uploads records to BAAN. The dllname and the dllfunction,which contains the parameters (see CreateRecord for the format), are sent toBAAN. Return error codes are checked. If the return error code is normal, therecords read counter is incremented by 1. A return value is also checked for trueor false. True means the record was successfully processed whereas false meansthat an error was found in the record.
Excel parametersNone
Subroutines calledNone
Functions calledNone
ValidateRanges
DescriptionThis subroutine validates the InputSpecs worksheet and the name ranges fromthe application worksheets and builds the arrays necessary for Processallrecords.If there is a validation error, a message listing the error is sent to the user.
Two arrays are created. One array is for the field types: empty and multipleoccurrences (see section 4.2, InputSpecs worksheet). This array contains thename ranges and record sequence information from the InputSpecs worksheet.The index for this array is column name (letter).
The second array is for additional rows (type OR) that are needed for the records.This array contains the worksheet name, name ranges, column, row, and recordsequence from the InputSpecs worksheet. There is no specific index because thearray is incremented by 1. The array includes a variable that contains the numberof entries that are based on the number of occurrences.
Excel parametersDllname, Dllfunction
Subroutines calledCheckinputspec
Functions calledNone
Technical information
OLE with BAAN ERP User Manual
5-6
Checkinputspec
DescriptionThis subroutine validates the InputSpecs worksheet. See section 4.4, Inputspecification worksheet, for the parameters and valid values for InputSpecs. Amessage will appear if an error is detected.
Errors must be corrected before they can be processed again.
Excel parametersNone
Subroutines calledNone
Functions calledNone
BuildWorksheet
DescriptionThis subroutine will first validate all the fields on the InputSpecs worksheet byrunning Checkinputspec. If all the fields are valid, this subroutine will place thenames from Name Range into the appropriate worksheets and create the NameRanges for each column/row. In addition, this subroutine will format the multipleoccurring fields by appending a number incremented by 1 at the end. If datesmust be used, use the start value, fill date, increment, and format date. Use thefill series with the date option in Excel to complete this process.
Excel parametersWorksheet name
Subroutines calledNone
Functions calledColnumtoletter
NOTE:
Technical information
OLE with BAAN ERP User Manual
5-7
Baan.xls worksheet functions
Getarg
DescriptionThis subroutine will get specific data from within a field delimited by a pipe [ | ].This subroutine is used to get information returned by BAAN when the ERRORworksheet is being created. This information is stored at the end of an array.Field name is the variable that contains all the fields. Field number is thesequential position in the variable that needs to be extracted. The content of thefield is returned by the function.
Excel parametersField name, Field number
Getlastarg
DescriptionThis subroutine will receive the last field of a variable. This subroutine isspecifically used for the returned information from BAAN for error reporting inExcel. The content of the field is returned by the function.
Excel parametersField name
CvtString
DescriptionThis subroutine will place quotes around a string field.
Excel parametersString field
Colnumtoletter
DescriptionThis subroutine will convert a column number into a column letter.
Excel parametersA numeric field
Technical information
OLE with BAAN ERP User Manual
5-8