cancel
Showing results for 
Search instead for 
Did you mean: 

Having trouble importing SAPUI5 code samples

former_member702560
Discoverer
0 Kudos

I'm sorry if this has been answered before but I couldn't find anything that helped. I am playing around with importing sample controls into SAP Web IDE (from https://sapui5.hana.ondemand.com/#/controls), but some of them end up being unsuccessful with the following message: "(import) Could not complete the import operation. See the Archive Import Troubleshooting Guide for more information." The troubleshooting guide was not helpful.

The import only works partially. I also tried importing the missing files one by one, after which running index.html ends up with a blank screen and the following error: "(uiadaptation) undefined is not an object (evaluating 'sUI5CurrentVersion.split)".

Sample for which the import works successfully: https://sapui5.hana.ondemand.com/#/entity/sap.m.IconTabBar/sample/sap.m.sample.IconTabBar

Sample for which the import is incomplete as described above: https://sapui5.hana.ondemand.com/#/entity/sap.uxap.ObjectPageLayout/sample/sap.uxap.sample.ObjectPag...

Please help. One thing I did notice in the case of ObjectPageLayout is that the manifest references views from subfolder "SharedBlocks" which do not exist in the project, nor are they in the sample .zip file. Could this be the problem? What is SharedBlocks?

Accepted Solutions (0)

Answers (2)

Answers (2)

geert-janklaps
Active Contributor

Hi,

To easily import the examples you could download the SAPUI5 SDK (be sure to choose SDK and not runtime) from here:

https://tools.hana.ondemand.com#sapui5

If you look at the code sample you're having trouble with, you'll notice that it's using some reusable components from a different project/folder.

To successfully import the code sample you'll need to copy the referenced project/folder as well:

Best regards,

Geert-Jan Klaps

former_member702560
Discoverer
0 Kudos

You're right. The error from the console is actually:

Unhandled Promise Rejection: Error: failed to load 'sap/uxap/sample/SharedBlocks/goals/GoalsBlock.js' from https://sapui5.hana.ondemand.com/resources/sap/uxap/sample/SharedBlocks/goals/GoalsBlock.js: script load error

I loaded in all the test-resources from the SDK as you suggested - now the question is how do I set it up in my index.html so as to point to the local SDK for these particular resources, and the online version for the others? Currently my index.html looks as follows:

Can I have two sources?