Keystroke File Import (KFI) is the main way to import data into Attaché. Other methods are quite restricted or relate to Payroll.
There are different types of KFI:
Standard (original).
Xml.
Variable Position.
Each has advantages and disadvantages. Variable Position KFI allows you to specify the format of the KFI file, that is, the fields in the Attaché screen that you want to edit. As a result, it may be easier to use this type of KFI to create an import file with the use of Excel. Mostly because when set up properly, you can copy and paste columns of data to a template spreadsheet which will create most of the KFI for you.
Let's say you've received a file containing an order from a customer for multiple branches. The customer has included branch address information in the file and wants the order to be delivered to the individual branches. The order detail has a branch code, product code, quantity, price, etc.
The setup process below will only need to be done once. Then refer to the Create the KFI file section. Using this method, you can create orders much faster than you could by manually entering them, especially if there are many lines per order. The process is mostly copy and paste.
Setup your templates
To setup templates follow the steps below:
Determine the type of data that you need to import:
Single Record - like a Customer Masterfile.
Header - Detail type record - like a Sales Order, Invoice, etc.
We know the file represents multiple customer orders, one for each branch, so we have a Header - Detail type import.
The format of the KFI is determined by the type of record as per Step 1:
Single: <HEADROW> field list <ENDHEADROW>.
Header - Detail: <HEADROW><header> field list <productline> field list <ENDHEADROW>.
To get a field list for any screen simply open the screen you want to import into, consider using Tools, ADI for transaction imports as these screens cannot be changed, click the KFI button or hold down CTRL and press F9 and then select Export F11.
Repeat Step 4 for both the Header and Detail sections if you have a Header - Detail type record to import.
Depending on the file supplied by your customer, it may be easier to enter the Customer's branches to Attaché first. Preferably the branches should be entered with the same branch code that the customer users because then the branch code from the customer's file will automatically pick up the delivery address stored in Attaché. Branches could be entered using KFI or manually as this is a one time setup procedure. Use Customers, Masterfiles, Delivery Addresses, Maintain and select the Customer Code.
Enter the delivery addresses with the Customer's address code as the Reference.
To build the KFI we need three lines, the KFI needs to look like the below example:
<Object_ID=821>
<HEADROW><header>customercode,deliveryaddresscode,ordernumber,date,<productline>productcode,qtyordered,price<ENDHEADROW>
<header>ABC,001,1001,23/05/2023<productline>TG56,10,50.60<productline>AT90,2,20.63
<header>ABC,002,1002,23/05/2023<productline>MV07,1,30.21<productline>AT92,6,102.74
As seen in the above example the KFI contains the following:
An Object ID that identifies the menu you want to use, in this case Tools, ADI, Orders.
The Header Row that specifies the order the data will be given in each data row.
Multiple KFI data rows that will be entered as orders.
Since the Object ID and Header Row are always the same, these can be stored in a Notepad template file.
The KFI data row can be built in Excel from the Customer's original file using a template spreadsheet.
Open a new Excel workbook. The first sheet in the workbook will be used to create each data row.
Below the data row list the columns in one row (row 5 in the screenshot below) that you need from the Customer's file, eg: deliveryaddress, ordernumber, date, productcode, etc.
Use an Excel formula to create the KFI data row similar to this:
Save the above template workbook.
Create the KFI file
Each time you receive an order file from the customer, create the KFI file as follows:
Filter the Customer's order spreadsheet for a branch and copy the columns you need to your template workbook.
Copy the KFI data line to the Notepad template file as per the example below.
Note that the KFI data line will include some left over "<productline>,," at the end, delete these so that the last character on the line is part of the price, as per the screenshot below.
Repeat the above process to create as many orders (KFI data lines) as you need.
Ensure you add a final carriage return so the cursor is on the next line, as pictured above.
When all orders have been added to the Notepad template file, select File, Save as.
Change the Save as type to All files (*.*).
Enter a File name like: "OrdersABCMay.kfi".
The ".kfi" extension is required, however the first part of the name should be meaningful to you.
To run the KFI go to the Tools, ADI, Orders screen (or screen you are using) and select the KFI button.
On the KFI window select the file and then select Start F5.
.If any errors are received look at the err file that will be saved in the same folder as the KFI file you are running. In this case delete any part of the order entered and start again from the Customer Code or other field that is the start of the entry screen.
📌Notes:
The date format added to the KFI will be exactly as you type the date into the screen. As a result, the forward slashes are not entered. The year will be either 2 or 4 digits as per your user preferences.
The price does not need to entered. If no price is entered the Attaché price is used.
Special Pricing may override the price entered.



