Technical Articles
ABAP in jEdit – Offline ABAP Editor
Do you also keep your ABAP snippets in some kind of ASCII-files using notepad or other editors to look them up? If you want to lookup your ABAP code when you are offline everything is displayed in one color (mainly black).
ABAP in eclipse can not be used to display ABAP code offline, because you are not connected to an ABAP project. That is because the pretty printing is done using the ABAP back end. Only in that way ABAP in eclipse is able to keep track of different ABAP versions.
So I was very happy to find out, that with jEdit – a programmers editor written in java – I can do keyword high lightning as well as folding and indention regarding a statement block.
Everything is controlled by a so called mode. It is a xml file which tells the editor, which are the keywords and how the folding and indention is done. Nathan Jones started with some small configuration. I added the keywords regarding ABAP 7.31 as well as folding and indention.
In the first picture you see a typical jEdit coloring. If you want the ABAP coloring, you have to adjust that manually in the settings, because the color itself can not be controlled by the mode.
Finally you have to edit the catalog file, which connects the file extension with the mode. I have chosen .abap as well as the ABAP in eclipse extension .asinc. You add your own. The abap.xml file you put in the main directory c:/programs/jedit/modes. There you also find the catalog.xml, which you have to edit.
What do you think. Is this useful for you? What are your experience with that solution? Do you know other editors to display/edit ABAP?
I've done all my offline viewing in wordpad or the like. I'd be very interested in what others may wish to say/ comment on this subject.
Neal
I use Notepad++ with userDefinedLang/ABAP
The ABAP code look like this:
//
Above output is good enough, but I tweaked the definition so that code highlighting is just like New ABAP Editor.
//
me too, i use notepad++ (Y)
And me.
Hey Manish,
from ur comment I think it is possible to maintain the ABAP code in pretty printing mode usin notepad++.
But Can I do offline ABAP coding & maintain same in notepad++?
Hi Nikhil
Pretty printing is different.
Pretty print takes care of uppercase/lowercase and code indentation, whereas syntax highlighting is to apply color to keywords, operators, literals, comments.
ABAP Editor applies syntax highlighting on presentation server, whereas pretty print needs help from application server.
Text editors like jEdit and Notepad++ will apply syntax highlighting. They can also help in auto indentation, but not lowercase/uppercase conversion.
When you see highlighted code in Notepad++, it is a text file, and you can add more code to it. New text will be highlighted automatically.
Thanks for the clarification.
🙂
I can not compare to notepad++, but if somebody wants try alternative I use PSPad 🙂
Even though it is lightweight and portable, it has many usefull functions. I really like its "code compare" function which shows side by side 2 codes with easy to spot differences highlight.
Everybody has a text editor of choice, and they tend to stick to it as long as desired features are present in it.
Notepad++ has plugin based architecture, and using a bundled plugin, it is possible to compare and show results side by side.
I see I should give it a try (notepad++). It might have some better features.
Here is just screen from PSPad, to compare comparison 😀 :
Hi Manish,
I installed notepad++ I copied the code from ABAP but color difference not coming need to put any excel file for this please teach me how to use it...
I have written steps in ABAP Syntax Highlighting in Notepad++ .
Thanks for sharing, that makes life a little easier. 🙂
Today I installed jEdit and tried to apply the edit mode.
For some reason, system did not allow me to edit the Catalog file, not from Notepad++, jEdit or any other editor even when jEdit client/server was not running. I renamed it to catalog2, and editor was not able to save changes. There was something about the modes directory. I copied the catalog file to desktop, added the ABAP specific line, saved and then copied the modified file to modes folder, it worked.
After applying the mode, i was able to get highlighting just like your screenshot.
jEdit definitely has much more options than Notepad++.
And the edit mode has much more options than Notepad++ UDL.
Thanks to you, I'll try using jEdit when Notepad++ is unable to do the job and VI is too scary to work on.
In the process I noticed that multiple types of keywords can be defined in edit mode. (keyword1, keyword2, keyword3), each having different color according to color scheme.
However, the New ABAP Editor has only one color for any keyword.
Menu > Utilities > Global Options > Syntax Highlighting can be used to redefine the color mappings, so that the look-and-feel of code gets closer to New ABAP Editor.
Since the syntax highlighting setting is global, the changes would mess up the look of other file types too.
To counter this, I tried using Editor Scheme plugin. Theoretically, it should be able to create abap specific color scheme.
Practically, opening the Scheme Editor results in BeanShell exception java.lang.NumberFormatException. In future I'll try the steps on a newer version of jEdit/EditorScheme.
EDIT: Could you please point me to profile of Nathan Jones?
Hi Manish,
thank you for your feedback. I don't know how to reach Nathan Jones. The basis for my work I found in the jedit community where he was cited as author.
Cheers,
Peter
Yes i did come across that line abap.xml v1 by Nathan Jones.
I don't mean to ask him anything. Just wanted to see what else he has published on SCN.
Hi Manish,
there are three Nathan Jones in SCN: Nathan Jones, Nathan Jones and Nathan Jones. I don't know if one of this three ist the author. They all should have been notice now by email, that they were cited here. Let's see who is the one ... 🙂
Peter
SEO wise it could be the third. SCN Activity wise he is the one who looks like a coder.
I notice you are all puzzled as to the exact whereabouts of Nathan Jones.
As it turns out, so are Diana Ross and the Supremes. And Bannanarama.
http://www.oldielyrics.com/lyrics/the_supremes/nathan_jones.html
Hi
I'm the Nathan Jones of the Jedit plugin fame. - Hello.
I "borrowed" the initial set up from VI module that was lurking about.
I no longer use JEdit and so I've not revisited this for a long while.
Thanx for the mention though.
Nath
PS yes I am a coder and unfortunatly the song isn't about me 😆
Hi Nath,
thank you for coming along and solving the questin who you are.
Peter
My educated guess was correct. 🙂