Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Determine text-nnn language by code-condition

Former Member
0 Likes
556

Hi there good people, I've got a question.

I've got a text, let's say text-001 ... now I'd like to determine it's language by code, so for example:


IF ( condition1 ) .
  text-001 will be taken in language A .
ELSEIF ( condition 2 ) .
  text-002 will be taken in language B .
ENDIF .

How can I achieve that? I tried


IF ( condition1 ) .
  sy-langu = 'A' .
ELSEIF ( condition 2 ) .
  sy-langu = 'B' .
ENDIF .

but it has no effect, because when sy-langu in one line is set to new value ... in the next line in debuger it takes the old value :( 

I'd be thankful for some tip, greetings. P.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
510

create text element

in english

txt-001 = attention

in german

txt-002 = achtung

IF ( condition1 ) .

text-001

ELSEIF ( condition 2 ) .

text-002

ENDIF .

2 REPLIES 2
Read only

Former Member
0 Likes
511

create text element

in english

txt-001 = attention

in german

txt-002 = achtung

IF ( condition1 ) .

text-001

ELSEIF ( condition 2 ) .

text-002

ENDIF .

Read only

Former Member
0 Likes
510

Hi,

The user gets the text objects in language ,which he uses as logon language.

You just declare your text object and then in that screen In menu Go to -> Translation .

there a popup window will come and asking for the original language and target language.

I mean you just maintian the translations for your texts of your program in different language. Then you need not have to harcode the text in different language in your program.

You can also go to se63 for translation.

hope this will help you