cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5: create custom library to use across different apps across a sapui5 mta project.

akhilsuryaa
Explorer
0 Kudos

I need to create a comprehensive SAPUI5 app with workflows and stuff. I have a create workflow and an approval workflow, both have the same forms. So in order to apply dry, I am trying to create a custom library in my sapui5 project. I want the components in the library to be accessed by any applications in my project(code reusability).
I have found answers like this
https://stackoverflow.com/questions/53635156/using-a-sapui5-library-in-another-project
https://community.sap.com/t5/technology-blogs-by-members/step-by-step-procedure-to-create-sapui5-lib...
https://sapui5.hana.ondemand.com/sdk/#/topic/6314fcd2510648fbaad3cee8a421030d.html
but couldn't find a complete solution. I guess there is a way to create a custom library from the cloud IDE itself.
If anyone can share any docs or guides on how to do it, would be really helpful.
The current project structure is attached. Next, I am gonna create an approval workflow so any help would be really helpful.

I found out that I can create a library with generator-easy-ui5 npm package, now I wanna know how to consume it in my apps.
Please check the folder structure I uploaded

akhilsuryaa_0-1708056709701.png

 

View Entire Topic
WouterLemaire
Active Contributor
0 Kudos

Here I have an example of two UI5 apps/components where one is consuming the other one as two different mta apps: https://community.sap.com/t5/technology-blogs-by-members/connecting-ui5-typescript-components-locall...

You can use the same logic for libraries as components to connect them even as one or two mta's, the config to connect will be similar. 

Same for the deployed version, the namespace of the library will be resolved by workzone. If you don't use workzone, you'll need to configure the resource roots correctly.

 

Hope this helps! Kr, Wouter

akhilsuryaa
Explorer
0 Kudos
Hi,
akhilsuryaa
Explorer
0 Kudos
Hi, Thank you for replying, after trying with different solutions found a solution on how to do it and for now shelved the implementation. Moved on to cap/cds for now.