2020 Feb 14 4:44 AM
Good morning experts!
In the client where I work, there is a big problem with SAP's user exits. I try to explain, the client have several projects which are developed at the same time, so when one project needs for example the user exit ZXQQMU20, the second project is delayed until the first project ends because of locking objects. Also we have the problematic that if there's any productive error and there is a project which is modifying the user exit, the project has to stop, the productive version has to be recovered and start again.
I've been thinking in which can be the better solution to stop this locking problem, and I have think in the creation of several includes inside ZXQQMU20 for inserting code...
What do you think it could be the best solution for solve this problem? Do you think the idea of new includes could be a good solution?
Thank you very much in advance.
Regards,
Rebeca
2020 Feb 14 5:32 AM
In my current project, we have solved this problem for good by making use of the decorator design pattern.
Basically, we turned every user exit into a Z-BADI.
Here are the steps involved:
If you do that:
This is the basic idea.
In my current project, we don't even have a distinct interface for every user exit. Instead, I have created a generic interface & Z-Table shared by all user exists, and the parameters are passed over a container object (property container design pattern).
But if that's too complicated, creating a distinct interface for each user exit (as described above) also works.
2020 Feb 14 5:32 AM
In my current project, we have solved this problem for good by making use of the decorator design pattern.
Basically, we turned every user exit into a Z-BADI.
Here are the steps involved:
If you do that:
This is the basic idea.
In my current project, we don't even have a distinct interface for every user exit. Instead, I have created a generic interface & Z-Table shared by all user exists, and the parameters are passed over a container object (property container design pattern).
But if that's too complicated, creating a distinct interface for each user exit (as described above) also works.
2020 Feb 14 6:10 AM
And you did not replace the Z-BAdI by a Factory Design Pattern ?
Nice to see Design Pattern in solution !
2020 Feb 14 6:25 AM
2020 Feb 14 7:25 AM
frdric.girod Factory, and some further patterns are also in work. I simplified the solution when writing
2020 Feb 14 7:26 AM
maheshkumar.palavalli it is not so complex, Design Pattern is big word on simple idea.
2020 Feb 14 7:32 AM
Mahesh; if a BADI solves your problem, you can use a BADI as well. However; my solution provides some further advantages in my case; such as:
Spoons for soup, forks for steak - both are valid 😉
2020 Feb 14 9:18 AM
kerem.koseoglu
Hi Kerem,
your approach with a Z-table sounds intriguing and I'd very much like to pick your brains about it if you don't mind as it might be relevant for an issue I've been wondering about for quite some time (see my answer below)! Rebeca's thread is however not the right place to do it, so would you mind following me so that we can exchange direct messages?
Thanks and Cheers
Bärbel
2020 Feb 14 10:17 AM
Sure 8b889d0e8e6f4ed39f6c58e35664518f , following right away!
2020 Feb 14 11:49 AM
2020 Feb 14 11:54 AM
2020 Feb 14 5:34 AM
rebeca,
Yes you can multiple includes and inside each include write the necessary checks which should satisfy the respective scenario.
Also while writing the code for include use IF FOUND keyword so that each development will not disturb other developments when moved to different systems.
You can follow the below link for include SYNTAX.
Regards!
2020 Feb 14 5:55 AM
The typical problem with the "Include" approach is; somebody will eventually write CHECK or RETURN and prevent the code in other includes to execute.
That risk also exists if you don't use includes, obviously.
My class-based approach (above) prevents this risk too.
2024 Jul 08 5:02 PM
Hello, is it possible to have the structure of your specific table?
(I would take the code from the central class which manages the Z-Table too but I fear that you will refuse it)
2020 Feb 14 5:46 AM
Thank you so much for your advices! I have also thought about the possibility of Z table creation, but instead with classes, use functions, and only call if the function exists for the develoment. I have to bear in mind all the development which already exists on the users ... I'm not sure what will be the technical best solution....o maybe all of them are goods solutions? Thanks once more time
2020 Feb 14 5:57 AM
Functions belong to the old era (exception: RFC purposes). Using classes instead of function modules has many well-documented advantages; you can check over your favorite search engine 😉
2020 Feb 14 6:11 AM
I know, but what I've seen in this client is that not all the developers know how to use classes ..so maybe If we change in that way we will finally have lot's of problems....
2020 Feb 14 7:42 AM
It would be a good idea to teach them... I wouldn't let my team insist on bikes while their Tesla's are collecting dust in the garage 😉 But, as mentioned, an experienced architect with solid OO-ABAP and design pattern knowledge should be leading them. Otherwise, accidents / anti-patterns might surface.
2020 Feb 14 6:00 AM
Kerem, thanks for your advice, it is clear that if we finally decide any solution, it will be necessary to teach all the developers with things to do and not to do.... I can't decide what will be the best option.... I think I should study all the solutions in detail...Again thanks
2020 Feb 14 7:34 AM
It helps to have a technical team leader with architectural skills (OO-ABAP) to determine & enforce such rules 😉
2020 Feb 14 12:39 PM
Rebeca - veering off-topic for a second here ...
Instead of responding to given answers with your own but then not properly threaded answer, please use "Comment" on the answer you actually want to reply to like Fred, Mahesh and I have done when we replied to Kerem's answer upthread. Makes it a lot easier to follow the discussion and is the intended use for the options we have available in Q&A!
This is actually spelled out in and next to the editor box where answers are meant to go:
Hope this helps!
Cheers
Bärbel
2020 Feb 14 6:42 AM
Try creating a BADI, call that BADI in your user exit. BADI offers interface, multiple implementations and is filter dependent. So it's just a matter of creating implementation for the custom BADI whenever it is required just like any standard BADI.
As you mentioned there are multiple projects running right, so create an implicit enhancement inside the user exit and inside that call this badi. you can remove it any time and directly call it inside the user exits when it becomes free of your current locked transport.
-Mahesh
2020 Feb 14 7:26 AM
Rebeca - I raised a comparable question for the VA01 enhancement in SAPMV45A in 2017 and the discussion in that thread might be helpful for your issue as well:
What are best practices to allow multiple developers to change the SAPMV45A enhancement?
The bad and hopefully not too dispiriting news is, that we haven't yet made any progress on that front and things are still where they were 3 years ago just with even more lines of code all told ....
Cheers
Bärbel
2020 Feb 14 9:32 AM
The general concept is to code a tiny front driver which calls implementations dynamically once for all. This should be agreed by all teams. Any implementation which is later created can be plugged without changing the driver.
For instance, the driver may implement the calls via a customizing table as Kerem said.
Or via custom BAdI as Mahesh said.
Or via BRF+ so that to allow very dynamic conditions.
This "driver" should be coded once for all and transported first without any implementation up to production system, to avoid issues with transports of implementations.