How to import data from SAP HANA to Magento 2

- E-Commerce, Magento 2, Our extensions

Magento 2 SAP HANA Data Import

Although we’ve already described the Magento 2 S/4HANA integration, it is necessary to pay separate attention to a situation when you don’t need to connect to the ERP system but should import data from SAP HANA to Magento 2. And there are two ways to achieve this goal. First of all, it is possible to implement universal practices that are suitable for all remote databases. At the same time, there is a solution that entirely automates the Magento 2 SAP HANA data import.

The Common Way of Moving SAP HANA Bases into Magento 2

The first approach consists of three different phases. The first one requires exporting a CSV file with the desired data from SAP HANA. And you can create output just in this format since it is the only file type supported by Magento. Next, it is necessary to edit the data file manually. Thus, you will prevent problems that may be caused by different attribute standards. In the corresponding section, we describe these issues in more detail. Finally, you can import the data file into Magento 2 updating your database.  Let’s take a look at each stage separately.

CSV Export from SAP HANA Database

Data export from SAP HANA is relatively simple. You don’t need to learn any code and apply commands in CLI. Instead, it is necessary to pass a few steps in an intuitive interface.

First of all, you should choose “Export” from “FILE” or “Quick Launch”. Alternatively, it is possible to go right to the desired table and select “Export” from the context menu.

Now, you should choose the format. The CSV option is available in a dropdown on a corresponding screen. When the format is specified, select the file destination and start the export process. That’s it! Now, you have a CSV file with the desired data. Watch the following video for further information:

Map Third-Party Attributes to Magento 2 Attributes

Now, you have to prevent multiple issues that may occur during the import process. Since different systems use own attributes to order data, it is not possible to establish a direct connection between them without applying changes. You need to edit the data attributes of one platform to make them suitable for the requirements of another one. And Magento 2 is not an exception, so it is necessary to apply changes to data stored in the file from the previous step.

The process is time-consuming especially if you need to edit not only attributes but also their values. Luckily, there is a solution that reduces this entire step, but it is described further in this article.

So open your data file and start reviewing its content. If anything seems suspicious – change it. Check the following guide to discover native attributes of Magento 2 and other nuances of successful import: The Complete Guide to Magento 2 Product Import / Export.

Import SAP HANA Table into Magento 2

Now, when the data file is entirely suitable for the import process, you can move it into Magento 2. The platform offers tools necessary for running a one-time transfer successfully, but if you want to automate the procedure, they are absolutely useless. But the universal approach has nothing to do with the automation. Its only goal is to import data from a remote SAP HANA base into Magento 2. And we’ve just done that!

Pros & Cons

What are the pros and cons of the standard way of moving a remote table from SAP HANA to Magento 2?

Pros

The only positive aspect is the ability to move data from SAP HANA to Magento 2. Unfortunately, it is not the most natural routine, but nobody promised you that it would be a funny and straightforward task. What are the negative aspects?

Cons

  • You have to implement three separate steps bound to different environments.
  • It is impossible to automate any of them.
  • You should edit data files before import.
  • The process requires much time and effort.

There are enough reasons to look for a better option, so let’s discussed the promised one.  

The Easy Way of Moving SAP HANA Bases into Magento 2

Magento 2 mysql data import

As you might have already guessed, a better opportunity to move data from SAP HANA to Magento 2 is based on the use of third-party extensions. And the most robust one is the Improved Import & Export Magento 2 module.

SAP HANA Database Connection

Our extension lets you connect to a remote SAP HANA database directly. Thus, you eliminate the first two steps of the previous approach. Since no files are used, the data is transferred right from one system to another. But you will argue that the direct connection doesn’t solve the problem of different attribute standards. Luckily, there is a resolution.

Magento 2 SAP HANA Data Import

To make the data transfer process flawless, the Improved Import & Export Magento 2 extension allows you to match third-party attributes to ones used internally within just a few clicks. You can use either pre-made mapping presets or apply changes manually within the plugin’s intuitive interface. Both features are described below.

At the same time, the import process is dramatically improved due to several ways of automation. You can either create a cron schedule or select a trigger. We discuss both ways further in this article.

How to Import Data From SAP HANA to Magento 2

Now, let’s take a look at how to import data from SAP HANA to Magento 2 with the help of the Improved Import & Export extension. You need to pass the following steps:

  1. Go to Magento admin -> Improved Import & Export -> its import section and create a new job there.
  2. Specify where your database is situated, what attributes should be mapped, what schedule should be applied, and configure other options if necessary;
  3. Save and launch the profile.

