SAP Function Modules

FRML172_CALC_ADD_FROM_API SAP Function module







FRML172_CALC_ADD_FROM_API 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 FRML172_CALC_ADD_FROM_API into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM FRML172_CALC_ADD_FROM_API - FRML172 CALC ADD FROM API





CALL FUNCTION 'FRML172_CALC_ADD_FROM_API' "
  EXPORTING
    i_valdat =                  " sy-datum      Date and Time, Current (Application Server) Date
    i_level =                   " frmlc01-frml_level  View of a Recipe Formula
*   i_flg_po_calc = FALSE       " frmle_flg
    i_unit_flt =                " frmle_unit    Unit of Meas.
*   i_default_unit =            " frmle_unit
*   is_hdr_all =                " frmls_hdr_all  Formula Header Data
*   it_api_add_inp =            " frm10_iot_scr_tab  Input Substances of the Formula
*   it_api_add_oup =            " frm10_iot_scr_tab
*   it_scr_properties =         " frmlty_specattr
*   io_prot =                   " cl_rmst_prot  Log Instance
*   i_flg_recon_rate =          " frmle_flag    Customizing: General Indicator
*   i_layout =                  " frmle_layout
*   it_used_columns =           " frmlty_layout_columns
  IMPORTING
    et_log =                    " frmlty_log_rec  RMS-FRM: Messages for Application Log
    es_po_spec =                " frmls_iot_scr  Primary Output with Reference to Stored Specification Data
    es_po_evap =                " frmls_iot_scr  Evaporation Data
    es_sum_inp =                " frmls_iot_scr
    es_sum_oup =                " frmls_iot_scr
    e_mass_unit =               " frmle_unit
    e_vol_unit =                " frmle_unit
  CHANGING
    xt_api_add =                " frm10_iot_scr_tab
*   x_ref_qty_inp =             " frmle_comptgt  Target Quantity of a Material or Substance Item
*   x_ref_unit_inp =            " frmle_unit    Unit of Meas.
    .  "  FRML172_CALC_ADD_FROM_API

ABAP code example for Function Module FRML172_CALC_ADD_FROM_API





The ABAP code below is a full code listing to execute function module FRML172_CALC_ADD_FROM_API 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_et_log  TYPE FRMLTY_LOG_REC ,
ld_es_po_spec  TYPE FRMLS_IOT_SCR ,
ld_es_po_evap  TYPE FRMLS_IOT_SCR ,
ld_es_sum_inp  TYPE FRMLS_IOT_SCR ,
ld_es_sum_oup  TYPE FRMLS_IOT_SCR ,
ld_e_mass_unit  TYPE FRMLE_UNIT ,
ld_e_vol_unit  TYPE FRMLE_UNIT .

DATA(ld_xt_api_add) = 'Check type of data required'.
DATA(ld_x_ref_qty_inp) = 'Check type of data required'.
DATA(ld_x_ref_unit_inp) = 'Check type of data required'.
DATA(ld_i_valdat) = '20210129'.

SELECT single FRML_LEVEL
FROM FRMLC01
INTO @DATA(ld_i_level).

DATA(ld_i_flg_po_calc) = '20210129'.
DATA(ld_i_unit_flt) = '20210129'.
DATA(ld_i_default_unit) = '20210129'.
DATA(ld_is_hdr_all) = '20210129'.
DATA(ld_it_api_add_inp) = '20210129'.
DATA(ld_it_api_add_oup) = '20210129'.
DATA(ld_it_scr_properties) = '20210129'.
DATA(ld_io_prot) = '20210129'.
DATA(ld_i_flg_recon_rate) = '20210129'.
DATA(ld_i_layout) = '20210129'.
DATA(ld_it_used_columns) = '20210129'. . CALL FUNCTION 'FRML172_CALC_ADD_FROM_API' EXPORTING i_valdat = ld_i_valdat i_level = ld_i_level * i_flg_po_calc = ld_i_flg_po_calc i_unit_flt = ld_i_unit_flt * i_default_unit = ld_i_default_unit * is_hdr_all = ld_is_hdr_all * it_api_add_inp = ld_it_api_add_inp * it_api_add_oup = ld_it_api_add_oup * it_scr_properties = ld_it_scr_properties * io_prot = ld_io_prot * i_flg_recon_rate = ld_i_flg_recon_rate * i_layout = ld_i_layout * it_used_columns = ld_it_used_columns IMPORTING et_log = ld_et_log es_po_spec = ld_es_po_spec es_po_evap = ld_es_po_evap es_sum_inp = ld_es_sum_inp es_sum_oup = ld_es_sum_oup e_mass_unit = ld_e_mass_unit e_vol_unit = ld_e_vol_unit CHANGING xt_api_add = ld_xt_api_add * x_ref_qty_inp = ld_x_ref_qty_inp * x_ref_unit_inp = ld_x_ref_unit_inp . " FRML172_CALC_ADD_FROM_API
IF SY-SUBRC EQ 0. "All OK 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_xt_api_add  TYPE FRM10_IOT_SCR_TAB ,
ld_i_valdat  TYPE SY-DATUM ,
ld_et_log  TYPE FRMLTY_LOG_REC ,
ld_i_level  TYPE FRMLC01-FRML_LEVEL ,
ld_es_po_spec  TYPE FRMLS_IOT_SCR ,
ld_x_ref_qty_inp  TYPE FRMLE_COMPTGT ,
ld_es_po_evap  TYPE FRMLS_IOT_SCR ,
ld_x_ref_unit_inp  TYPE FRMLE_UNIT ,
ld_i_flg_po_calc  TYPE FRMLE_FLG ,
ld_es_sum_inp  TYPE FRMLS_IOT_SCR ,
ld_i_unit_flt  TYPE FRMLE_UNIT ,
ld_es_sum_oup  TYPE FRMLS_IOT_SCR ,
ld_i_default_unit  TYPE FRMLE_UNIT ,
ld_e_mass_unit  TYPE FRMLE_UNIT ,
ld_is_hdr_all  TYPE FRMLS_HDR_ALL ,
ld_e_vol_unit  TYPE FRMLE_UNIT ,
ld_it_api_add_inp  TYPE FRM10_IOT_SCR_TAB ,
ld_it_api_add_oup  TYPE FRM10_IOT_SCR_TAB ,
ld_it_scr_properties  TYPE FRMLTY_SPECATTR ,
ld_io_prot  TYPE CL_RMST_PROT ,
ld_i_flg_recon_rate  TYPE FRMLE_FLAG ,
ld_i_layout  TYPE FRMLE_LAYOUT ,
ld_it_used_columns  TYPE FRMLTY_LAYOUT_COLUMNS .

ld_xt_api_add = '20210129'.
ld_i_valdat = '20210129'.

SELECT single FRML_LEVEL
FROM FRMLC01
INTO ld_i_level.

ld_x_ref_qty_inp = '20210129'.
ld_x_ref_unit_inp = '20210129'.
ld_i_flg_po_calc = '20210129'.
ld_i_unit_flt = '20210129'.
ld_i_default_unit = '20210129'.
ld_is_hdr_all = '20210129'.
ld_it_api_add_inp = '20210129'.
ld_it_api_add_oup = '20210129'.
ld_it_scr_properties = '20210129'.
ld_io_prot = '20210129'.
ld_i_flg_recon_rate = '20210129'.
ld_i_layout = '20210129'.
ld_it_used_columns = '20210129'.

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 FRML172_CALC_ADD_FROM_API or its description.