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









CHAR_FLTP_CONVERSION is a standard char fltp conversion SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Format conversion: Character --> Floating point processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for char fltp conversion FM, simply by entering the name CHAR_FLTP_CONVERSION into the relevant SAP transaction such as SE37 or SE38.

Function Group: SCFL
Program Name: SAPLSCFL
Main Program: SAPLSCFL
Appliation area:
Release date: 19-Nov-1997
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CHAR_FLTP_CONVERSION pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'CHAR_FLTP_CONVERSION'"Format conversion: Character --> Floating point
EXPORTING
* DYFLD = ' ' "Screen Field name for cursor positioning
* MASKN = ' ' "Masking character if input screen
* MAXDEC = '16' "Maximum number of input decimal places
* MAXEXP = '59+' "Maximum gross power of 10
* MINEXP = '60-' "Minimum gross power of 10
STRING = "CHAR input field for conversion to FLTP
* MSGTYP_DECIM = 'W' "Message type for 'TOO_MANY_DECIM' (see domains)
* STRICT_CHECK = ' ' "Strict input check

IMPORTING
DECIM = "Number of decimal places determined
EXPON = "Gross power of 10 determined
FLSTR = "FLTP output field, from CHAR conversion
IVALU = "Value in STRING flag

EXCEPTIONS
EXPONENT_TOO_BIG = 1 EXPONENT_TOO_SMALL = 2 STRING_NOT_FLTP = 3 TOO_MANY_DECIM = 4
.



IMPORTING Parameters details for CHAR_FLTP_CONVERSION

DYFLD - Screen Field name for cursor positioning

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

MASKN - Masking character if input screen

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

MAXDEC - Maximum number of input decimal places

Data type: T006-DECAN
Default: '16'
Optional: Yes
Call by Reference: No ( called with pass by value option)

MAXEXP - Maximum gross power of 10

Data type: T006-EXPON
Default: '59+'
Optional: Yes
Call by Reference: No ( called with pass by value option)

MINEXP - Minimum gross power of 10

Data type: T006-EXPON
Default: '60-'
Optional: Yes
Call by Reference: No ( called with pass by value option)

STRING - CHAR input field for conversion to FLTP

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MSGTYP_DECIM - Message type for 'TOO_MANY_DECIM' (see domains)

Data type: SREF-MSGTYP
Default: 'W'
Optional: Yes
Call by Reference: No ( called with pass by value option)

STRICT_CHECK - Strict input check

Data type: SAP_BOOL
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for CHAR_FLTP_CONVERSION

DECIM - Number of decimal places determined

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

EXPON - Gross power of 10 determined

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

FLSTR - FLTP output field, from CHAR conversion

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

IVALU - Value in STRING flag

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

EXPONENT_TOO_BIG - Gross power of 10 is too big

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

EXPONENT_TOO_SMALL - Gross power of 10 is too small

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

STRING_NOT_FLTP - STRING cannot be interpreted as floating point

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

TOO_MANY_DECIM - Too many decimal places

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for CHAR_FLTP_CONVERSION Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_decim  TYPE STRING, "   
lv_dyfld  TYPE STRING, "   SPACE
lv_exponent_too_big  TYPE STRING, "   
lv_expon  TYPE STRING, "   
lv_maskn  TYPE STRING, "   SPACE
lv_exponent_too_small  TYPE STRING, "   
lv_flstr  TYPE STRING, "   
lv_maxdec  TYPE T006-DECAN, "   '16'
lv_string_not_fltp  TYPE T006, "   
lv_ivalu  TYPE T006, "   
lv_maxexp  TYPE T006-EXPON, "   '59+'
lv_too_many_decim  TYPE T006, "   
lv_minexp  TYPE T006-EXPON, "   '60-'
lv_string  TYPE T006, "   
lv_msgtyp_decim  TYPE SREF-MSGTYP, "   'W'
lv_strict_check  TYPE SAP_BOOL. "   SPACE

  CALL FUNCTION 'CHAR_FLTP_CONVERSION'  "Format conversion: Character --> Floating point
    EXPORTING
         DYFLD = lv_dyfld
         MASKN = lv_maskn
         MAXDEC = lv_maxdec
         MAXEXP = lv_maxexp
         MINEXP = lv_minexp
         STRING = lv_string
         MSGTYP_DECIM = lv_msgtyp_decim
         STRICT_CHECK = lv_strict_check
    IMPORTING
         DECIM = lv_decim
         EXPON = lv_expon
         FLSTR = lv_flstr
         IVALU = lv_ivalu
    EXCEPTIONS
        EXPONENT_TOO_BIG = 1
        EXPONENT_TOO_SMALL = 2
        STRING_NOT_FLTP = 3
        TOO_MANY_DECIM = 4
. " CHAR_FLTP_CONVERSION




ABAP code using 7.40 inline data declarations to call FM CHAR_FLTP_CONVERSION

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
DATA(ld_dyfld) = ' '.
 
 
 
DATA(ld_maskn) = ' '.
 
 
 
"SELECT single DECAN FROM T006 INTO @DATA(ld_maxdec).
DATA(ld_maxdec) = '16'.
 
 
 
"SELECT single EXPON FROM T006 INTO @DATA(ld_maxexp).
DATA(ld_maxexp) = '59+'.
 
 
"SELECT single EXPON FROM T006 INTO @DATA(ld_minexp).
DATA(ld_minexp) = '60-'.
 
 
"SELECT single MSGTYP FROM SREF INTO @DATA(ld_msgtyp_decim).
DATA(ld_msgtyp_decim) = 'W'.
 
DATA(ld_strict_check) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!