UML Class Diagram Export to XMI format with ABAP standard classes
Did you ever have the situation that you are working on a customer system landscape were you wanted to export an UML class diagram for a package, but the necessary JNet was not installed? I had that situation several times now and it was always a big effort to install JNet or it was not done, because it was to much effort to add the configuration to the automated software installment process in the customer landscape.
Therefore I decided to write a little program which allows me to export UML class diagrams to an XMI format, which can be then used for an import to an UML tool. For me that is a big advantage for the documentation of the system functionality, because I must not create/adjust the class diagrams manually in the UML tool.
The problem with missing JNet …
In the ABAP Workbench the functionality is available to display an UML Diagram (Context menu on package name -> Display – UML Class Diagram).
This functionality starts the report UML_CLASS_DIAGRAM which analysis (depending on the made settings on the selection screen) the classes/interfaces and tries to display them with JNet integrated in the SAP GUI.
In case JNet is not installed (not installed by default with SAP GUI) you get just a list of the analyzed objects, but not the diagram. The main problem is that without JNet the report cannot export the diagram for further usage.
The current solution for me to export an UML diagram w/o JNet …
I created a little report based on program UML_CLASS_DIAGRAM which uses the ABAP standard class CL_UML_CLASS_SCANNER, CL_UML_CLASS_DECOR_XMI and CL_UML_UTILITIES to export an UML Class Diagram to XMI format without JNet.
You find the sources in a SAPLink nugget file in repository https://github.com/pfefferf/abap_uml_class_diagram_export_to_xmi. Just import the SAPlink nugget. But please be aware that I did not invest so much time and effort to make it stable for each situation 😉 . Please consider also that the program was implemented on a NW 7.40 SP08 system, so if you wanna use the program on a system with a lower release some easy changes have to be done.
So I can do following now.
- Start the program and enter a class (e.g. CL_UML_CLASS_SCANNER) which should be exported.
- Choose the required XMI version.
- Import XMI file to a supported UML tool.
With a simple usage of exiting ABAP classes delivered with the standard installation it was possible to create an UML class diagram export in XMI format. This solves for me much time and I do not need to “fight” to get a JNet installation in customer environments. If you have any comments, please let me know.
I think it's better if you add the SAPLink file (.NUGG). 🙂
everyone wanna have nuggets 😉 .
I attached it beside the plain text coding now.
thanks for sharing.
which tool are you using that support XMI ? I implemented a plugin to export the UML class diagrams to PlantUML. The text format is easier to edit manually. I also consume the web service to display the image.
But this solution still requires JNet, so I have integrated the functionality within your report. Check the last report on this wiki page.
thx for the feedback.
I use Enterprise Architect.
Nice that you could use some of the coding.
Nice addition for UMAP 😉 cool stuff thanks, unfortunatly i don't have sp8 so i need to downport your pogramm a little 🙂
may i reuse some of your coding for my UML 2 Abap Project? Could solve my roundtripping problem..
of course you can use it.
Best Regards, Florian
"some easy changes" .... Nahhh! 😉
Do you think it is not easy? 😉
Look at following notes, Jnet & JGantt no longer in JRE 1.8, with those note no longer need to install them for your GUI but web-services will be called:
While trying to Activate the following code, I'm receiving error message Field "FILTER" is unknown...
I've imported the following NUGGET using SAP link.
My version of SAP is 7.50
Any help would be appreciated!!
Are you sure that you are using an ABAP 7.50 system? The filter expression is available since NW 7.40 SP08.