Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
YatseaLi
Product and Topic Expert
Product and Topic Expert
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? ADO.net 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”
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 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
























SQL Server SAP HANA
Stored Procedure Procedure
View View or HANA Model
Function Procedure


Step 6: Recompile and test the Add-On solution
5 Comments