Sunteți pe pagina 1din 19

BY

VishalSharma
vishal.sharma@sonatasoftware.com
13015

*Version:1.02

*ChangesIncludenewSections,linksandcertainCodemodification.
Note:UseWebBrowserslikeChromeorFirefoxtoopenthisPDFFile.
SAPHYBRISINTEGRATION

HiandWelcometoSAPHybrisIntegration.ThisDocumentationwillGuideyouthroughstepsand
ProcedureinvolvedinsettingyourHybrissystemtoInteractwithyourSAPERP.TheDocumentisdividedintotwo
parts.
PartI
ItisusedtosetupDatahubsystemonly.
PartII
ExplainstheprocessinvolvedinSettingupSystemtotransferdatabetweenyourhybrisDatahubSAPERP

InPartIItherearetwowaysoftransferringDatabetween.ThefirstisAsynchronousandsecondis
Synchronous.TheAsynchronousmethodinvolvestheuseOfDatahubwhiletheSynchronousmethodinvolves
directinteractionbetweenyourHybrisandSAPsystemwithoutanyinterfaceofyourDataHub.

Legends
InthisdocumentthefollowingConventionsareused

BOLD HighlightsImportant
points
www.abc.xyz HighlightsLinks
code HighlightsCodeandpropertiesusedinyourApplication.
(OPTIONAL )ThisfieldcanbeskippeduptouserChoice.
{EXAMPLE}NecessaryFieldstobeFilledbytheReader.

{ip_address}ifyouaresettingupondifferentmachinethenplaceyourmachineipelseifyouareusingyourown
machinethenreplaceitwith localhost.

NOTE:WhilemakingthisDocumentationtheHybrisSuiteAvailablewas5.7.0.3.Forversions5.6
andabovethefollowingdocumentationissuitable.Forversionsbelow5.6somefunctionalitywillbe
missing.

2
SAPHYBRISINTEGRATION

PARTI

3
SAPHYBRISINTEGRATION

DATAHUBINSTALLATION

InstallationRequirements
1. JavaJDK8
2. Hybrissuite5.6andabove
3. MYSQLDatabase
4. ApacheTomcatversion7.xx(Note:DataHubwillnotbesupportedforversion8and9reasonwillbe
explainedinoneofthebelowsteps)
5. Downloadlinkhttps://tomcat.apache.org/download70.cgi
6. WindowsandLinuxOS.
7. MemoryRequirementifyouarerunningbothHybrisandDataHubServeronsamemachinethenitsis
recommendedtorunon16GBRamrunningon8GBRamwillslowdownyoursystem.

Beforestartingpleasereferthearchitectureanddesignofdatahuboryouwon'tbeabletounderstandthe
implementationpartdefinedbelow.ThefollowinglinksprovideentireOverviewofdatahubandSAP
Integration
https://wiki.hybris.com/pages/viewpage.action?spaceKey=release5&title=hybrisSAP+Solution+Integration

NOTE :PleasemakesureyoufollowallthestepsmentionedbelowskippinganystepwillnotrunyourDatahub
Server.Socarefullyandvigilantlyfolloweachandeverystep.

UNKNOWNISSUE:PleaseuseWebBrowserstoopenthispdffiles.WhileCopyinganycodesthatcontains
symbolfromAdobePdfviewercannotbecopiedtoyourTextfile.

Step1:
DownloadApacheTomcatintheabovespecifiedlink.CreateaFolderandextractTomcatserverthatyouhave
downloaded.ForExplanationpurposeIhavecreatedafoldercalledDatahub.InthisFolderIhaveExtractedthe
TomcatFiles

IfyouwanttoknowmoreabouttheprocessIamabouttowritebelowpleaseaccessthewikihybrislinkformore
information
https://wiki.hybris.com/display/release5/Getting+Started+with+the+Data+Hub

Step2:
InyourDataHubTomcatLocationgottowebappsdiranddeleteallthefilespresentinthefolder.
EXAMPLE:
YournewlyextractedTomcatFolderlookssomethinglikebelowimage


webapps
foldercontent

4
SAPHYBRISINTEGRATION


Deleteallthe
webapps
foldercontentsnotthe
webapps
folder
itself
.Thereasonfordeletingthemisthattheywill
notbeusedbydatahubandmaytakeupsomememoryforcompiling.

