Skip to Content

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.  Please refer to the Add-On migration topic in TechSubmmit below for details:

SAP Business One HANA TechSummit 2013

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?

(new) ADO.net is supported since HANA SP08, however, LINQ and MS EF etc are still not supported by SAP HANA. You need to replace the data access part with SDK or direct ODBC/JDBC connection to SAP HANA.

Does your Add-On solution use direct SQL query?
1).DataTable.ExecuteQuery() in UI API

2).RecordSet.DoQuery() in DI API

3).ExecuteSQL command in DI Server

4).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”
Company.
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: http://scn.sap.com/docs/DOC-33628

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”

conn.Open()                                                              

Step 3: [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 4: [If applicable] Migrate the SQL Server native objects or function into SAP HANA identified by question#5 of the checklist

SQL Server

SAP HANA

Stored Procedure

Procedure

View

View or HANA Model

Function

Procedure

Step 5: Recompile and test the Add-On solution

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Bruno Abel Milanez

    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

    Regards,

    Bruno Milanez

    (0) 
    1. Yatsea Li Post author

      Hi Bruno,

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

      Dim connStr As String = “DRIVER={HDBODBC32};UID=SYSTEM;PWD=manager;SERVERNODE=10.68.230.185:30015;CS=SBODEMOUS”

      Kind Regard, yatsea

      (0) 

Leave a Reply