Skip to Content

Automation of Text Symbol Creation

Many times we are required to create text symbols for hardcoded texts, reason being that with text symbols translation becomes possible and then the same program can be used across different regions/countries with other languages.

Depending upon the number of the hardcoded text one has in his/her program text symbol creation can become either an easy or a difficult job. To create text symbol one can simply double  click the hardcoded text and it will ask if you want to create a text symbol, then you move to the text symbol screen where you save and return back.

As a part of a CI initiative my company we managed to automate this process. We simply execute a program (source code provided below) and provide it with the ‘PROGRAM NAME’ of which we want to create text symbol and that’s it! The program create the text symbols where ever its necessary.

The information on which text is required for translation is picked up from extended code check program. Also if you have yourself given a number to a hardcoded text and forgot to create a text symbol for it, the program would do it for you. If you already have some text symbols created and are adding new ones then the next number is picked up by the program.

Using this program we were able to cut down on the development time. When I am coding I do not worry if I have to create a text symbol for the text and surely save some CLICKS.

One can modify the code as per his/her requirement. Also if you have any suggestions or improvement please do let me know.


You must be Logged on to comment or reply to a post.
  • It’s a very nice idea, and good to hook into SLIN but let down by poor implementation.

    1. Modularisation is practically non-existant
    2. Commenting is sparse
    3. There is a syntax error at line 112.
    4. It isn’t usuable by customers with their own / name spaces, and can’t be used directly on function modules, classes and other non-directly-executable programming objects.
    5. The prefixes used for variables are inconsistent – you have globally define variables beginning with “L”.
    6. You are using obsolete forms like [], which are not necessary for tables without header lines.
    7. You have “magic numbers” like ‘1701’.
    8. When you run the program twice for the same program, you get no feedback
    9. A selection screen offering more choices – like a range of programs, packages etc.
    10. And, finally, it’s written procedurally not object oriented.

    • Completely agree with you, very badly written, but I was more interested in sharing the idea.The magic numbers are basically error codes which SAP gives for text errors.

    • Yes, I had that scenario in mind too where text is different in editor and in text symbol, but was not able to code for it due to time constraint. We had to create over 800 text symbols and hence this program was created overnight. Thanks Shai.

  • This is a very good idea, regardless of how badly the program is written. I am able to write really good programs (I hope) but coming up with brand new ideas is much more difficult, and this had never occurred to me.

    I can fix up bad programs – having new ideas is much more difficult!

    I tend to take such example programs from SCN, and totally re-write them, and then shove the result back onto SCN, as I did with the automated dependency injection framework.

    Going back to text symbols, in particular the problem I have is that it is agony using text symbols with curly brackets and pipes, such as:-

    ERROR_MESSAGE = |The widget has { number_of_flaws} flaws|.

    If you double click on the text then nothing happens. You have to put the txet soemwhere else, in a line you are going to delete, then doublec lucik on it to generate the text symbol, then put that text symbol in your pipe structure, surronded in curly brackets this time, then delete the line you first thought of.

    This could be a case for some sort of automated tool…….

  • Really great idea. I am a big fan of automation of all repeatable steps. This saves developers time and allows them to concentrate more on logic rather than mechanical steps.