Skip to Content

Best Practice for SAPUI5 Application Namespace

Hi guys,

quick question: is there any guideline or best practice for the namespace of a new SAPUI5 application (it is obligatory when creating a new app in the WebIDE)? I'm a bit confused about this concept... should the namespace be unique to my company? Or to the application itself?

Let's say I'm developing an app in my company to display sales orders, how should I name the project and the namespace?

In ABAP, I would create a report and name it "ZSD_DISPLAY_SALES_ORDERS". In SAPUI5, I learned that the application name, project name and the name of the BSP application should ideally all be the same. Since the BSP name is limited to 15 characters I would call them all "ZSD_DISP_ORDERS" or something like that.

So, what about the namespace? Should it be "zsd"? Or "myCompanyName"? Or "zsd.disp.orders"? Or should the namespace be "zsd" and the project name be "disp_orders"? Sorry, I have no clue...

Can somebody here please shed some light on this matter? How are you naming your applications?

BR, Klaus

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Feb 19, 2019 at 02:09 PM

    as per the documentation, The bootstrap property resourceroots defines the namespace for all resources of the app,

    https://sapui5.hana.ondemand.com/#/topic/851bde42e4e1410c96abbe402fa9128c

    so your namespace is used to access additional files. as far as naming convention, you could use company.project... in my opinion, the easier the namespace, the better, so that when you need it you do not need to be typing several.words.with.dots.in.it for your namespace.

    maybe others have a better suggestion

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Sergio,

      thanks for your answer. I also want the namespace to be as simple as possible, but I don't want to violate SAP guidelines just to keep it simple. When I try it with your suggestion (company.project), it would look like this:

      manifest.json: "sap.app": { "id": "company.zsd.disp.orders.ZSD_DISP_ORDERS",
      index.html: data-sap-ui-resourceroots='{"company.zsd.disp.orders.ZSD_DISP_ORDERS": "./"}'
      controller.js: return Controller.extend("company.zsd.disp.orders.ZSD_DISP_ORDERS.controller.View1", {

      I think that's not only ugly as hell, but also quite redundant.

      How do other developers do it?

      BR, Klaus

  • Posted on Feb 19, 2019 at 02:42 PM

    completely agree the long name is not pleasant :)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.