SAP Function Modules

MY_MATERIAL_DATA_GET SAP Function module







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

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


Pattern for FM MY_MATERIAL_DATA_GET - MY MATERIAL DATA GET





CALL FUNCTION 'MY_MATERIAL_DATA_GET' "
  EXPORTING
    is_mypar =                  " mypar
    is_niwe =                   " sniwe         Transaction Code
    i_level =                   " tcurm-mykey_cus
    i_matnr =                   " matnr         Material Number
    i_mykey =                   " mykey         LIFO Valuation Level
    it_bwkeys_werks =           " bwkeys_werks_tab
*   is_pool =                   " tpool         Base Unit of Measure
*   i_idx_calc =                " xfeld         Checkbox
*   i_acc_assign =              " xfeld         Checkbox
*   is_niwel6 =                 " sniwel6       Transfer Structure for Lowest Val. Comparison LIFO (Special)
*   is_niwel =                  " sniwel        Transfer Structure for Lowest Value Determination
*   i_msm_mbew_sel =            " c
  IMPORTING
    es_niwemat =                " sniwemat
    et_niwespl =                " niwespl_tab
    et_niweabw =                " niweabw_tab
    e_umref =                   " float         FLTP Field Type
* TABLES
*   t_index =                   " slifoindex    Structure for Index LIFO Valuation
*   tra_mtart =                 " range_c4
*   t_priceact =                " smypriceact   Communication Structure for Price Activity
*   t_mymbew_bukrs =            " mymbew_bukrs
*   t_mbew_ext =                " mbew
* CHANGING
*   xs_niwemat =                " sniwemat      Material Master Data at Balance Sheet Valuation Level
*   xs_mysta =                  " mysta         Balance Sheet Valuation: Procedure Statistics Table
  EXCEPTIONS
    UNIT_CONVERSION_ERROR = 1   "
    ACCOUNT_ASSIGNMENT_ERROR = 2  "
    MTART_CHECK = 3             "
    .  "  MY_MATERIAL_DATA_GET

ABAP code example for Function Module MY_MATERIAL_DATA_GET





The ABAP code below is a full code listing to execute function module MY_MATERIAL_DATA_GET 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_es_niwemat  TYPE SNIWEMAT ,
ld_et_niwespl  TYPE NIWESPL_TAB ,
ld_et_niweabw  TYPE NIWEABW_TAB ,
ld_e_umref  TYPE FLOAT ,
it_t_index  TYPE STANDARD TABLE OF SLIFOINDEX,"TABLES PARAM
wa_t_index  LIKE LINE OF it_t_index ,
it_tra_mtart  TYPE STANDARD TABLE OF RANGE_C4,"TABLES PARAM
wa_tra_mtart  LIKE LINE OF it_tra_mtart ,
it_t_priceact  TYPE STANDARD TABLE OF SMYPRICEACT,"TABLES PARAM
wa_t_priceact  LIKE LINE OF it_t_priceact ,
it_t_mymbew_bukrs  TYPE STANDARD TABLE OF MYMBEW_BUKRS,"TABLES PARAM
wa_t_mymbew_bukrs  LIKE LINE OF it_t_mymbew_bukrs ,
it_t_mbew_ext  TYPE STANDARD TABLE OF MBEW,"TABLES PARAM
wa_t_mbew_ext  LIKE LINE OF it_t_mbew_ext .

DATA(ld_xs_niwemat) = 'Check type of data required'.
DATA(ld_xs_mysta) = 'Check type of data required'.
DATA(ld_is_mypar) = 'Check type of data required'.
DATA(ld_is_niwe) = 'Check type of data required'.

SELECT single MYKEY_CUS
FROM TCURM
INTO @DATA(ld_i_level).

DATA(ld_i_matnr) = 'Check type of data required'.
DATA(ld_i_mykey) = 'Check type of data required'.
DATA(ld_it_bwkeys_werks) = 'Check type of data required'.
DATA(ld_is_pool) = 'Check type of data required'.
DATA(ld_i_idx_calc) = 'Check type of data required'.
DATA(ld_i_acc_assign) = 'Check type of data required'.
DATA(ld_is_niwel6) = 'Check type of data required'.
DATA(ld_is_niwel) = 'Check type of data required'.
DATA(ld_i_msm_mbew_sel) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_index to it_t_index.

"populate fields of struture and append to itab
append wa_tra_mtart to it_tra_mtart.

"populate fields of struture and append to itab
append wa_t_priceact to it_t_priceact.

