SAP Function Modules

MILL_MATH_CONV_TO_FRACT SAP Function module







MILL_MATH_CONV_TO_FRACT is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name MILL_MATH_CONV_TO_FRACT into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: MILL_MATH
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM MILL_MATH_CONV_TO_FRACT - MILL MATH CONV TO FRACT





CALL FUNCTION 'MILL_MATH_CONV_TO_FRACT' "
  EXPORTING
    i_numer =                   " any
*   i_denom = 1                 " any
*   i_fract_length = 5          " i
*   i_numer_pole =              " any
*   i_denom_pole = 1            " any
  IMPORTING
    e_numer =                   " any
    e_denom =                   " any
    e_value =                   " any
    e_error_abs =               " f
    e_error_rel =               " f
    e_gcd =                     " any
  EXCEPTIONS
    I_FACTORS_INVALID = 1       "
    E_VALUE_INVALID = 2         "
    E_FACTORS_INVALID = 3       "
    CONVERSION_OVERFLOW = 4     "
    I_POLE_FACTORS_INVALID = 5  "
    .  "  MILL_MATH_CONV_TO_FRACT

ABAP code example for Function Module MILL_MATH_CONV_TO_FRACT





The ABAP code below is a full code listing to execute function module MILL_MATH_CONV_TO_FRACT including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_e_numer  TYPE ANY ,
ld_e_denom  TYPE ANY ,
ld_e_value  TYPE ANY ,
ld_e_error_abs  TYPE F ,
ld_e_error_rel  TYPE F ,
ld_e_gcd  TYPE ANY .

DATA(ld_i_numer) = 'Check type of data required'.
DATA(ld_i_denom) = 'Check type of data required'.
DATA(ld_i_fract_length) = 'Check type of data required'.
DATA(ld_i_numer_pole) = 'Check type of data required'.
DATA(ld_i_denom_pole) = 'Check type of data required'. . CALL FUNCTION 'MILL_MATH_CONV_TO_FRACT' EXPORTING i_numer = ld_i_numer * i_denom = ld_i_denom * i_fract_length = ld_i_fract_length * i_numer_pole = ld_i_numer_pole * i_denom_pole = ld_i_denom_pole IMPORTING e_numer = ld_e_numer e_denom = ld_e_denom e_value = ld_e_value e_error_abs = ld_e_error_abs e_error_rel = ld_e_error_rel e_gcd = ld_e_gcd EXCEPTIONS I_FACTORS_INVALID = 1 E_VALUE_INVALID = 2 E_FACTORS_INVALID = 3 CONVERSION_OVERFLOW = 4 I_POLE_FACTORS_INVALID = 5 . " MILL_MATH_CONV_TO_FRACT
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_e_numer  TYPE ANY ,
ld_i_numer  TYPE ANY ,
ld_e_denom  TYPE ANY ,
ld_i_denom  TYPE ANY ,
ld_e_value  TYPE ANY ,
ld_i_fract_length  TYPE I ,
ld_e_error_abs  TYPE F ,
ld_i_numer_pole  TYPE ANY ,
ld_e_error_rel  TYPE F ,
ld_i_denom_pole  TYPE ANY ,
ld_e_gcd  TYPE ANY .

ld_i_numer = 'Check type of data required'.
ld_i_denom = 'Check type of data required'.
ld_i_fract_length = 'Check type of data required'.
ld_i_numer_pole = 'Check type of data required'.
ld_i_denom_pole = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name MILL_MATH_CONV_TO_FRACT or its description.