08-25-2013 2:01 PM
Hi
Wanted to use text symbols in my report and was planning to use as under -
write : text-000.
However i came across some other reports where they are using the below way -
write : ' stock order status' ( xyz )
what is the advantage of doing it this way over text-xyz
08-25-2013 2:24 PM
Using text symbols allows you to use translations as you wish (and as you define).
The second system, uses message class, in which you can define certain messages and call them either with the string (like you did) or with the serial number of that message (like write 000(xyz)).
HOWEVER, the second method is usually used for information or error messages. In order to print something to the screen, text symbols are usually used.
08-26-2013 11:11 AM
Not correct. The second method is also a way of expressing text symbols. The advantage is that you can get some sense of the text without having to go to text-element maintenance.
08-25-2013 4:37 PM
Hi,
Look like different usage.
Regards.
From sap help:
http://help.sap.com/saphelp_nw04/helpdata/EN/1e/401ad6ee3c11d1951d0000e8353423/content.htm
You can also address text symbols as follows:
... '<textliteral>'(<idt>) ...
If the text symbol <idt> exists in the text pool for the logon language, this is the same as using TEXT-<idt>. Otherwise, the literal '<textliteral>' is used as the contents of the text symbol. This is only possible at positions in the program where a variable can occur. You can create a text symbol for any text literal by double-clicking the literal in the ABAP Editor and replacing the literal with the text symbol.
You should use text symbols in your program whenever they need to be language-specific - for example, in a WRITE statement.
If you program a list whose layout depends on field lengths, you should be careful, since the field length of text symbols will be different in different languages. You should therefore set the maximum field length of the field symbol so that there is enough space to translate it into other languages. For example, the English word 'program' has seven letters, but its equivalent German translation 'Programm' has eight.
The following example shows the use of text symbols in WRITE statements.
SET BLANK LINES ON.
WRITE: text-010,
/ text-aaa,
/ text-020,
/ 'Default Text 030'(030),
/ 'Default Text 040'(040).
If the text symbols of the above screen shots are linked to this program, the output looks as follows:
Text symbols 020 and 040 have no text symbols. For text symbol 020, the system displays a space. This is only displayed in this case because the blank line suppression has been turned off (see Creating Blank Lines). For text symbol 040, the literal specified in the program code is displayed.
08-25-2013 11:29 PM
Hi,
It does the same thing. But the following is recommended more due to translation reasons. Its easier when its like this.
write : text-000.
Also extended checks i think will show the following as issues to be resolved
write : ' stock order status' ( xyz )
Cheers,
Arindam
08-26-2013 11:15 AM
I entirely disagree.
write : ' stock order status' ( xyz )
is equivalent to:
* Stock order status
write : text-000.
But - the first doesn't need to be kept in sync. The "compare" option in text element maintenance will update it. And it doesn't show up in "extended checks".
You should use "write : ' stock order status' ( xyz )" where-ever possible. In my projects, to use text-nnn without a very good reason is a review fail.
08-26-2013 10:42 PM
08-26-2013 3:55 AM
Hi Hema S
See this links
http://help.sap.com/saphelp_nw04/helpdata/en/e3/960a0eeb0711d194d100a0c94260a5/content.htm
http://help.sap.com/saphelp_nw73/helpdata/en/e3/960a14eb0711d194d100a0c94260a5/content.htm
When you enter text symbols in the source code of your program, they are not automatically included in the text pool. The analyzing function allows you to:
● Delete obsolete text symbols from the text pool
● Adopt new text symbols in the text pool
● Maintain text symbols that are used in the program but not yet included in the text pool
● Compare text symbols with the program code
No text symbols have yet been maintained in the following program:
PROGRAM TEXT_ELEMENTS_4.
WRITE: TEXT-010,
/'Default Text'(020),
/TEXT-030.
1. In the Object Navigator (transaction SE80), open the program you want to edit.
2. In menu bar, choose Goto → Text Elements → Text Symbols.
The ABAP Text Elements screen appears.
3. In the application toolbar, choose with the quick info text Compare Text Symbols.
The ABAP Text Symbol Analysis (Display) screen appears. If the list of text symbols is empty, the option Text symbols that need to be added to the text pool is selected by default.
4. Choose the Edit pushbutton.
5. Select the text symbols you want to include in the text pool.
6. In the application toolbar, choose Insert text symbol.
The selected text symbols are marked for transfer into the text pool.
7. To review the changes, choose the Log pushbutton.
8. You can adopt the changes by choosing Enter, or cancel them by choosing Undo.
If you choose Enter in the example, the system inserts the text symbols 010, 020, and 030 in the text pool. No texts are assigned to symbols 010 or 030 but the text literal defined in the program is assigned to symbol 020.
You can slightly change the above program to use other analysis functions.
PROGRAM TEXT_ELEMENTS_4.
WRITE: TEXT-010,
/'Default Text'(020),
/'Test_Symbol'(030).
You can compare texts that are defined differently in the program and in the text pool as follows:
1. On the ABAP Text Symbol Analysis (Display) screen, select the Text symbols defined repeatedly/differently in program radio button.
2. Choose Edit.
You can replace the empty text from text symbol 030 in the text pool with the program text "test_symbol". The third column indicates whether the text is defined in the text pool (T) or in the program (P).
3. Choose Replace.
4. Save your entries.
Before deleting a text symbol, check the where-used list.
1. On the ABAP Text Symbol Analysis (Display) screen, select the option Text symbols which can be deleted from the text pool.
2. Choose Edit.
If text symbol 020 is no longer needed in the program, you can delete it.
3. Choose Delete.
08-26-2013 4:26 AM
Hi hema s,
After you are done with writting and executing your report successfully you can still go for extended check to to perform static checks, which are too time consuming for the normal syntax check. So execute your program faster you can use
write : ' stock order status' ( xyz )
above syntax.
For Extended check Goto "Program->Check->Extended Program Check" . Select all the check button for a full check.
With Regards
D Amarnath.
08-26-2013 5:33 AM
08-26-2013 9:42 AM
Hi Hema,
Text Symbols used for language specific text in programs.
'Text'(001) allows for translation but 'text-001' doesnt.
See this Links
http://scn.sap.com/community/abap/blog/2013/06/28/dont-get-lost-in-translation
http://scn.sap.com/thread/3382356
Regards,
Jeffin
08-26-2013 11:16 AM
While
'Text'(001) is to be preferred, text-001 most definitely does allow for translation.