gpt4 book ai didi

abap - 确定 ABAP 中的事件格式设置

转载 作者:行者123 更新时间:2023-12-02 00:39:58 24 4
gpt4 key购买 nike

作为ABAP documentation of Formatting Settings解释:

The formatting settings are set as follows:

  • At the start of an internal session they are determined by the related default settings in the fixed values in the user master record of the current user.

  • Using the statement SET COUNTRY, this default setting for the current internal session can be overwritten using country-specific formats.

但是作为ABAP documentation of SET COUNTRY明确表示,无法查询此语句实际设置的内容:

Do not confuse the statement SET COUNTRY with the obsolete addition COUNTRY of the statement SET LOCALE LANGUAGE, used for setting the text environment. In particular, it does not have a corresponding GET COUNTRY statement.

的确,ABAP documentation of GET LOCALE - obsolete parameters提及:

The addition COUNTRY was intended for reading the country key of the current text environment explicitly. cntry expects a character-like data object. The function of this addition was not implemented in full and the result is undefined.

The addition COUNTRY of the statement GET LOCALE does not extract the formatting setting that can be set using SET COUNTRY.

这给我留下了一个难题。我可以使用 FM SUSR_GET_USER_DEFAULTS 确定我的用户默认设置。我可以从表 T005X 中找出国家/地区的设置。 但我无法确定设置了哪种特定国家/地区格式,甚至是否在事件 session 中设置了一个格式!

如何确定哪些格式设置当前处于事件状态?

额外的问题:有没有办法在调试器中解决这个问题?

最佳答案

也许您可以使用功能模块CLSE_SELECT_USR01

下面的例子:

REPORT test.

START-OF-SELECTION.
DATA: decimal_sign , separator.

PERFORM output.
SET COUNTRY 'US'.
PERFORM output.


FORM output.
CALL FUNCTION 'CLSE_SELECT_USR01'
* EXPORTING
* USERNAME = sy-uname
* IV_DELETE_BUFFER = ' '
IMPORTING
* X_USR01 =
* DATE_FORMAT =
decimal_sign = decimal_sign
separator = separator.
WRITE: / 'DECIMAL_SIGN', decimal_sign, 'separator', separator.
ENDFORM.

显示:enter image description here

我的默认语言环境是德国,所以我得到了小数的实际设置。

来自您的评论:

Unfortunately I have to parse and analyse output data that's prepared for screen display from potentially dozens of different form sources.

您是在运行时还是在之前的运行中获得输出?因为没有时间机器可以从过去的电话中获取语言环境:)

关于abap - 确定 ABAP 中的事件格式设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47409635/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com