New ABAP Doc Features with NetWeaver 7.5
In my document ABAP Doc I gave you a short overview about ABAP Doc and how you can use it.
In this blog, I would like to explain to you how you can export your ABAP Doc from the ABAP system and how you can synchronize your ABAP Doc comments with the short text descriptions in classes, interfaces and function modules. I hope you like these two new features which are available with SAP NetWeaver Application Server ABAP 7.5.
How can you export your ABAP Doc from the ABAP server?
We introduced a new functionality to ADT that allows you to export ABAP Doc of your classes and interfaces to local html-files.
In order to export your ABAP Doc you can proceed as follows:
- Choose any package, class or interface in Project Explorer and choose „Export …“ from the context menu
- In the wizard, choose “ABAP Doc”
- On the next page of the wizard you can add further classes, interfaces or whole packages and define the root directory where the html files shall be stored in your local file system.
If you choose a whole package, the ABAP Doc of all classes and interfaces of this package will be exported.
For each class or interface a dedicated html file is rendered that is located in the folder representing the package name.
If you want to adapt your own design to the exported html-pages, you can overwrite the stylesheet stored in htmldesign\stylesheet.css.
How can you synchronize ABAP Doc with short text descriptions?
Up to now, ABAP Doc and the classic short text descriptions you know from the SAP-GUI-based Class Builder or Function Builder were not linked to each other. This means, users who are still working with SE24 or SE37 and specify the short text descriptions there, didn’t see the documentation written by their colleagues in ABAP Doc and vice versa.
Now, you have the possibility to define or change the short texts of classes, interfaces and function modules by using ABAP Doc. This includes also the short text descriptions of attributes, methods, parameters and so on.
This can be reached by classifying a paragraph in ABAP Doc as a short text. The short text shall be a brief summary of what your element is about. A short text in ABAP Doc looks like this:
“! <p class=”shorttext”>Returns all sales orders</p>
This is just a classification of a text in your ABAP Doc. Nothing special about this so far. However, if you also add the classification „synchronized“ to your short text, the text defined in your short text tag will be taken over to the short text descriptions of SE24 or SE37.
Even more, if a colleague updates the short text in SE24 or SE37, the short text in your ABAP Doc will be updated without touching the rest of your ABAP Doc.
A synchronized short text in ABAP Doc looks like this:
“! <p class=”shorttext synchronized”>Returns all sales orders</p>
If you enable the synchronization of the short-text-tag, the length of its content is limited to the length of the corresponding short text description in SE24 or SE37. If you use more than the allowed characters you will get a warning.
The new format of synchronized short texts is also considered if you import ABAP Doc from short text descriptions.
Then the imported texts are automatically synchronized. Additionally, the attribute „lang“ will be added to your paragraph.
“! <p class=”shorttext synchronized” lang=”en”>Returns all sales orders</p>
This attribute will indicate the master language of your development object. The short text should be maintained in the master language, to ensure a correct synchronization. It is not possible to specify other languages than the master language; the editor would show you a warning if you do so.
Hello Michael,
I like the idea of the synchronized shorttexts.
Question:
Hello Michael,
If Stefan with ABAP Doc means ABAP longtext, then I'm wishing too this feature.
It comes handy and must not do the same thing twice 🙂
Wen such plans are existing, will be possible to export them also in HTML files, perhaps along with ABAP Doc from the coding files and so creating a complete documentation of the concerned developing object.
cheers
Hey Michael,
nice new features, but there are a few points which would be nice to have..
Regards
Simon
Hi Simon,
very nice ideas. Thanks for the Feedback.
Let's see which features will be implemented with the next release.
Regards,
Thomas.
Hi Thomas,
I would like to add my wish to the "nice to have" list:
Regards,
O.
Hi Ondrej,
we are working on a feature to integrate hyperlinks on development objects within the ABAP Doc comment. You can then write your sample code in an own class/report and link with the ABAP Doc.
Isn't this the better option then writing sample code direct in the ABAP Doc?
Regards,
Thomas.
Some companies have regulations concerning coding that don't apply or are less strict than those concerning comments when transporting something to a productive system.
Hi Thomas,
feature you are suggesting is also interesting, and I like it. However it is always one more click. Especially when the code example would be only say up to 5 lines long, having it in the ABAP Doc would be more convenient.
Have a nice day!
O.
Hi Thomas,
I have just looked into the Netweaver ABAP roadmap, and find that there are no subsequent release of new features to ABAP Doc. During my current implementation, I'm planning to have my team use ABAP Doc extensively, especially focusing on reusable components.
The outstanding questions is browse-ability of these reusable components. An overview page of the developed elements would be useful. From collaboration perspective, the team can browse what are the built components out there that can be reused.
Could you be kind enough to let me know if such features is in plan? If not, I have to start looking for alternative to enable browse-ability of built components documentation. The exported HTML documents are useful, it's only lacking one overview page. =)
Looking forward to hear from you.
Thanks.
Aldern
Hi Michael,
Any special reason for this to be only 7.5 and not 7.4? - I really cannot see anything in particular 7.5 delivered as core functionality to enable ABAP Doc generation...
Is there a date for a 7.4 patch or release? - Otherwise is another year or so until first customers update to 7.5. (at least around this area I live)
Cheers,
Dan.
Hi Daniel,
sorry, but actually we have no plans to downport this feature to releases < 7.50.
Regards,
Thomas.
Hi Michael,
will it be possible to get the ABAP Doc for method parameters in the ABAP Element Info view. I think this would be pretty handy when changing a method that has become very long.
Regards,
Florian.
Hi Florian,
Do you know the feature to show the element info for the current method implementation? Within a method implementation, you can open it via context menu entry "Source Code > Show Method Information" or via short-cut Alt+F2.
Maybe, this helps.
Regards,
Michael
Hi Michael,
yes I know that feature and use it occasionally.
I had my idea because I have the element Info pinned and synchronized with the active editor so I always see the element info for the element which my cursor sits on. I would have loved to see not only the type of parameters but also its documentation (just for completeness and consistence with other variables)
Regards,
Florian
Hi,
Is there any way that we can generate the ABAP doc if we are not using Eclipse ?
Regards,
Helder
Hi Helder,
no, this feature is only available in Eclipse.
Where do you want to have it?
Regards,
Thomas.
Hi Thomas,
Thanks for such a quick reply.
Ideally I would have loved to have it in the ABAP workbench.
I was happy when I saw the compiler was able to interpret it, so I thought maybe this had been now made available in the abap workbench.
Regards,
Helder
Hi Helder,
you know we are not investing anymore in new features in the ABAP workbench.
ABAP IDE of choice is eclipse. So my strong recommendation is to switch to eclipse.
Regards,
Thomas.
Hi Helder,
The position of your ABAPDoc is wrong(sorry for stating the obvious) 😉
ABAPDoc is not a substitute for code-comments and you cannot use them wherever you want. Read this: http://help.sap.com/abapdocu_740/en/abendoccomment.htm
Before moving to AiE, i wrote the ABAPDoc in GUI and worked just fine. But i must admit it is way more comfortable to write them in Eclipse 😎
Thanks Suhas.
I was just kind of testing to see if I could get it generated 🙂
About AiE, to be honest I did gave it a try a while back. I am sure it has improved a lot but back then I was not convinced.
Will give it a try again.
Regards,
Helder
I was also sceptical about AiE in the beginning. But I have been using it for 4 months and I don't think I can revert back to SE80 🙂
I just love the "Quick Fix" functionality in Eclipse. Makes refactoring a child's play. Definitely worth a try.
Hi Guys,
Actually you can generate the ABAPDoc from SAPGUI if you have the JNet plugin 🙂
What I have not figured out is why the UML is not displayed in the ABAPDoc 🙂
Will there be a way to automatically (or with a quick fix) generate the documentation skeleton? As of now it is quite tedious to maintain the documentation of a method and its parameters, even with a template because I need to copy the parameters' and exceptions' names. For this task I switch to the SAP GUI, not very handy.
Hi Florian,
yes, this quickfix is available:
See ABAP Doc for further details.
Regards,
Thomas.
Hi Thomas,
Thanks for your quick answer. I didn't know this feature, however it is not as complete as I expected. It would be great if the tags "<p class="shorttext">...</p>" were added at the same time so that short descriptions are easily synchronized. At the moment I guess I'll have to add those manually everytime I maintain the documentation so that people still using the SAP GUI can read the documentation.
A few other suggestions that I think are quick wins:
- Add an option so that when we create a method (or any component with documentation) using the quick assist, the documentation template is automatically generated with parameters and exceptions.
- Initialize the short documentation of parameters with the DDIC description just like in the SAP GUI.
As of now I still find it quite tedious to maintain basic documentation even with the existing quickfix - still quicker to do it in SAP GUI rather than in Eclipse.
Regards,
Florian
Hello Micahel,
When we export the ABAP Doc for a class to an html file, we don't see the documentation that we added for local variables. We get the doc for methods , attributes, parameters etc but what ever we added before local variable declarations are not in the html file. Are we doing something wrong or is this how it works ?
Thanks & Regards
Aniz
Hi, is there a plan to add features to ABAP Doc to export local classes (including local test classes), function modules, and programs (and its local subroutines/classes) as well ?
I ran into a situation that the class and method names are not meaningful enough (as it is limited up to 30 characters) and I was asked to put a comment for documentation purpose. It'd be great if that could be exported as ABAP Doc as well.
I would also appreciate if we could do that.
I am also in such a situation I could use this functionallity to drop ABAP documentation for local classes.
Same for me. I would like to to generate the technical documentation from the ABAP Doc, and it would be great if this is complete, including local classes and local testclasses.
I had trouble inserting the syncronized short text without " lang="" "
This worked for me on class level:
"!<p class="shorttext synchronized" lang="de">SAP GUI Fortschrittsanzeige</p>
Best Timo
Hi Timo,
What do you mean? What kind of issued did you face?
Kind regards,
Michael
I think it would be very useful if the auto-generated ABAP Doc could include the data element description, just as it does in SE24. I'm a bit surprised this isn't already happening, should be feasible?
Aside from that, there are some minor bugs in the generation. Example:
i_test and i_test3 were added in SE24 - note the Data Element description for i_test, this is what I'm talking about above.
However I then added i_test2 in Eclipse and it doesn't get generated, even after deleting and generating the ABAP Doc from scratch.
Hi Mike,
Did you try to use the quick-fix to add new parameters to an existing ABAP Doc comment?
Just select the ABAP Doc comment and choose the quick-fix functionality and choose the quick-fix “Add missing parameters to documentation”.
I hope this helps.
Kind regards,
Michael
Hi Michael,
I don't get this quick-fix option on my Eclipse. Oxygen ADT 2.83 ABAP 7.5 SP6. To reproduce:
Add a method with a parameter in SE24.
Go to Eclipse and:
It's a minor bug and I can live quite happily with it. I would much rather see the Data Element description in the generated ABAP Doc.
Thanks & regards,
Mike
Hello,
“Add missing parameters to documentation” or “Remove documentation for not existing parameters” entries may not appear in Quick-fix as expected if you declare several methods with the same instruction METHODS, I have the same issue when try to update my ABAP Doc.
In the example below, “Add missing” will be shown for the first method, and “Remove documentation” for the second will appear in Quick-fix.
In the second example, sometimes entries do not appear as expected. I hope a fix soon.
Since July 2018 the ABAP Doc has been enhanced.
The additional code <p class="shorttext synchronized" lang="en"></p> will be added to the parameters in ABAP Doc.
When I use CTRL+1 to add the missing parameters then the additional code will not be generated. See the following example with the parameter IV_WERKS.
I think that the original question of Mike is not answered. I’m missing also the feature like in the SE80 where the descriptions of the parameter types will be added automatically.
Eclipse generates currently the following ABAP Doc.
I would prefer that it generates instead the following one. This would save a lot of effort.
Could be great if ABAP Doc will export all attributes of a structured type:
Will be there the chance to use ABAP Doc in source Code for reports in eclipse, so we can export a full documentation of our ABAPs. Or have we still use the se38-documentation ?
@Michael Schneider,
Is it possible to generate Class method Documentations using ABAP DOC?
Thanks!
Hello,
like Chairat Onyaem mentioned before, is it possible to export abapDocs from local Objects?
Would be a really important improvement!