Universal Function File Importer (UFFI)

Previous  Next |  Direct link to this topic

NB: Your SAP Partner need to have a “SAP Business One Software Development Kit” license from SAP to be allowed to use this feature. Read more here

WARNING: PLEASE BE AWARE THAT ALL SUPPORT FOR UFFI IN REGARDS TO CODE ARE CONSIDERED PREMIUM (PAID) SUPPORT BY BOYUM IT A/S.

With UFFI developers are able to import data from any file format using C#.

You can launch UFFI as a normal universal function or you can run it on a schedule.

image479

UFFI is designed to handle all the time consuming and error prone boiler code that needs to control files (move to archive, error folder etc.) and make sure that folders are writable etc.

With this done the developer can concentrate on handling the import logic and return a status based on how the import went. The status returned by the code will be used to determine if the file should go to the success or the error folder. You have access the normal SAP DI SDK and you can add new references using the editor.

Field

Description

C# to run

This is the C# code that UFFI will execute. By default, it comes with a predefined template on. You can click the “…” button to open the code in an external viewer.

Work folder

Where are the files stored that UFFI should work with.

Success folder

The folder to move files to if successfully imported.

Error folder

The folder to move files to upon errors

Log folder

Where the log file is created.

File filter

Here you can specify a C# file filter and is used to determine what files UFFI should try to work with.

The file filter is a standard .NET filter: http://msdn.microsoft.com/en-us/library/ms143327.aspx

In the C# code you are will be able to get the full path of the file you are to work with using parameters.File you are then expected to work with the file and return a FileHandlerResultEntry where you specify if it were a success or an error. The FileHandleResultEntry have multiple overloads where you can also include messages and exceptions. If running on a schedule you will get the exception + message in the error email.

Accessing company objects:



DI company object

SBO.DI.Connection.SboCompany

SAP recordset

SAPbobsCOM.Recordset oRecordSet = (SAPbobsCOM.Recordset) SBO.DI.Connection.SboCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);