A little preamble
I’m writing this document more for my help in keep track of my success and, even more, my errors, following Fiori’s master rule “fall first, fall often”.
I’m using a real case from my company to try UI5: it’s a bit scaring since if things will not sort out well, it will be a real problem!
This will not be a pure technical blog, but a more descriptive one, with links over links to the sources I used.
The tech parts will follow in later entries.
When I read about UI5, I was scared. Literally.
So it has been mandatory and useful get the bases to avoid running around like a drunken chicken trying to understand what a single row of code does.
There are a bunch of sources where you can learn and refine your JS skill:
I encourage everyone to try out as many tutorials and site as possible to find which methodology and style fit better for herself.
Learn UI5’s basics
I was aware about the difference between OpenUI5 and SAPUI5 and, even if in a far away future my company will probably require to switch to OpenUI5, I sticked as starting point with SAPUI5 due the larger (and more familiar to me) community on SCN.
So I downloaded Eclipse ADT with all the option except the one for SAP Hana (we are on 7.31) and then… well, where I start from?
The best way I found out to learn something about UI5 has been following the tutorial “Walkthrough” https://sapui5.netweaver.ondemand.com/#docs/guide/3da5f4be63264db99f2e5b04c5e853db.html
And with “following the tutorial” I mean, following it step by step, deleting everything and trying to redo it by myself, adding or removing the pieces just to try.
This procedure (“fall first, fall often”, do you remember?) reminded me when I was a child and play with Lego: the first couple of times I followed the instructions, then I always tried to build my galleon or my spaceship just “guessing” the right way.
I do not need to say how many times I failed and throw everything away (yes, I’m still talking about my first app), but I think that’s the best way to catch up with the mechanisms of something.
It has been hard, really hard due my steamy temper, discovering that my ABAP skill were useless in this world and that I keep crushing and crashing against silly things I never ever cared about (because with common SAPGUI and ABAP objects/FM we many nice features out of the box while with UI5 you have to think about them).
But they really were? No, as you’ll find out in later blogs if you find interesting following them, exactly the opposite.
O Data, OData, wherefore art thou OData?
Even if you can build a standalone app without any connection with SAP, we all know that we HAVE to communicate with SAP, reading and writing data, so, when I somehow mastered the basic concepts of MVC and UI5, I moved to study how SAP can generate an OData service.
If you, like me, are new to OData Services, follow this guide and in a couple of hours you’ll have your Service ready and running.
Both of the guides rely on FMs to manage the data retrieval and update and, even if there is nothing wrong with them, I looked for something more… nice: http://www.abap-developers.com/2014/07/simple-openui5-application-i-how-to-create-odata-model-using-segw/
http://scn.sap.com/people/peter.marcely ’s guide showed me how to bypass the FM and to use directly the classes generated for the Services.
I found it better, since I got less objects to manage (a dictionary structure and the classes) and I stick with OOP which is always nice in my opinion.
I got the ropes now, and all the tools available for my first app: I got my Lego’s pieces, all scattered around, a full set of instructions and a monster headache because I do not know from where to start…
Here you can find my Part 2