Step3:
CreateaFolderCalleddatahub_settinginsidetheDataHub
Folder.HereallyourDatahubrelatedfilesandlibrarieswill
bekept.InsidetheFoldercreatethreenewfolderscalled
config,libandwar.Incofigfolderyourlocal.propertiesandencryptionfileswillbekeptinyourlibyourmysqljarfiles
andotherfilesusedbydatahubwillbeaddedfinallyinyourwarfolderyour
datahubwebapp5.X.X.XRCX.warfilewillbekept.
Note:Basedonsuiteversionthewarfilenamemayvary.

P.S:
Tillnowonlyfoldersarecreatedwehaventaddedanylibsorfilesyet
Justthepurposeofeachfolderisexplained.

Step4:ConfiguringTomcat(i.eyourDataHubServer)
BeforeConfiguringthedatahubGotoyourHybrisSuite> bin
>extintegration
>
datahub >
webapp >
datahubwebapp5.X.X.XRCX.war .Copythewarfileandpasteitinyourtomcatlocation
datahub>
datahub_setting >
war
pasteinsidethewar
folder
InyourTomcatfoldergoto ConfFolderIfyouhavepreviouslyrunTomcatserverthanafoldercalled
CatalinawouldhavealreadyhavebeencreatedIfyouhavetillnownotrunyourtomcatserver(justtoseeifitis
runningornot)thencreateafoldercalledCatalina.InsidetheFoldercreateanotherfoldercalled
localhost
.Inside
localhostfoldercreateanxmlfilecalled
datahubwebapp.xml .

datahubwebapp.xmlcontents(AvoidcopyingwithAdobepdfvieweruseyourWebBrowser)
<ContextantiJARLocking="true"

