Determining the active formatting settings in ABAP

前端 未结 2 719
一生所求
一生所求 2021-01-15 05:24

As the ABAP documentation of Formatting Settings explains:

The formatting settings are set as follows:

  • At the start of an internal sessio

2条回答
  •  一生所求
    2021-01-15 06:04

    Maybe you can use the function module CLSE_SELECT_USR01.

    The following example:

    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.
    

    shows:

    My default locale is DE, so I get the actual setting for decimals.

    From your comment:

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

    Do you get the output at runtime or a previous run? Because there is no time machine to get the locale from a call in the past :)

提交回复
热议问题