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

Exception Class Text Translation

Former Member
0 Likes
2,555

Hey,

I'm hoping someone will be able to help me with this... I have an exception class with texts set up for various errors. I have translated those texts in SE63 (OTR texts) and if I log in to the system in French and look at the texts in the class it shows the texts in French.

My problem is that when I use the GET_TEXT method in a web dynpro application, regardless of what language I am logged in with, I get the English texts...


Any help would be greatly appreciated! Let me know if you need more details.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,152

Thanks for the input everyone... After some further debugging I realized that the exception that was being raised was not actually from the exception class I had done the translation in. I changed the exception that is being raised and now the translated value is showing up correctly... What a waste of time!

Arindam was correct though, the logon language gets picked up and then in the function module SOTR_GET_TEXTS_WITH_KEYS it looks to the table SOTR_TEXT. If it doesn't find a matching value with the logon language it tries the system default (D in my case) and if it still doesn't find something it checks for English.

Hey,

I'm hoping someone will be able to help me with this... I have an exception class with texts set up for various errors. I have translated those texts in SE63 (OTR texts) and if I log in to the system in French and look at the texts in the class it shows the texts in French.

My problem is that when I use the GET_TEXT method in a web dynpro application, regardless of what language I am logged in with, I get the English texts...


Any help would be greatly appreciated! Let me know if you need more details.

7 REPLIES 7
Read only

arindam_m
Active Contributor
0 Likes
2,152

Hi,

There must be a way to pass the language key for selecting the text or is it always set to EN by default.

Cheers,

Arindam

Read only

Former Member
0 Likes
2,152

The method get_text is implemented in the class cx_root and the signature has no importing parameters. As far as I can tell it should be simply based on logon language... I'm searching for related notes right now.

Read only

arindam_m
Active Contributor
0 Likes
2,152

Hi,

I just noticed the statement

I have an exception class with texts set up for various errors. I have translated those texts in SE63 (OTR texts)...

I think you need to translate the text of the class from which the exceptions are raised. That is the class in which the message originates. Say you have some message that raised in say CL_PROCESS_DATA. The message is captured in say CX_MY_EXPCL of type CX_ROOT. Then the message text is designed in Exceptions tab of CL_PROCESS_DATA so this needs to be there in required translated languages. Hopefully that helps.

Cheers,

Arindam

Read only

Former Member
0 Likes
2,152

Hi Lucas,

Just out of curiosity i want to request you post solution if you get.

BR.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,152

I don't know (yet) the solution of your problem, but I would like to point out that the text of the message could come either from T100 message table either from otr messages, in this last case the CX_ROOT class will use CL_MESSAGE class to create the message texts, and this class has an instance method SET_LANGUAGE, so you could try to put a break-point in its CONTRUCTOR method ?

Regards,

Raymond

Read only

0 Likes
2,152

Hi ,

That's where the default language is picked up but in this case as stated its always picks EN which I think is happening because the exception texts get transferred from the main class to the exception class and in the main class which raises the exception might be missing the translated text.

Cheers,

Arindam

Read only

Former Member
0 Likes
2,153

Thanks for the input everyone... After some further debugging I realized that the exception that was being raised was not actually from the exception class I had done the translation in. I changed the exception that is being raised and now the translated value is showing up correctly... What a waste of time!

Arindam was correct though, the logon language gets picked up and then in the function module SOTR_GET_TEXTS_WITH_KEYS it looks to the table SOTR_TEXT. If it doesn't find a matching value with the logon language it tries the system default (D in my case) and if it still doesn't find something it checks for English.