docBase="/${catalina.home}/datahub_setting/war/datahubwebapp5.7.0.2RC1.war"
reloadable="true">
<LoaderclassName=org.apache.catalina.loader.VirtualWebappLoader
virtualClasspath=
"/${catalina.home}/datahub_setting/config/
/${catalina.home}/datahub_setting/lib/*.jar"/>
</Context>

Ifyouareunabletocopytheabovelinesofcodepleasecopyfromthewikilinkprovidedbelow:
https://wiki.hybris.com/display/release5/Downloading+the+Data+Hub+and+Configuring+It+for+Standalone+Use+wi
th+Tomcat#DownloadingtheDataHubandConfiguringItforStandaloneUsewithTomcatInstallationoftheDataHubonaT
omcatServer

5
SAPHYBRISINTEGRATION

ImportantNote: IwasusingHybrissuite5.7.0.3anditcamewithdatahub5.7.0.2versionItwillvaryfromversion
toversionsopleasemakesureinyourxmlfileinthe
docBase=/${catalina.home}/datahub_setting/war/datahubwebapp5.X.X.XRCX.war

locationputyourwar
filename.

LoaderclassName="org.apache.catalina.loader.VirtualWebappLoader inyourxmlfileisnotsupportedin
Tomcatversion8andabovehencepleaseuseonly7.XXtomcatversion.

Step5:

CreateanewSchema inyourdatabasenamedofyourChoice( )
Optional.

Nowthatyouhavecreatedanxmlfilegottoyourtomcatfolder>
datahub_setting
>
config
>create
local.propertiesfile

local.propertiescontent

#MysqlSettingschangeyourdatabasenameandpasswordbasedonyourdbconfiguration
dataSource.className=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
#Replace{Schema_name}withyourcreatedSchema
dataSource.jdbcUrl=jdbc:mysql://localhost/{Schema_Name}?useConfigs=maxPerformance&
rewriteBatchedStatements=true
dataSource.username=root
dataSource.password=root

#Encrytionfilelocation
datahub.encryption.key.path=${catalina.home}/datahub/config/encryptionkey.txt

#datahubExportlink
datahub.extension.exportURL=http://{ip_address}:{port_number}/datahubadapter
datahub.extension.userName=admin
datahub.extension.password=nimda
datahub.server.url=http://{ip_address}:{port_number}/datahubwebapp/v1

#InitializeDatahubDbeverytimeyoustartdatahubserver
#Tochangevalueremovecreatedropandreplacewithupdate
kernel.autoInitMode=createdrop

#TargetHybrisSytem
targetsystem.hybriscore.url=http://{ip_address}:{port_number}/datahubadapter
targetsystem.hybriscore.username=admin
targetsystem.hybriscore.password=nimda

6
SAPHYBRISINTEGRATION

#PleaseaskSappeopleforthefollowingpropertiesifyou'retestingdatahubforfirsttimethen
#pleasedon'taddbelowlinesjustcommentthem
targetsystem.saperp.url=
targetsystem.saperp.username=
targetsystem.saperp.password=
targetsystem.saperp.receivername=

Formorepropertiesreferurhybrissuitesapb2corb2bgradlefilebecausesomepropertiesarenotadded.

Step6:
Inthesamefolderasabovestepcreateatxtfilenamed encryptionkey.txt

encryptionkey.txtcontents
05D8D6D47419CCD6A2C21F7830832A2C

FormaskingRestAPICallspleasereferwikihybrislinkbelow(OPTIONAL )
https://wiki.hybris.com/display/release5/Setting+Up+the+Data+Hub+Encryption+Configuration

AlsotoaddSSLCertificate(forhttpsprotocol).tocreateSSLcertificatepleaserefer(
OPTIONAL
)
https://tomcat.apache.org/tomcat6.0doc/sslhowto.html

Step7:
Gotoyoursuite
bin
>
extintegration
>datahub>
extensions>
sap>copysapproductraw,canonialand
tragetsaporderraw,canonicalandtargetsapcustomerraw,canonicalandtargetsappricingraw,canonicaland
targetsapidocconigurationpartycanonicalsapcoreconfigurationandpasteitin datahub>datahub_setting
>
lib
folder.

Alsocopyyourmysqljarfileinthesamelocation.Mysqljarshouldbe
5.1.X
versiononly.

ConfiguringPortNumberinTomcatServer :inyourTomcat/DatahubHomeDirectorygoto conf


>
server.xml
changethefollowingdefaultportnumber8080withportnumberofyourchoice.
Note:FindtheBelowlinesintheFileandreplacethePortnumberonly.

<Connectorport="{port_number}"protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"/>

7
SAPHYBRISINTEGRATION

<Connectorport="{port_number}"protocol="AJP/1.3"redirectPort="8443"/>

Step8:
Gotoyourtomcathomedirectoryandcreatea datahubserver.bat
file.Ifyouareunabletocopythelinesbelow
findthefollowingcodeinthegivenlink.
https://wiki.hybris.com/display/release5/Downloading+the+Data+Hub+and+Configuring+It+for+Standalone+Use+wi
th+Tomcat#DownloadingtheDataHubandConfiguringItforStandaloneUsewithTomcatInstallationoftheDataHubonaT
omcatServer

datahubserver.batcontents(AvoidcopyingwithAdobepdfvieweruseyourWebBrowser)

rem@echooff
remExplanationofsettingsinCATALINA_OPTS:
rem*Settheminimummemoryto2gb
rem*Setthemaximummemoryto4gb
rem*UsetheParNewgarbagecollectorfortheyounggenerationheap
rem*UsetheConcurrentMarkSweepgarbagecollectorfortheoldgeneration
remheap
rem*TelltheJVMtotouchallmemorypagesduringJVMinitialization
rem*Disableexplictgarbagecollection(i.e.,viatheSystem.gc()method)
setCATALINA_OPTS=Xms4096mXmx4096mXX:+UseConcMarkSweepGCXX:+UseParNewGC
XX:+AlwaysPreTouchXX:+DisableExplicitGC
setlocal
ifnot""%1""==""run""gotomainEntry
if"%TEMP%"==""gotomainEntry
ifexist"%TEMP%\%~nx0.run"gotomainEntry
echoY>"%TEMP%\%~nx0.run"
ifnotexist"%TEMP%\%~nx0.run"gotomainEntry
echoY>"%TEMP%\%~nx0.Y"
call"%~f0"%*<"%TEMP%\%~nx0.Y"
remUseprovidederrorlevel
setRETVAL=%ERRORLEVEL%
del/Q"%TEMP%\%~nx0.Y">NUL2>&1
exit/B%RETVAL%
:mainEntry
del/Q"%TEMP%\%~nx0.run">NUL2>&1
remGuessCATALINA_HOMEifnotdefined
set"CURRENT_DIR=%cd%"
echo"CATALINA_HOME=%CATALINA_HOME%"
ifnot"%CATALINA_HOME%"==""gotoeof
set"CATALINA_HOME=%CURRENT_DIR%"
ifexist"%CATALINA_HOME%\bin\catalina.bat"call
"%CATALINA_HOME%\bin\catalina.bat"run
:eof

8
SAPHYBRISINTEGRATION

AftercreationRunthebatfiletostartdatahubserver

DATAHUBFUNCTIONALITYTESTING
TocheckifIDOCreceiverisworkingornot.CopythefollowingURLinyourBrowserorRestClientAPI.
http://{ip_address}:{port_number}/datahubwebapp/v1/idoc/receiver

Pleasereferthebelowlinktotestsampleapparelcatalogsthatcomeswithyourhybrissuite
https://wiki.hybris.com/display/release5/Data+Hub+Solution+Book

Note:PublicationwillnotworkunlessyoustartyourHybrissystem

Fortestingyourdatahubpleasereferfollowinglinks
https://wiki.hybris.com/display/release5/Testing+Data+Import+into+the+Data+Hub
https://wiki.hybris.com/display/release5/Testing+Composition+in+the+Data+Hub
https://wiki.hybris.com/display/release5/Testing+Publication+in+the+Data+Hub

9
SAPHYBRISINTEGRATION

PARTII

10
SAPHYBRISINTEGRATION

BeforemovingwithyourhybrisinstallationProcessandDatahubConfigurationhybrishasProvidedasetof
RapidDeploymentSolution.ThiswillEnableyoutoquicklyconfigurebothyourSAPERPandHybrisConfiguration
withoutanyDelay.AlthoughthesameprocesswillbedonebelowbutIwouldpreferifyoucouldfollowthe
documentation.PleasedownloadthedocumentintheprovidedlinkandshareitwithbothyourSAPteamand
Hybristeamasitexplainsconfiguringbothyoursystems.
https://wiki.hybris.com/display/release5/Rapid+Deployment+Solution+for+SAP+ERP+Integration

AsynchronousOrderManagement
AdditionalDataHubSettings
Pleaseaddthefollowingpropertiestoyourlocal.propertiesinthedatahubfile.ForUnderstandingSAPControl
HeaderPleasereferthefollowinglink
https://wiki.hybris.com/display/release5/sapidocoutboundadapter+Data+Hub+Extension
NOTE:SomeofthesepropertieswerealreadyaddedinPARTIjustmodifyorreplacethem
local.propertiescontents(Trywritingeachpropertiesinoneline)

#pleaseaskClient,username,passwordandreceivernamefromSAPTeammembers
targetsystem.saperp.url=http://{ip_address}:{port_number}/sap/bc/idoc_xml?sapclie
nt={client}
targetsystem.saperp.username={user}
targetsystem.saperp.password={password}
targetsystem.saperp.receivername={SAP_ERP_LOGICAL_SYSTEM}

#EnabledynamicoffsetforIDocnumbersdeactivateincaseofapersistentDB!

sapidocoutboundadapter.usedynamicidocnumberoffset=true
sapidocoutboundadapter.receivername={SAP_ERP_LOGICAL_SYSTEM}
sapidocoutboundadapter.senderport={PORT_FROM_WHICH_SAP_WILL_SEND_IDOC_TO_YOUR_DATA
HUB}
sapidocoutboundadapter.sendername={SAP_ERP_PARTNER_NAME}

#enableautomaticcomposition&publication,5000msinterval(Trywritingeachpropertiesinoneline)
sapcoreconfiguration.autocompose.pools=GLOBAL,SAPCONFIGURATION_POOL,SAPCUSTOMER_IN
BOUND_POOL,SAPCONSUMER_INBOUND_POOL,SAPCONSUMER_OUTBOUND_POOL,SAPORDER_INBOUND_POO
L,SAPORDER_OUTBOUND_POOL
sapcoreconfiguration.autopublish.targetsystemsbypools=GLOBAL.HybrisCore,GLOBAL.Sap
ErpSystem,SAPCUSTOMER_INBOUND_POOL.HybrisCore,SAPCONSUMER_INBOUND_POOL.HybrisCore,
SAPCONSUMER_OUTBOUND_POOL.SapErpSystem,SAPORDER_OUTBOUND_POOL.SapErpSystem,SAPORDE
R_INBOUND_POOL.HybrisCore
sapcoreconfiguration.autopublish.sleeptime:5000
sapcoreconfiguration.autopublish.initialsleeptime:5000
#PoolholdingSAPconfigurationsettings
sapcoreconfiguration.pool=SAPCONFIGURATION_POOL

11
SAPHYBRISINTEGRATION

HybrisInstallationprocess
ThebelowprocessexplainedmeansthatyouunderstandthebasicconceptsofHybrisandalsoyouunderstand
thesetupofhybrissuitethroughgradlerecipefile.Ifnotpleasereferhybriswikionhowtosetuphybristhrough
gradlemethod.

Createyourownrecipefileinyour build.gradlefileaddthefollowingproperties
Note: Thebelowmethodisforb2cacceleratormakeadjustmentstorunon b2b accelerator.Alsothefollowingis
ForAsynchronousinlaterReleasewewilladdSynchronous,CPQandc4csystems.

build.gradlecontents
localProperties{
/*pleaseadaptthenumberrangesaccordingtothesettingsintheERPbackend*/
property'keygen.customer.sap_customer_id.start','0000490000'
property'keygen.customer.sap_contact_id.start','0000490000'