That’s it! You’ve just connected your e-commerce store to a remote SAP HANA database. You must admit that this approach is much easier than the default one.

Pros & Cons

Let’s see what pros and cons the Improved Import & Export offers then it comes to the Magento 2 SAP HANA integration.

Pros

  1. SAP HANA to Magento 2 data transfers;
  2. The direct connection between the two systems:
    1. No data files are used;
    2. No need to create CSV output;
    3. No need to edit data files;
  3. All updates are automated entirely.

Cons

The only negative aspect is the necessity to install a third-party extension. If any difficulties occur, contact our support, and the Firebear team will help you. Furthermore, you can ask us about various nuances of the extension configuration as well as propose your specific changes to the module’s functionality.

Consequently, the necessity to install the Improved Import & Export Magento 2 extension is hard to call a drawback. Just compare the user-friendly algorithm with a community-proven one once again – you will find real drawbacks in the second one.

Now, let’s take a look at some features of SAP HANA and then proceed to a more in-depth exploration of Improved Import & Export.

Get Improved Import & Export Magento 2 Extension

SAP HANA Facts

Magento 2 SAP HANA Data Import

SAP HANA is often compared with Oracle, Microsoft SQL Server, and MongoDB. Being an in-memory, column-based data store, it is available as an appliance or cloud service. The primary database model of SAP HANA is a relational DBMS. At the same time, it is a document store and key-value store. Other facts and features regarding SAP HANA are gathered below:

  • The developer of the database is the SAP company;
  • The initial release of the project is dated back to 2010;
  • The current release is SPS12 Revision 120 dated back to 2016;
  • SAP HANA operates on a commercial license;
  • As mentioned above, the database is available as a cloud service;
  • Server operating systems are an appliance or cloud service;
  • The data scheme is provided;
  • Typing is supported with predefined data types as float or date;
  • XML support is represented partially;
  • Secondary indexes are available;
  • SQL is supported;
  • APIs and other access methods include JDBC and ODBC;
  • Server-side scripts are represented by SQLScript and R;
  • Triggers are available;
  • Both partitioning and replication methods are supported;
  • The database offers an API for user-defined Map/Reduce methods;
  • Consistency concepts are represented by Immediate Consistency;
  • Foreign keys are represented by referential integrity;
  • Transaction concepts are represented by ACID;
  • Concurrency, durability, in-memory capabilities, and user concepts are among provided features of SAP HANA.

Improved Import & Export Magento 2 Extension

Magento 2 oracle import

Now, when you understand the difference between the two approaches to moving SAP HANA bases into Magento 2, we can say a few more words about the features of Improved Import & Export that simplifies this process even more. Let’s begin our exploration of the automation.

Automated Import & Export Processes

The ability to let the extension control and run all data transfers significantly simplifies your daily routine. You only have to configure the corresponding import profile once, and Improved Import & Export will do everything for you. Our extensions offer two ways to automate data transfers: schedules and event-based triggers.

Schedules

The Improved Import & Export module supports cron allowing you to create any custom update schedule. It is only necessary to apply changes using the standard cron syntax. If you don’t want to do that, our plugin offers a list of predefined values. Furthermore, you can combine both approaches by selecting a predefined interval and customizing it according to the specific needs.

At the same time, the Improved Import & Export Magento 2 extension provides the ability to create import and export jobs that have no schedule. This approach can be applied to one-time data transfers or integrations that don’t have periodical updates.

And you can always launch every scheduled profile manually. The asynchronous mode will help you prevent situations than an important update is delayed provided after a schedule. With the Improved Import & Export Magento 2 extension, you can launch every scheduled job whenever you want.  

The following gif image illustrates how to create a schedule:

Events

Another way to make data transfers from SAP HANA or other remote destinations to Magento 2 is based on the system of events and observers. Our module lets you select a native or custom event turning it into a trigger responsible for the launch of data transfers. At the same time, you can create conditions that make the automation more precise. For further information, follow this link: How to Run Magento 2 Import or Export After Specific System Event or Process.

Advanced Mapping Features

Now, let’s focus on mapping features and tools designed to improve your routine related to attributes. The Improved Import & Export Magento 2 extension offers multiple functions in this area, and the most prominent one is mapping presets.

Mapping Presets

It is the easiest solution of all issues caused by different attribute standards. You no longer have to edit anything manually. The complicated procedure of data file editing is reduced to a few clicks. The Improved Import & Export Magento 2 extension offers an opportunity to select a predefined scheme for your particular integration and apply all changes automatically. The module will analyze the input data, find attributes unsuitable for Magento 2, and replace them with the corresponding ones used in the system. As you can see, all the dirty work is done by our extension. Your role is reduced to selecting a necessary scheme.

The following gif image illustrates how to apply a mapping preset that enables data migration from Magento 1 to Magento 2. Even two versions of the same platform use different attributes not to speak of something more distant.

Matching Interface

But if you want to take the full control over the process, the Improved Import & Export Magento 2 extension lets you use the mapping interface. Here, you can do everything manually. Select a third-party attribute and specify the corresponding one used internally in front of it. Next, you can add a hardcoded attribute value that will be added to all items from the imported file for this attribute. The process is very straightforward, and you can check it below:

Attribute Values Mapping

Besides, it is possible to map external attribute values to ones used internally. The logic behind this process is absolutely the same as we’ve just described above: choose a third party designation and match it to one utilized in your database. Note that you can easily match multiple external values to one used internally.

Let’s imagine a situation when a remote SAP ASE table contains an external attribute “color” with two values: “lime-green” and “avocado-green”. As for your Magento 2 database, it includes only one suitable value: “green”. Match both external designations to the one used internally in the extension interface instead of importing unnecessary data and then editing it manually. You can find more information regarding attribute values mapping here: Attribute Values Mapping.

Attribute Values Editing

Another handy tool related to attribute values provides the ability to edit them. With the Improved Import & Export Magento 2 extension, you can easily transfer a table from SAP HANA applying multiple changes to its attribute values in bulk. The module allows adding a suffix of a prefix. At the same time, you can split data related to different values as well as apply the opposite procedure – merge information regarding the same value. The feature is described here in more detail:  How to Modify Attribute Values During Import and Export in Magento 2.

Category Mapping

Category mapping is another time-saver provided by the Improved Import & Export Magento 2 extension. Our module lets you match products from an external catalog to the one used in your database. Select a remote category and specify its internal analog – just like in the case of attributes:

Furthermore, you can create new categories during the import. Set a parent category and type a name for a new one. Both features are described in this article: Category Mapping.

Attributes On The Fly

And if a data file lacks some attributes, you can create them on the fly. The Improved Import & Export Magento 2 extension lets you specify parameters necessary for the automated attribute generation. Use the following general form:

Attribute|attribute_property_name:attribute_property_value|…

You can discover the full algorithm of the attributes on the fly creation in this article: Product attributes import.

Extended Connectivity Options

The last thing we’d like to draw your attention to is the extended connectivity options of the Improved Import & Export extension. While the data transfer from SAP HANA to Magento 2 is implemented directly, there is an opportunity to use multiple file standards and intermediary services to achieve the same goal. Let’s see what options are available.

Multiple File Standards

While Magento works with CSV only, the Improved Import & Export extension adds multiple other formats. With the help of our plugin, you can effortlessly transfer data via XML, JSON, ODS, and Excel files. Thus, the necessity to convert them into CSV and vice versa are eliminated!

Multiple File Sources

To make file transfers more convenient than the default tools offer, we’ve added support for multiple file sources. Firstly, the Improved Import & Export Magento 2 module lets you leverage the FTP/SFTP connection. It means that you can transfer files using a local server. However, this option is extended by the ability to import/export data via a remote server.

Secondly, you can use a Dropbox account for the same purpose. And if it is necessary to import data only, our extension allows using a direct file URL. Specify a file address, and the module will move it into the system. Note that all compressed files are unpacked automatically.

Alternative Ways of Import & Export

File transfers can be easily eliminated from the transfers. The Improved Import & Export Magento 2 extension provides the ability to establish the connection between your e-commerce store and an external system with the help of an additional service or API connection. While relying on intermediaries, the extension allows using Google Sheets, Office 365 Excel, or Zoho Sheet. You transfer data from the online services right to your e-commerce website. The Google Sheets Magento 2 integration looks as follows:

Magento 2 Google Sheet import

The second way provides the ability to transfer data between your e-commerce store and an external system via  REST, SOAP, and GraphQL. There is only one requirement: an external system should support one of these connection types.

Note that all mapping features, schedules, and other enhancements can be applied to data file transfers and connections established directly or with the help of the intermediary services.

Watch this video to see the extension in action:

Final Words

As you can see, the Improved Import & Export extension completely revamps the default procedure of importing data from SAP HANA to Magento 2 making it fully automated and intuitive. You no longer need to master multiple environments and run numerous processes manually. Our module does everything for you. For further information about the extension, follow the link below and contact our support:

Get Improved Import & Export Magento 2 Extension