Skip to Content
Author's profile photo Yatsea Li

Migrating Add-Ons of SAP Business One from SQL Server to SAP HANA

Updated on Apr 27 2018:

This document aims to guide you through how to migrate Add-On of SAP Business One from SQL to SAP HANA, which is part of Cookbook of migrating SAP Business One from SQL Server to SAP HANA as step 10.

How can one migrate the Add-On of SAP Business One from SQL Server to SAP HANA?

The Software Development Kit (SDK) of SAP Business One, version for SAP HANA remains the same as SQLServer version. DI API and UI API are still based on COM technology. Calling SDK objects is still done in the same way.

1.Analyze the Add-On with the checklist below

Check list Comments
Does your 3rd party solution store data in external DB or direct SQL tables in B1 company schema rather than UDT/UDF of B1 company schema? From legal contract standing point, for B1A/B1H customers, SAP HANA is only allowed to be used for data storage of B1 solution, including B1 company schema. The Add-On with external schema instead of UDT/UDF in B1 schema must be certified by SAP to use SAP HANA as database engine.
Does your Add-On have direct access to the B1 company with ODBC/JDBC? SAP HANA supports ODBC and JDBC connection.
Does your 3rd party solution use such as ADO.Net, LINQ or MS Entity framework etc. instead of SDK for data access? is supported since HANA 1.0 SP08, however, LINQ and MS EF etc are supported by SAP HANA since HANA 1.0 SP10. 
Does your Add-On solution use direct SQL query?
1).DataTable.ExecuteQuery() in UI API
2).RecordSet.DoQuery() in DI API3).ExecuteSQL command in DI Server4).sqlCall, executesql etc in B1if/B1iSN

5).Any other direct SQL query

Due to the syntax difference between SQL query in SQL Server and SAP HANA, these queries in your Add-On solution need to be migrated. See the section about Migrating the SQL query related customization in SAP Business One.
Does your Add-On use any native SQL Server object or functions? Like view, procedure, change tracking etc Need to migrate Stored Procedure into HANA procedure, SQL View to HANA table view or Models etc.

2.Migrate the Add-On
Step 1: Replace the SDK reference with the one of SAP Business One, version for SAP HANA
-For the DI connection, follow the changes below:

Company.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_HANADB
Company.Server = “<hana_server>:<port>”           e.g. “hanab1:30015”
DbUserName = “<HANA_DB_User>”   e.g. “SYSTEM”

Step 2: [if applicable] Migrate the direct ODBC/JDBC connection identified by question#2 of the checklist
Sample code:

Imports System.Data.Common

Dim _DbProviderFactoryObject As DbProviderFactory = DbProviderFactories.GetFactory(“System.Data.Odbc”)
Dim conn As DbConnection = _DbProviderFactoryObject.CreateConnection()
conn.ConnectionString = “DRIVER={HDBODBC32};UID=SYSTEM;PWD=xxx;SERVERNODE=frncel14:30015;CS=SBODEMOUS”


Step 3: [If applicable] Migrate the code for Linq, MicroSoft Entity Framework on SAP HANA identified by question#3 of the checklist

Please refer to the following official HANA document for details.

Step 4: [If applicable] Migrate the direct SQL Query identified by question#4 of the checklist

Option 1: [Recommended] Use a .NET resource file to store the queries for each one of the database types your add-ons supports.
a).Very clean code, no if/else conditions.
b).Easy to maintain all queries in a single location.

Option 2: Keep the strings in the code for the different database types. Needs extra care to organize the code and set the right query.

In cases of Dynamic SQL generation, you need to efine some kind of generic objects in order to be able to share the same code for all database types.

Step 5: [If applicable] Migrate the SQL Server native objects or function into SAP HANA identified by question#5 of the checklist

Stored Procedure Procedure
View View or HANA Model
Function Procedure

Step 6: Recompile and test the Add-On solution

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Kennedy T
      Kennedy T

      Dear Yatsea Li

      Really helpful thanks alot 🙂



      Author's profile photo Bruno Abel Minalez
      Bruno Abel Minalez

      Thank you Yatsea

      I just had one problem. We are using here a direct connection. Following the Step 2, I managed to connect via ODBC using .NET OdbcConnection. The problem is when I try to do a Query, the following error pops up for this Query: " Select "Name" from "@SIEBS_CRPT" "

      "ERROR [42S02] [SAP AG][LIBODBCHDB32 DLL][HDB] Base table or view not found;259 invalid table name:  Could not find table/view @SIEBS_CRPT in schema SYSTEM: line 1 col 85 (at pos 8 Fonte: libodbcHDB32.dll Pilha: em System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)"

      It seems to me that the schema qualifier is not being included into the query automatically, so SYSTEM is used as default schema.

      I think the property DATABASE of the connection string should take care of this problem, as Initial Catalog does for SqlConnection on .NET. Am I wrong?

      The same query succeds on HANA Studio, where I can see at the header of the SQL Console that the schema is set like this Current Schema: DATABASENAME


      Bruno Milanez

      Author's profile photo Yatsea Li
      Yatsea Li
      Blog Post Author

      Hi Bruno,

      The connection string has been changed since some revision. Please try below:


      Kind Regard, yatsea

      Author's profile photo Bruno Abel Minalez
      Bruno Abel Minalez


      Author's profile photo Alvaro Gonzalez
      Alvaro Gonzalez


      Where I can find the SDK Help version B1H to install in my developer PC?

      Thanks Alvaro