SAP Function CHAR_FLTP_CONVERSION - Format conversion: Character --> Floating point

Parameter Reference Type Length Default Optional Text
DYFLD 0 SPACE X Screen Field name for cursor positioning
MASKN 0 SPACE X Masking character if input screen
MAXDEC T006-DECAN s 2 '16' X Maximum number of input decimal places
MAXEXP T006-EXPON s 2 '59+' X Maximum gross power of 10
MINEXP T006-EXPON s 2 '60-' X Minimum gross power of 10
MSGTYP_DECIM SREF-MSGTYP C 1 'W' X Message type for 'TOO_MANY_DECIM' (see domains)
STRING 0 CHAR input field for conversion to FLTP

Parameter Reference Type Length Text
DECIM 0 Number of decimal places determined
EXPON 0 Gross power of 10 determined
FLSTR 0 FLTP output field, from CHAR conversion
IVALU 0 Value in STRING flag

Exception Text
EXPONENT_TOO_BIG Gross power of 10 is too big
EXPONENT_TOO_SMALL Gross power of 10 is too small
STRING_NOT_FLTP STRING cannot be interpreted as floating point
TOO_MANY_DECIM Too many decimal places


  • This function module is a prototype. It will not be maintained once
  • FLTP format is supported on screens.
    • Functionality:

    • Check whether the STRING parameter (format CHAR) can be interpreted asa floating point number. If not, an error message (exceptionSTRING_NOT_FLTP) is output, avoiding an ABAP runtime error. If thecheck is successful the floating point number is put in the paramterFLSTR (format FLTP).
      As the initial value of numerical formats in the SAP system is '0', but'0' is a valid value in some applications (e.g. 0° celsius), anauxiliary parameter IVALU is used.
      If the function module FLTP_CHAR_CONVERSION created an input mask theparameter MASKN must have the same value (e.g. '_'), so that the inputmask can be interpreted.
      • Example call

      • CALL FUNCTION 'CHAR_FLTP_CONVERSION'
        EXPORTING MASKN = '_'
        STRING = ... (character string)
        IMPORTING FLSTR = ... (floating point field)
        IVALU = ... (flag, see above).
        Number of decimal places found in the mantissa in the interpretation ofSTRING.
        The 'gross' base 10 exponent is the base 10 exponent which results whenthe mantissa is presented so that there is one significant place beforethe decimal point, e.g. 1.77E+20. The MAXEXP and MINEXP parameters usethis format.
        This function module tries to interpret the STRING parameter as afloating point number, which is put in the FLSTR parameter. FLSTR mustbe assigned to a floating point field (FLTP).
        If STRING is '0' or a value which can be interpreted as a floatingpoint value, the IVALU parameter is set to not initial ('X'). If STRINGis empty or only the input mask, IVALU remains initial (' ').
        If there is a STRING parameter error, the cursor is positioned on thefield whose name is in the DYFLD parameter before the error message. Insteploops SY-STEPL is used.
        The function module FLTP_CHAR_CONVERSION can create an input mask. Theedit symbol used for a numerical value (e.g. '_') must be passed in theMASKN parameter so that it can be interpreted.
        If the mantissa of the STRING parameter (without any power of 10)contains more decimal places than specified in the MAXDEC parameter, awarning is issued in normal dialog (exception TOO_MANY_DECIM). Thischeck is not made in batch or Batch input mode because it is only awarning.
        See the EXPON parameter documentation for the term 'gross' exponent.
        If STRING has a greater 'gross' exponent than specified in the MAXEXPparameter, an error message is issued (exception EXPONENT_TOO_BIG).
        Analogous function to the MAXEXP parameter.
        The function module tries to interpret the contents of the STRINGparameter as a floating point number. The maximum meaningful length ofSTRING is CHAR 22.
        Possible values of the STRING parameter:
        • If the associated screen field contains an input mask, it need not be
        • used directly. Values can be entered left-justifed (or after leadingSPACEs).
          • The rest of the input field need not be explicitly overwritten with
          • SPACEs after left-justified input. You can end input with a SPACE orleave a mask character (e.g. '_').
            • If the left-justified input contains no power of 10, the power of 10 of
            • the input mask or the number which was previously in the field isinterpreted as part of the input, if it can be determined.