"populate fields of struture and append to itab
append wa_t_mymbew_bukrs to it_t_mymbew_bukrs.

"populate fields of struture and append to itab
append wa_t_mbew_ext to it_t_mbew_ext. . CALL FUNCTION 'MY_MATERIAL_DATA_GET' EXPORTING is_mypar = ld_is_mypar is_niwe = ld_is_niwe i_level = ld_i_level i_matnr = ld_i_matnr i_mykey = ld_i_mykey it_bwkeys_werks = ld_it_bwkeys_werks * is_pool = ld_is_pool * i_idx_calc = ld_i_idx_calc * i_acc_assign = ld_i_acc_assign * is_niwel6 = ld_is_niwel6 * is_niwel = ld_is_niwel * i_msm_mbew_sel = ld_i_msm_mbew_sel IMPORTING es_niwemat = ld_es_niwemat et_niwespl = ld_et_niwespl et_niweabw = ld_et_niweabw e_umref = ld_e_umref * TABLES * t_index = it_t_index * tra_mtart = it_tra_mtart * t_priceact = it_t_priceact * t_mymbew_bukrs = it_t_mymbew_bukrs * t_mbew_ext = it_t_mbew_ext * CHANGING * xs_niwemat = ld_xs_niwemat * xs_mysta = ld_xs_mysta EXCEPTIONS UNIT_CONVERSION_ERROR = 1 ACCOUNT_ASSIGNMENT_ERROR = 2 MTART_CHECK = 3 . " MY_MATERIAL_DATA_GET
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 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_xs_niwemat  TYPE SNIWEMAT ,
ld_es_niwemat  TYPE SNIWEMAT ,
ld_is_mypar  TYPE MYPAR ,
it_t_index  TYPE STANDARD TABLE OF SLIFOINDEX ,
wa_t_index  LIKE LINE OF it_t_index,
ld_xs_mysta  TYPE MYSTA ,
ld_et_niwespl  TYPE NIWESPL_TAB ,
ld_is_niwe  TYPE SNIWE ,
it_tra_mtart  TYPE STANDARD TABLE OF RANGE_C4 ,
wa_tra_mtart  LIKE LINE OF it_tra_mtart,
ld_et_niweabw  TYPE NIWEABW_TAB ,
ld_i_level  TYPE TCURM-MYKEY_CUS ,
it_t_priceact  TYPE STANDARD TABLE OF SMYPRICEACT ,
wa_t_priceact  LIKE LINE OF it_t_priceact,
ld_e_umref  TYPE FLOAT ,
ld_i_matnr  TYPE MATNR ,
it_t_mymbew_bukrs  TYPE STANDARD TABLE OF MYMBEW_BUKRS ,
wa_t_mymbew_bukrs  LIKE LINE OF it_t_mymbew_bukrs,
ld_i_mykey  TYPE MYKEY ,
it_t_mbew_ext  TYPE STANDARD TABLE OF MBEW ,
wa_t_mbew_ext  LIKE LINE OF it_t_mbew_ext,
ld_it_bwkeys_werks  TYPE BWKEYS_WERKS_TAB ,
ld_is_pool  TYPE TPOOL ,
ld_i_idx_calc  TYPE XFELD ,
ld_i_acc_assign  TYPE XFELD ,
ld_is_niwel6  TYPE SNIWEL6 ,
ld_is_niwel  TYPE SNIWEL ,
ld_i_msm_mbew_sel  TYPE C .

ld_xs_niwemat = 'Check type of data required'.
ld_is_mypar = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_index to it_t_index.
ld_xs_mysta = 'Check type of data required'.
ld_is_niwe = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_tra_mtart to it_tra_mtart.

SELECT single MYKEY_CUS
FROM TCURM
INTO ld_i_level.


"populate fields of struture and append to itab
append wa_t_priceact to it_t_priceact.
ld_i_matnr = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_mymbew_bukrs to it_t_mymbew_bukrs.
ld_i_mykey = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_mbew_ext to it_t_mbew_ext.
ld_it_bwkeys_werks = 'Check type of data required'.
ld_is_pool = 'Check type of data required'.
ld_i_idx_calc = 'Check type of data required'.
ld_i_acc_assign = 'Check type of data required'.
ld_is_niwel6 = 'Check type of data required'.
ld_is_niwel = 'Check type of data required'.
ld_i_msm_mbew_sel = '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 MY_MATERIAL_DATA_GET or its description.