cancel
Showing results for 
Search instead for 
Did you mean: 

What is text element

04-30-2008 3:43 PM
981 views 3 comments
0 Likes
SAP Managed Tags
Subscribe

HI,

What is the use of text element. Why we are using this text element.

0 Likes

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Likes

Text elements are used to store texts displayed on the selection screens or output screens of ABAP reports, but are not hard-coded in programs. The different types of text element include:

Report or program titles

List headers

Column headers

Selection texts

Text symbols

Check this link for text element creation.

http://help.sap.com/saphelp_nw04s/helpdata/en/e3/960a0beb0711d194d100a0c94260a5/frameset.htm

Text elements are used to store text , the basic purpose of using this is that the same program can be run in diffrent languages and so the titles/headers must be in the language the program is execued , if you hardcode it in the program this will not work , so we use a text elemnt and the system selects the language for the text element based on the language in which the user has logged in.

You can translate a text element by using the option in the menu

Goto--> Translation.

They are useful when the program is used in other languages.

So that they are automatically converted to that language.

So define the texts in the text elements and use their ID's like (TXT-05) in the code

don't sue the complete texts in the program.

selection texts are used to give meaning ful names for the fields on selection screen

goto your program in display mode in se38

in menu gototext elementsselection texts

Field symbols offer functionlity similar to pointers in other programming languages. It does not occupy memory for the data object, it points to the object that has been assigned to the field symbol. You use the assign command to relate to the data object. After the assign operation you can work with field symbol in the same way as with the object itself.

You define the field symbol as: field-symbols <fs>.

Consider this:

field-symbol <fs>.

data field value 'X'.

asssign field to <fs>.

The field symbol <fs> now inherits all the properties from the assigned field, and you can work with the field symbol in the same way as with the field itself.

Take a look at the examples given here for working with field symbols:

[url]http://www.sapgenie.com/abap/code/chap2401.txt

http://www.sapgenie.com/abap/code/chap2402.txt

http://www.sapgenie.com/abap/code/chap2403.txt

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm

http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html[url];

Simple program.

data : letter(10) .

field-symbols : <fs> type any.

assign letter to <fs> type 'X'.

write <fs>.

Simple program.

TYPES: BEGIN OF NAME,

NEXTNAME(10),

FIRSTNAME(10),

LASTNAME(10),

END OF NAME.

FIELD-SYMBOLS <F> TYPE NAME.

DATA: LINE(30).

LINE = 'JOHN SMITH SHRI'.

ASSIGN LINE TO <F> CASTING.

WRITE: / 'Lastname:', <F>-LASTNAME,

'Firstname:', <F>-FIRSTNAME,

'Nextname :', <F>-NEXTNAME.

Reward If found helpful

Former Member
0 Likes

The main purpose of text element is ..we can translate to other languages...

Regards.

Dara.

Former Member
0 Likes

Hi

we use text elements to avoid the hard coding in the program.

instead of writing...

write:/ ' Please Select Purchase Document Number'

u can write:

text-001.

if u declare that in text elements.