简体   繁体   English

在运行时更改ABAP报告语言

[英]Change ABAP report language at runtime

I was under the assumption that each time I use the following statement during the runtime of an ABAP report, the text-symbols from the respective language would be used from there on out (if they were translated accordingly): 我假设在ABAP报告运行期间每次使用以下语句时,都会从那里开始使用相应语言的文本符号(如果已相应翻译的话):

SET LANGUAGE 'EN'.

However, this language switch only seems to work once, because in my report (where I want the user to be able to select the output language) I can use any language I want during the first run. 但是,这种语言切换似乎只起作用一次,因为在我的报告中(我希望用户能够选择输出语言),我可以在第一次运行中使用任何我想要的语言。 But once I go back to the selection screen and enter a different language code, the second SET LANGUAGE does not have any effect. 但是,一旦我回到选择屏幕并输入其他语言代码,第二个SET LANGUAGE就没有任何作用。

Is there some sort of text-symbols caching involved? 是否存在某种文本符号缓存? Is there a way to prevent that for a single report or trigger a refresh at runtime? 有没有一种方法可以防止单个报告或在运行时触发刷新?

Probably, it worths to use CL_GUI_TIMER to refresh the screen after you switched language. 切换语言后,可能值得使用CL_GUI_TIMER刷新屏幕。 You can check it with SAP_TIMER_DEMO program. 您可以使用SAP_TIMER_DEMO程序进行检查。

I just found the solution: There is none, since there is none needed. 我刚刚找到了解决方案:没有,因为不需要。

SAP is not caching the language-dependent text symbols. SAP不会缓存与语言相关的文本符号。 You can at any point in the execution change the runtime language via: 您可以在执行过程中的任何时候通过以下方式更改运行时语言:

SET LANGUAGE 'EN'.

The reason I thought it did not work was, that I was using an HTML control inlined in the SAP GUI that did not properly refresh and therefore on the second HTML display still showed the old language texts. 我认为它不起作用的原因是,我使用的SAP GUI中内联的HTML控件无法正确刷新,因此在第二个HTML显示屏上仍显示旧的语言文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM