CRM and CX Blogs by Members
Find insights on SAP customer relationship management and customer experience products in blog posts from community members. Post your own perspective today!
cancel
Showing results for 
Search instead for 
Did you mean: 
Srinivas_Jayann
Product and Topic Expert
Product and Topic Expert
5,727


This blog walks through on how to install Data Hub and Integrate SAP Hybris Commerce​ to SAP ISU backend.

Make sure you have completed below two blog in order proceed with this one:

  1. SAP Hybris Installation Guide​

  2. MySQL Database Connection To Hybris​


What is Data Hub and what role it plays in the Integration with SAP or any Third party system?

  • data hub is a database which is populated with data from one or more sources and from which data is taken to one or more destinations.​ Its like staging area situated between one source and one destination.

  • It can be used to connect SAP or non SAP systems and data replication in both directions.


How data execution take place from Source to Destination with DATA HUB?



As you can above, Execution happens with following three major steps:

  1. ​Load (raw format)​

  2. Composition (canonical format)

  3. Publication (target format)​


These three steps called as staging area and where data will be analyzed before fed to destination.

For more details on SAP Hybris Data Hub visit: help.hybris.com​

Lets start integrating Hybris Commerece and ISU using Data Hub.


Prerequisites:



  • JDK and JRE(Preferably​ 1.8 version)

  • Hy​bris Commmerece and Utility Accelerator  -  Refer link​

  • MySQL​ -  Refer link 

  • Apache Tomcat


Step1: JDK and JRE(Preferably 1.8 version)​

Download based on your system operating system 32/64 bit processor.

JDK: Download​
JRE: Download​ ​



Installation Guid: Video

Step 2 and Step 3 ​we already covered in the previous blogs...

 

Step4: Apache Tomcat ​Installation

 

​Apache Tomcat:  Download​

 

Open your tomcat folder -> go to conf -> create Catalina folder -> localhost folder -> datahub-webapp (create xml file)​



Enter below data in the datahub-webapp file.








​​<Context antiJARLocking="true" docBase="C:/Hyb6/hybris/bin/ext-integration/datahub/web-app/datahub-webapp-6.0.0.10-RC1.war" reloadable="true">

    <Loader className="org.apache.catalina.loader.VirtualWebappLoader"

        virtualClasspath=

                "C:/Hyb6/hybris/bin/custom/datahub/config;     

                 C:/Hyb6/hybris/bin/custom/datahub/erp/*.jar;

                 C:/Hyb6/hybris/bin/custom/datahub/isu/*.jar;

                 C:/Hyb6/hybris/bin/platform/lib/dbdriver/mysql-connector-java-5.1.23.jar"/>

</Context>​



As you can see above,this file is referring some jar files in datahub folder, but these folders or files are not availble and same we need to create. Goto datahub directory and create these folders.

​​​​​


Start the Tomcat:Goto <Your Path>\D:\apache-tomcat-7.0.76\bin right click and open command prompt.





Now Goto: D:\HybrisFunctional\Required Software\apache-tomcat-7.0.76\webapps​system created new folder datahub-webapp

 ​




In the config folder create following files:

Text File          : encryption-key.txt

Properties File: local.properties




Install open ssl and generate the key:


Copy just key above and past it encryption-key.txt​ file


Copy the below content to local.properties​. 










​#Generated by hybris installer

#Fri May 26 21:39:45 IST 2017

website.electronics.http=http/://electronics.local/:9001/yacceleratorstorefront

website.electronics.https=https/://electronics.local/:9002/yacceleratorstorefront

website.apparel-de.http=http/://apparel-de.local/:9001/yacceleratorstorefront

website.apparel-de.https=https/://apparel-de.local/:9002/yacceleratorstorefront

website.apparel-uk.http=http/://apparel-uk.local/:9001/yacceleratorstorefront

website.apparel-uk.https=https/://apparel-uk.local/:9002/yacceleratorstorefront

website.powertools.http=http/://powertools.local/:9001/yb2bacceleratorstorefront

website.powertools.https=https/://powertools.local/:9002/yb2bacceleratorstorefront

keygen.customer.sap_customer_id.start=0000490000

keygen.customer.sap_contact_id.start=0000490000

keygen.order.code.start=0006200000

sapcustomerexchange.outbound.datahub.feed=SAPCONSUMER_OUTBOUND_FEED

sapcoreconfiguration.datahuboutbound.enabled=true

numberseries.cache.size.order_code=1

saporderexchange.orderoutbound.maxRetries=3

log4j.logger.de.hybris.platform.sap.orderexchange=debug

datahubadapter.datahuboutbound.url=http://localhost:8080/datahub-webapp/v1

hmc.default.autologin=true

hmc.default.login=admin

hmc.default.password=nimda

crm.system_type=Microsoft SQL Server 2

crm.database_hostname=database.hostname.url

crm.database=databasename

crm.database_port=1433

crm.database_user=user

crm.database_password=password

crm.ssc_jndi_usage=false

crm.ssc_jndi_datasource=jdbc/datasourcename

build.parallel=false

sapisuorder.ordermessagetype=/UTWSI/NEWCUSTPOD


#DB Setup

dataSource.className=com.mysql.jdbc.jdbc2.optional.MysqlDataSource

dataSource.driverClass=com.mysql.jdbc.Driver

dataSource.jdbcUrl=jdbc:mysql://localhost/datahub?useConfigs=maxPerformance

dataSource.username=uteg

dataSource.password=uteg

#media storage

mediaSource.className=com.mysql.jdbc.jdbc2.optional.MysqlDataSource

mediaSource.driverClass=com.mysql.jdbc.Driver

mediaSource.jdbcUrl=jdbc:mysql://localhost/datahub?useConfigs=maxPerformance

mediaSource.username=uteg

mediaSource.password=uteg

#Not why we need to set it here.

datahub.extension.exportURL=http://localhost:9001/datahubadapter

datahub.extension.username=admin

datahub.extension.password=nimda

#Not why we need to set it here.

targetsystem.hybriscore.url=http://localhost:9001/datahubadapter

targetsystem.hybriscore.username=admin

targetsystem.hybriscore.password=nimda

# Encryption

datahub.encryption.key.path=C:/Hybris6test/hybris/bin/custom/datahub/config/encryption-key.txt

# enable/disable secured attribute value masking

datahub.secure.data.masking.mode=true

# set the masking value

datahub.secure.data.masking.value=*******

kernel.autoInitMode=create-drop

#kernel.autoInitMode=update

#====

sapcoreconfiguration.pool=SAPCONFIGURATION_POOL

#sapcoreconfiguration.autocompose.pools=GLOBAL,SAPCONFIGURATION_POOL

#sapcoreconfiguration.autopublish.targetsystemsbypools=GLOBAL.HybrisCore

datahub.publication.saveImpex=true





​Goto: C:\Hyb6\hybris\bin\ext-integration\datahub\extensions\sap​ copy the jar files highlighted and past it to erp ​folder.



Now start the Tomcat server.





Go to localhost:8080/datahub-webapp/v1/data-feeds



We need to disable Spring secure in web.xml file D:\HybrisFunctional\Required Software\apache-tomcat-7.0.76\webapps\datahub-webapp\WEB-INF 



open the file and comment the below part and re-start the Tomcat server again.



​Now we will able to open feeds and pools:







Place the above downloaded file into: C:\Hyb6\hybris\bin\custom\datahub\archetype

​​

Copy the sdk file from C:\Hyb6\hybris\bin\ext-integration\datahub\sdk into C:\Hyb6\hybris\bin\custom\datahub\archetype​​


 


​Execute the maven command for Archetype. Modify command based on your directory and version:








mvn install:install-file -DgroupId=com.hybris.datahub -DartifactId=datahub-extension-archetype -Dversion=6.0.0.0-RC12 -Dpackaging=jar -Dfile=datahub-extension-archetype-6.0.0.0-RC12.jar -DgeneratePom=true​




Execute the maven command for sdk file. Modify command based on youir directory and version:








​mvn install:install-file -DgroupId=com.hybris.datahub -DartifactId=datahub-extension-sdk -Dversion=6.0.0.10-RC1 -Dpackaging=jar -Dfile=datahub-extension-sdk-6.0.0.10-RC1.jar -DgeneratePom=true​




Now modify the archetype version and SDK version in below command as yours and run the command​. In the below command sapisuorder ​is the folder name which we indicating to create, you can give any name of your choice.









mvn archetype:generate -DarchetypeGroupId=com.hybris.datahub -DarchetypeArtifactId=datahub-extension-archetype -DarchetypeVersion=6.0.0.0-RC12 -DgroupId=com.sap.hybris -DartifactId=sapisuorder -DsdkVersion​=6.0.0.10-RC1​





Open your archetype folder C:\Hyb6\hybris\bin\custom\datahub\archetype and see that the sapisuorder folder is created automatically​.



copy the sapisuorder file from C:\Hyb6\hybris\bin\custom\datahub​ to C:\Hyb6\hybris\bin\custom\datahub\archetype​ and delete file from C:\Hyb6\hybris\bin\custom\datahub​​ folder



Run​ mvn clean install command in C:\Hybris6test\hybris\bin\custom\datahub\archetype\sapisuorder​:


Once mvn install successfully, one target folder will get created in Raw, Canonical and  Target folder in sapisuorderdirectory.


Copy the SNAPSHOT Jar file from taget folders mentioned above and place it isu ​folder ​(C:\Hyb6\hybris\bin\custom\datahub\isu)




​Goto local.extensions file add the following extesion:







<extension name='sapcore' />
<extension name='sapcorejco' />​

​<extension name='sapcorejcorec' />

<extension name='sapcoreconfiguration' /​>​




Once all the above steps completed, run ant clean all and start the Hybris server:


Note: Here we are connecting to SAP ISU and all the backend configuration ​already done and not covered in this blog.

Login to hMC: https://localhost:9002/hmc​
Navigate to ​SAP Integration and follow the below step:


​​​​​​​​Create HTTP destination from Hybris Datahub to ISU:

Click on HTTP Destination and create new.


Enter the details of sap IDOC destination URL and credentials for authentication, Create and Save:


​Goto SAP Global Configuration, Give the SAP Logical system name and HTTP destination created above.


Goto RFC Destination and click on Create New and enter the details SAP system which you need to connect.


In the SAP System tab provide the SAP system details.


In Logon tab enter details. Use your SAP system login credentials:


Click on Create and Save. ​Now check the whether​ configuration looks good and connection working fine by clicking onPing Destination:


Goto SAP Base Store Configuration and Click on Create New:



Under Core tab enter the details shown, Create and Save:



Start the Tomacat server and open the MySQL work bench and login to uteg connection.


Login to Utility website and create new order:









Check MySQL rawitem table, whether data getting reflected:





I am using Google Postman app for Data Composition and Data Publication. You can use any 3rd party tools.

Data composition: Transfer of data from raw items to canonicalitem​.



Now go to MySQL workbench and check the “canonicalitem” table data.




Data Publication: Transfer of data from canonical items to targetitem.







Now go to MySQL workbench and check the “targetitem” table data.



Login to SAP ISU system and check whether IDoc reached in WE02:







IDoc in error status due to some missing config in ISU, but we are good with establishing the communication between the systems.

2 Comments
Labels in this area
Top kudoed authors