2023 Jun 01 4:00 PM
Hi All!
I'm currently implementing a simple logic in the SE38 customer exit include ZXSEUU08 which just checks if an entry exists in a Z-table and if it does, displays a warning message for the user before an object can be displayed or edited:
If possible, I'd like to get the same warning message when an impacted object is opened via the ADTs in Eclipse. I already know that the code is actually accessed when I open a program or include via ADTs as this is clearly visible in a dynamic logpoint:
The LV_EXISTS is set to 'X', so if the code is opened in SE38, the warning message gets displayed. Is there a way to make the message show up in the ADT as well?
Thanks much and cheers
Bärbel
2023 Jun 06 1:19 PM
There's two options I can see. One is to write the message to the console in ADT (see Link) You would have to put your check into a class for this to work. The problem would be that the developer could easily ignore the message in the console. And that you need to be a on 751.
The second would be to write an Eclipse plug-in which does the check whenever you open some source code.
2023 Jun 06 12:36 PM
Bumping my question as it seems to have flown under the radar (based on just 26 views in four days).
I'm really interested in understanding how the (old) GUI-based exits and the ADT in Eclipse interact with each other.
Thanks much and cheers
Bärbel
2023 Jun 06 1:19 PM
There's two options I can see. One is to write the message to the console in ADT (see Link) You would have to put your check into a class for this to work. The problem would be that the developer could easily ignore the message in the console. And that you need to be a on 751.
The second would be to write an Eclipse plug-in which does the check whenever you open some source code.
2023 Jun 06 1:48 PM
I follow Matthew for the console, but wonder if the user will see it.
2023 Jun 06 2:21 PM
Thanks, Matt!
We are on NW 750 so the console isn't an option and I don't have a clue about Eclipse plug-ins.
But then, I'm one of the few who actually works with Eclipse now and then, so it's not a big issue right now if it doesn't work. I'm mostly suprised to a) see the old customer exit getting executed at all when working via Eclipse and b) then not displaying the (warning) messages triggered in that code. This seems to be a bit of a gap to me - as if the message just goes AWOL between the backend SAP-system and Eclipse. Given how much Eclipse and the backend SAP-system "talk with each other", I don't quite get, why messages don't find their way back to be displayed to the user.
Cheers
Bärbel
2023 Jun 06 2:52 PM
2023 Jun 06 2:52 PM
Eclipse accesses the application server via a REST API. Messages are a strongly SAPGui thing. Like with BAPI/RFC (or webdynpro), there's no scope for SE91 messages to be handled.
I don't think there's any easy way of achieving your objective, I'm afraid.
2023 Jun 06 3:13 PM
frdric.girod
Hi Fred,
to answer your question: no, I didn't try raising an exception as that wouldn't really do what I want to achieve. The purpose of the check is simply to make developers (and potentially consultants) aware that there is something to be tackled when the piece of code gets changed next, so that it can be included in an upcoming effort estimation. The short message leads to more information in the long text with what to be on the look-out for and correct.
I may for example use this logic to highlight S/4HANA related issues in our Z-code which can already be fixed like the "interesting stuff" I happened upon a few years back related to IS-H components.
It should really just serve a s heads-up and not prevent whatever activity a developer wants to do. Which is why I went with a warning message.
Added: the check logic will be active in dev, test and prod, so that it doesn't matter, where somebody from IT accesses the code. Because of that, the logic has to work in the GUI as only DEV-systems are accessible via Eclipse which - as mentioned above - not many are currently using anyway.
matthew.billingham
HI Matt,
that's what I feared after my search for an answer not really finding anything relevant.
Thanks both for your answers!
Cheers
Bärbel
2023 Jun 06 3:57 PM
A workaround - it's a bit of development, but at least it's ABAP! Instead of issuing a warning message, send the developer an email with the needed information. cc- his/her manager.
Just a thought.
2023 Jun 07 7:29 AM
matthew.billingham
Thanks for the idea! However, sending an email would be a bit of an overkill as this would then happen each time somebody (developer or consultant) looks at the code, so not really practical for our use case and especially as at least 90% of access to the code will happen via the GUI where the warning message works well.
I'll just leave this as is - at least for now.
Cheers
Bärbel
2023 Jun 09 2:01 PM
And here's a plugin solution.
https://blogs.sap.com/2023/06/09/a-simple-eclipse-plugin-to-call-a-fm-when-an-editor-is-opened/
2023 Aug 28 9:43 AM
Even though I didn't make use of Matt's suggestions, I marked his answer as accepted and hope that others might find it helpful!
Thanks to both matthew.billingham and frdric.girod for responding to my question!
Cheers
Bärbel
2023 Jun 06 1:20 PM
What happens in Eclipse if you change that warning to an error?
2023 Jun 06 2:14 PM
If I change it to an error, I get errors in Eclipse when I try to open one of the impacted sources:
When I switch it back to a warning message, the code opens fine but w/o displaying the message.
2023 Jun 07 7:53 AM
I loop on the Exception again.
I wonder if you do an enhancement on class CL_SEDI_ADT_RES_SOURCE method GET. To raise an CX_ADT_REST exception