/*configasyncordermanagementordernumber*/
property'keygen.order.code.start','0006200000'

property'sapcustomerexchange.outbound.datahub.feed','SAPCONSUMER_OUTBOUND_FEED'

/*configsapcoreconfiguration*/
property'sapcoreconfiguration.datahuboutbound.enabled','true'

/*configasyncordermanagement* /
property'numberseries.cache.size.order_code','1'
property'saporderexchange.orderoutbound.maxRetries','3'
property'log4j.logger.de.hybris.platform.sap.orderexchange','debug'

/*Configdatahubsetting*/
property'datahubadapter.datahuboutbound.url','http://{ipaddress}:{portnumber}/datahubwebapp/v1'

extensions{





scanPathWithAutoLoad'${HYBRIS_BIN_DIR}/extintegration/sap/core'
scanPathWithAutoLoad'${HYBRIS_BIN_DIR}/extintegration/sap/masterdata'

12
SAPHYBRISINTEGRATION

scanPathWithAutoLoad'${HYBRIS_BIN_DIR}/extintegration/sap/asynchronousOM'
scanPathWithAutoLoad'${HYBRIS_BIN_DIR}/extintegration/sap/availability'
scanPathWithAutoLoad'${HYBRIS_BIN_DIR}/extintegration/sap/creditCheck'
scanPathWithAutoLoad'${HYBRIS_BIN_DIR}/extintegration/sap/adtreco'
scanPathWithAutoLoad'${HYBRIS_BIN_DIR}/extintegration/sap/sapprodreco'
scanPathWithAutoLoad'${HYBRIS_BIN_DIR}/extintegration/sap/pointofsale'
scanPathWithAutoLoad'${HYBRIS_BIN_DIR}/extintegration/sap/testsupport'

extName'datahubadapter'
extName'datahubbackoffice'

tasksetup<<{

applyplugin:'installerplatformplugin'
applyplugin:'installeraddonplugin'

defthePlatform=platform(config)
thePlatform.setup()

thePlatform.project.addons{
names"sapcoreaddon,sapprodrecoaddon,sapcarintegrationaddon"
template"{ENTER_YOUR_STOREFRONT_NAME}"
storeFronts"{ENTER_YOUR_STOREFRONT_NAME}"
platformthePlatform
}
}

BeforeInitializationyourhybrissuite.
Goto hybrissuite >
bin>
extintegration>
datahubbackoffice
>
resources
>
impex
>
essentialdatadatahubbackoffice.impex

#ModifyonlythisLine

INSERT_UPDATEDataHubInstanceModelinstanceName[unique=true]instanceLocation
{anyname}http://{ip_address}:{port_number}/datahubwebapp/v1
InitializeandStarttheserveraswellasdatahubserver

13
SAPHYBRISINTEGRATION

HybrisConfiguration

CREATEHTTPDESTINATION
ThebelowStepscanalsobePerformedinBackofficeaswell.
ThebelowPicturesarefor
RepresentationalPurposeOnly basedonyourRequirementdotheCustomization.

14
SAPHYBRISINTEGRATION

CREATERFCDESTINATION


NOTE:ToVerifyConnectionClickonPingDestinationTab


15
SAPHYBRISINTEGRATION

CreatingSAPBaseStoreConfiguration

16
SAPHYBRISINTEGRATION

SAPGLOBALCONFIGURATION

17
SAPHYBRISINTEGRATION

18
SAPHYBRISINTEGRATION

UPLOADSETTINGSTODATAHUB

NOTE:IncaseStartUploadButtonisDisabledthenClickonthesaveitwillbeenabled.

19

S-ar putea să vă placă și