Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

What to do when user-exits are locked for several developments

former_member384574
Active Participant
0 Kudos
3,018

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

1 ACCEPTED SOLUTION
Read only

keremkoseoglu
Contributor
2,465

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:

  • Create an interface for the user exit in question (SE24) with a single EXECUTE method which imports / exports parameters of the exit itself.
  • Create a customizing Z-table to enlist the classes to be called from the user exit. This table shouldn't have a MANDT field so you can put the definition into workbench requests.
  • For each distinct functional requirement, create a class (SE24) implementing the interface, and write your functional ABAP code there + put your class into the Z-table.
  • The user exit itself should SELECT * from the Z-Table, dynamically create an object for each class, cast to the interface and call the EXECUTE method.

If you do that:

  • You can send the user exit + Z-table and interface to the live system immediately.
  • For every distinct functional requirement, create a class, make a definition in the Z-table and put them into the same request.
  • Because the implementation requests are separate, you can send them to the live system on different points of time without affecting each other.

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.

23 REPLIES 23
Read only

keremkoseoglu
Contributor
2,466

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:

  • Create an interface for the user exit in question (SE24) with a single EXECUTE method which imports / exports parameters of the exit itself.
  • Create a customizing Z-table to enlist the classes to be called from the user exit. This table shouldn't have a MANDT field so you can put the definition into workbench requests.
  • For each distinct functional requirement, create a class (SE24) implementing the interface, and write your functional ABAP code there + put your class into the Z-table.
  • The user exit itself should SELECT * from the Z-Table, dynamically create an object for each class, cast to the interface and call the EXECUTE method.

If you do that:

  • You can send the user exit + Z-table and interface to the live system immediately.
  • For every distinct functional requirement, create a class, make a definition in the Z-table and put them into the same request.
  • Because the implementation requests are separate, you can send them to the live system on different points of time without affecting each other.

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.

Read only

2,465

And you did not replace the Z-BAdI by a Factory Design Pattern ?

Nice to see Design Pattern in solution !

Read only

0 Kudos
2,465

Is it not easier to to just create a BADI and call that BADI over there? I believe it offers the same functionality as yours..

Read only

0 Kudos
2,465

frdric.girod Factory, and some further patterns are also in work. I simplified the solution when writing

Read only

2,465

maheshkumar.palavalli it is not so complex, Design Pattern is big word on simple idea.

Read only

2,465

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:

  • Instead of defining a new BADI + Interface for each User Exit, I can go over a central manager class + Interface (less development time)
  • In the Z-table; I can determine the execution order
  • In the Z-table; I can mark classes as active / passive in case I need to bypass them temporarily
  • In the Z-table; I can put additional fields to define which class is called when
  • In the central class managing the Z-Table; I can do central authority checks, logging, etc.
  • etc etc...

Spoons for soup, forks for steak - both are valid 😉

Read only

0 Kudos
2,465

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

Read only

2,465

Sure 8b889d0e8e6f4ed39f6c58e35664518f , following right away!

Read only

2,465
kerem.koseogluI doubt about the points less dev. time(arguable), active passive(you can activate deactivate badi impl. anytime), when the class should be called(filter badi?).But agree with execution order & logging,authcheckss.. Even in my project we are having a very similar design like you mentioned with order of calling :):D I didn't understand that "Spoons for soup, forks for steak" 😄 😄 , yeah both are valid 🙂 just replied as your original answer and OP's requirement could be solved with a simple BADI.-Mahesh
Read only

2,465
frdric.girod Couldn't agree more, but I've never said it is complex 😉 I actually love to code using patterns and my answer was just meant to be a simple approach to a small problem..
Read only

former_member1716
Active Contributor
2,465

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.

INCLUDE

Regards!

Read only

2,465

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.

Read only

0 Kudos
2,173

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)

Read only

former_member384574
Active Participant
0 Kudos
2,465

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

Read only

0 Kudos
2,465

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 😉

Read only

0 Kudos
2,465

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....

Read only

2,465

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.

Read only

former_member384574
Active Participant
0 Kudos
2,465

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

Read only

2,465

It helps to have a technical team leader with architectural skills (OO-ABAP) to determine & enforce such rules 😉

Read only

2,465

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

Read only

maheshpalavalli
Active Contributor
2,465

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

Read only

BaerbelWinkler
SAP Champion
SAP Champion
2,465

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

Read only

Sandra_Rossi
Active Contributor
0 Kudos
2,465

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.