Skip to Content
Author's profile photo Florian Pfeffer

UML Class Diagram Export to XMI format with ABAP standard classes

Introduction

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

/wp-content/uploads/2015/02/uml01_645151.png

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.

/wp-content/uploads/2015/02/uml02_645218.png

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.

  1. Start the program and enter a class (e.g. CL_UML_CLASS_SCANNER) which should be exported.
    /wp-content/uploads/2015/02/uml03_645219.png
  2. Choose the required XMI version.
    /wp-content/uploads/2015/02/uml04_645220.png
  3. Import XMI file to a supported UML tool.
    /wp-content/uploads/2015/02/uml06_645227.png
  4. Finished
    /wp-content/uploads/2015/02/uml07_645228.png

Conclusion

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.

Assigned Tags

      12 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Florian,

      I think it's better if you add the SAPLink file (.NUGG). 🙂

      BR,

      Suhas

      Author's profile photo Florian Pfeffer
      Florian Pfeffer
      Blog Post Author

      Hi Suhas,

      everyone wanna have nuggets 😉 .

      I attached it beside the plain text coding now.

      Best regards,

      Florian

      Author's profile photo Jacques Nomssi Nzali
      Jacques Nomssi Nzali

      Hello Florian,

      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.

      regards,

      JNN

      Author's profile photo Florian Pfeffer
      Florian Pfeffer
      Blog Post Author

      Hi JNN,

      thx for the feedback.

      I use Enterprise Architect.

      Nice that you could use some of the coding.

      Best Regards,

      Florian

      Author's profile photo Former Member
      Former Member

      Nice addition for UMAP 😉 cool stuff thanks, unfortunatly i don't have sp8 so i need to downport your pogramm a little 🙂

      Author's profile photo Former Member
      Former Member

      may i reuse some of your coding for my UML 2 Abap Project? Could solve my roundtripping problem..

      Author's profile photo Florian Pfeffer
      Florian Pfeffer
      Blog Post Author

      Hi Mathias,

      of course you can use it.

      Best Regards, Florian

      Author's profile photo Former Member
      Former Member

      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.

      "some easy changes" .... Nahhh! 😉

      Author's profile photo Florian Pfeffer
      Florian Pfeffer
      Blog Post Author

      Do you think it is not easy? 😉

      Author's profile photo Former Member
      Former Member

      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:

      • 2103687 - New implementation of JNet and JGantt in SAP GUI for Windows
      • 2105752 – Abap corrections for note 2103687
      • 2103687 New JNet and JGantt
      • 2105752 AbapCrrctns4Note2103687
      Author's profile photo Omar SALGADO
      Omar SALGADO

      Hello Experts

       

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

       

      INTERFACE lif_parameter.
      ....
      METHODS get_parameter
      IMPORTING iv_parameter_name TYPE selname
      RETURNING VALUE(rv_value) TYPE string.
      ....
      ENDINTERFACE.
      
      
      METHOD lif_parameter~get_parameter_so_tab.
      
      DATA(lt_parameter_flt) = FILTER #( mt_parameters WHERE selname = iv_parameter_name ).
      DELETE lt_parameter_flt WHERE low IS INITIAL AND high IS INITIAL.
      rt_so_value = VALUE #( FOR ls_wa IN lt_parameter_flt ( sign = ls_wa-sign option = ls_wa-option low = ls_wa-low high = ls_wa-high ) ).
      
      ENDMETHOD.

       

      Author's profile photo Florian Pfeffer
      Florian Pfeffer
      Blog Post Author

      Are you sure that you are using an ABAP 7.50 system? The filter expression is available since NW 7.40 SP08.