cancel
Showing results for 
Search instead for 
Did you mean: 

How to load external library(HCM_COMMON) projects to custom SAPUI5 project

Former Member
0 Kudos

Hi All,

Can any one helps me that how can I load external UI5 library project to my custom SAPUi5 project

I am trying to load HCM_COMMON library to custom project but no luck

below is my code, I tried called with "jQuery.sap.registerModulePath", no luck and tried in a below way.

Any clues really helpfull

(function() {
var sPath = jQuery.sap.getModulePath("com.sap.TestApp");
if (sPath.indexOf("/YFioriStater") !== -1) {
if (sPath.lastIndexOf("/") !== sPath.length - 1) {
sPath += "/";
}
jQuery.sap.registerModulePath("sap.hcm.lib.common",
sPath + "../hcm_common/sap/hcm/lib/common/");
}else{
jQuery.sap.registerModulePath("sap.hcm.lib.common","../hcm_common/sap/hcm/lib/common/");
}
}());
sap.ui.define(['sap/ui/core/UIComponent','sap/ui/core/mvc/XMLView'],
function(UIComponent, XMLView) {
"use strict";
var Component = UIComponent.extend("com.sap.TestApp.Component", {
metadata : {
dependencies : {
libs : [
"sap.m",
"sap.ui.layout",
"sap.hcm.lib.common"
],
components : []
}
}
});
Component.prototype.createContent = function () {
// create root view
var oView = sap.ui.view({
id: "TestView",
viewName: "com.sap.TestApp.view.View1",
type: "XML",
viewData: {
component: this
}
});
return oView;
};
return Component;
});

Thanks

Rajesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi All,

Resolved, below piece of code(component.js) sorted my issue

(function() {
 jQuery.sap.registerModulePath("sap.hcm.lib.common", "/sap/bc/ui5_ui5/sap/hcm_common/sap/hcm/lib/common/");
 }());

Thanks

Rajesh

Answers (1)

Answers (1)

former_member365727
Active Contributor
0 Kudos