Hi everybody.
I'm not very deep in SAPUI5, I am developing in a classical, SAPGUI using environment. But I want to develop by respecting MVC paradigma, so I have a layer with all the SAPGUI related stuff and a deeper layer, which contains the business logic. Next year, when my customer migrates to S/4HANA, I only want to get rid of the SAPGUI layer programs and replace them with UI5 user interfaces.
Ok, that is the plan. But there are a few questions, the very most recent is:
In my business logic, I can't use the statement "message....", right? "message" is a statement, which is not independent from SAPGUI. But (for example) for informing the user about the percentage of long time consuming operations, I use SAPGUI_PROGRESS_INDICATOR. What happens, if there is no SAPGUI?
How can I do
LOOP AT ...
calculated_percentage = ....
call function 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = calculated_percentage
text = 'data selection in progress'.
....(data selection)....
ENDLOOP.
in SAPUI5?
In my business logic, there maybe some coding like this:
try. | |
(some operations) | |
catch zcx_(custom_exception). | |
endtry. |
In SAPGUI using environments, I can fire a message after "catch" and this message will be shown in SAPGUI status bar. I also can assign a message class and a message text to an exception class. But in the future, there won't be a SAPGUI, which can proceed a message statement. I think it's not a good way to propagate every single exception up to the UI layer, but I want to show the error message to the user, which shows him in detail, what's going wrong (i.e. "no material consumptions found for material ABCDE").
This is going very complicated. Say, there is a method, calling a method, calling a method which calls a method (which means, there is a calling tree which is getting wider and wider, the deeper you get into the tree, the wider it gets) and each tree node has to collect all possible exceptions of each deeper node (=method call). This causes a result for the first method call like this:
try.
(method_call)
catch zcx_(from method 1)
catch zcx_(from method 11)
catch zcx_(from method 12)
catch zcx_(from method 13)
catch zcx_(from method 14)
catch zcx_(from method 2)
catch zcx_(from method 21)
catch zcx_(from method 22)
...
endtry.
Explanation:
The digits of the method numbers may represent the layer (method 11 is the first method in layer 2 which is called by the first method in layer one, etc.)
And now (at long last) my question: How can I solve this? Which is the most intelligent way for user message preparation, deep into the call stack?
Thank you all for preparating me for the future