Skip to Content
0

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

Aug 01, 2017 at 02:21 PM

169

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
avatar image
Former Member Aug 03, 2017 at 07:33 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Srikanth KV Aug 01, 2017 at 02:56 PM
0
Share
10 |10000 characters needed characters left characters exceeded