cancel
Showing results for 
Search instead for 
Did you mean: 

multilingual Message

Former Member
0 Kudos

Hello friends,

I capture some messages during run time and show this messages on the Layout.

FO example on the on inout processing I have my code.

If ITAB is INITIAL.

msg = 'No records found'.

endif.

check msg is not initial.

and I use MSG on the screen.

However when the user logs ina different language I need to show some other TEXT. I have acheived the same in layout using OTR, but how would we do that when we write it on input processing.

Any SUggestions.

Ster.

Accepted Solutions (0)

Answers (3)

Answers (3)

raja_thangamani
Active Contributor
0 Kudos

OR use text elements:


If ITAB is INITIAL.
msg = text-001. " Enter the text with multiple languages...
endif.

Raja

RieSe
Contributor
0 Kudos

Hi,

i will prefer the follwing: collect your messages with id, type, v1-v4. For exmplae

you can use the type 'messages'. OnInitialisation you can loop over your

message and get the message-text via BAPI_MESSAGE_GETDETAIL.

You have to do the normal translation process for your messages via txn se91/se63.

BAPI_MESSAGE_GETDETAIL has a language parameter.

You can display your message in onLayout.

Dealing with own text-elements i have written an anpplication method

text = make->page_text( 'No records found' ), which works like

  • Local declarations.

data:

spras type sylangu,

alias_save type string,

comp_tab type stringtab,

comp type string,

text_save type string,

tabname type tabname,

local_alias type string,

text type string,

page_text type /euh/cer_page_t.

  • Set.

if me->language is initial.

spras = sy-langu.

else.

spras = me->language.

endif.

  • Check.

alias_save = alias.

split alias at ' ' into table comp_tab.

if lines( comp_tab ) > 1.

text_save = alias.

clear alias.

loop at comp_tab into comp.

if alias = space.

alias = comp.

else.

concatenate alias comp into alias separated by '_'.

endif.

endloop.

endif.

  • Get.

local_alias = alias.

if local_alias cs me->alias_prefix.

else.

concatenate me->alias_prefix '/' local_alias into local_alias.

endif.

translate local_alias to upper case. "#EC SYNTCHAR

system-call otr get_text_by_alias

language spras

id local_alias

nr '0001'

text into text.

shift text right deleting trailing space.

shift text left deleting leading space.

out = text.

  • CHECK text EQ space.

concatenate alias_prefix '_page_t' into tabname.

select single text into out from (tabname) client specified

where mandt = '200'

and name = local_alias

and spras = spras.

if sy-subrc <> space.

  • SELECT SINGLE text INTO out FROM /euh/mmm_page_t CLIENT SPECIFIED

  • WHERE mandt = '200'

  • AND name = local_alias

  • AND spras = spras.

if text is initial.

text = text_save.

endif.

if text is initial.

text = alias_save.

endif.

page_text-spras = spras.

page_text-name = local_alias.

page_text-text = text.

insert (tabname) from page_text.

if text = space.

out = local_alias.

else.

out = text.

endif.

endif.

So you can also wioth entries of an own table ...PAGE_T

MANDT MANDT CLNT 3

NAME SOTR_ALIAS CHAR 50

SPRAS SPRAS LANG 1

TEXT TEXT255 CHAR 255

to store text elements in an own table or using otr.

usaeful tyn's dealing otr are: SE63_OTR ,SOTR and SOTR_EDIT

Best regards,

Stefan

former_member184111
Active Contributor
0 Kudos

Hi Ster,

Instead of filling the msg variable in oninputprocessign you can do...

If ITAB is INITIAL.

flag_error = 'X' .

endif.

Layout:

IF flag_error IS NOT INITIAL.

display error message here using OTR

ENDIF.

Regards,

Anubhav