SAP Function Modules

MY_MATERIAL_PRICE_UPDATE SAP Function module







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

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


Pattern for FM MY_MATERIAL_PRICE_UPDATE - MY MATERIAL PRICE UPDATE





CALL FUNCTION 'MY_MATERIAL_PRICE_UPDATE' "
  EXPORTING
    i_sniwe =                   " sniwe         Transfer Structure for Lowest Value Determination
    i_bukrs =                   " t001k-bukrs   Company Code
    i_mry_mt08y =               " mry_mt08y
    i_newpr =                   " rm08y-niwe_preis  Result of lowest value determination (new price)
*   i_abwkz =                   " mbew-abwkz    Lowest value: devaluation indicator
*   i_noprice =                 " xfeld         Checkbox
*   i_bwttl =                   " xfeld         Checkbox
  IMPORTING
    e_com_work =                " my_com_work
    e_comstamp =                " my_commit_stamp  Balance sheet valuations: last update key at DB commit
    e_mr22_active =             " xfeld         Checkbox
    et_msg =                    " bal_t_msg     Application Log: Table with Messages
  TABLES
    t_documents =               " bkpf_key
    t_err =                     " sniweerr
*   t_priceact =                " smypriceact   Communication Structure for Price Activity
*   t_mbew_enq =                "
  CHANGING
    xs_mysta =                  " mysta         Balance Sheet Valuation: Procedure Statistics Table
  EXCEPTIONS
    MBEW_ERROR = 1              "
    PRCH_ERROR = 2              "
    BTCI_ERROR = 3              "
    MLUP_ERROR = 4              "
    MYVA_ERROR = 5              "
    .  "  MY_MATERIAL_PRICE_UPDATE

ABAP code example for Function Module MY_MATERIAL_PRICE_UPDATE





The ABAP code below is a full code listing to execute function module MY_MATERIAL_PRICE_UPDATE 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_com_work  TYPE MY_COM_WORK ,
ld_e_comstamp  TYPE MY_COMMIT_STAMP ,
ld_e_mr22_active  TYPE XFELD ,
ld_et_msg  TYPE BAL_T_MSG ,
it_t_documents  TYPE STANDARD TABLE OF BKPF_KEY,"TABLES PARAM
wa_t_documents  LIKE LINE OF it_t_documents ,
it_t_err  TYPE STANDARD TABLE OF SNIWEERR,"TABLES PARAM
wa_t_err  LIKE LINE OF it_t_err ,
it_t_priceact  TYPE STANDARD TABLE OF SMYPRICEACT,"TABLES PARAM
wa_t_priceact  LIKE LINE OF it_t_priceact ,
it_t_mbew_enq  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_mbew_enq  LIKE LINE OF it_t_mbew_enq .

DATA(ld_xs_mysta) = 'Check type of data required'.
DATA(ld_i_sniwe) = 'Check type of data required'.

SELECT single BUKRS
FROM T001K
INTO @DATA(ld_i_bukrs).

DATA(ld_i_mry_mt08y) = 'Check type of data required'.

DATA(ld_i_newpr) = Check type of data required

SELECT single ABWKZ
FROM MBEW
INTO @DATA(ld_i_abwkz).

DATA(ld_i_noprice) = 'Check type of data required'.
DATA(ld_i_bwttl) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_documents to it_t_documents.

"populate fields of struture and append to itab
append wa_t_err to it_t_err.

"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_mbew_enq to it_t_mbew_enq. . CALL FUNCTION 'MY_MATERIAL_PRICE_UPDATE' EXPORTING i_sniwe = ld_i_sniwe i_bukrs = ld_i_bukrs i_mry_mt08y = ld_i_mry_mt08y i_newpr = ld_i_newpr * i_abwkz = ld_i_abwkz * i_noprice = ld_i_noprice * i_bwttl = ld_i_bwttl IMPORTING e_com_work = ld_e_com_work e_comstamp = ld_e_comstamp e_mr22_active = ld_e_mr22_active et_msg = ld_et_msg TABLES t_documents = it_t_documents t_err = it_t_err * t_priceact = it_t_priceact * t_mbew_enq = it_t_mbew_enq CHANGING xs_mysta = ld_xs_mysta EXCEPTIONS MBEW_ERROR = 1 PRCH_ERROR = 2 BTCI_ERROR = 3 MLUP_ERROR = 4 MYVA_ERROR = 5 . " MY_MATERIAL_PRICE_UPDATE
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_xs_mysta  TYPE MYSTA ,
ld_e_com_work  TYPE MY_COM_WORK ,
ld_i_sniwe  TYPE SNIWE ,
it_t_documents  TYPE STANDARD TABLE OF BKPF_KEY ,
wa_t_documents  LIKE LINE OF it_t_documents,
ld_e_comstamp  TYPE MY_COMMIT_STAMP ,
ld_i_bukrs  TYPE T001K-BUKRS ,
it_t_err  TYPE STANDARD TABLE OF SNIWEERR ,
wa_t_err  LIKE LINE OF it_t_err,
ld_e_mr22_active  TYPE XFELD ,
ld_i_mry_mt08y  TYPE MRY_MT08Y ,
it_t_priceact  TYPE STANDARD TABLE OF SMYPRICEACT ,
wa_t_priceact  LIKE LINE OF it_t_priceact,
ld_et_msg  TYPE BAL_T_MSG ,
ld_i_newpr  TYPE RM08Y-NIWE_PREIS ,
it_t_mbew_enq  TYPE STANDARD TABLE OF STRING ,
wa_t_mbew_enq  LIKE LINE OF it_t_mbew_enq,
ld_i_abwkz  TYPE MBEW-ABWKZ ,
ld_i_noprice  TYPE XFELD ,
ld_i_bwttl  TYPE XFELD .

ld_xs_mysta = 'Check type of data required'.
ld_i_sniwe = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_documents to it_t_documents.

SELECT single BUKRS
FROM T001K
INTO ld_i_bukrs.


"populate fields of struture and append to itab
append wa_t_err to it_t_err.
ld_i_mry_mt08y = 'Check type of data required'.

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

ld_i_newpr = Check type of data required

"populate fields of struture and append to itab
append wa_t_mbew_enq to it_t_mbew_enq.

SELECT single ABWKZ
FROM MBEW
INTO ld_i_abwkz.

ld_i_noprice = 'Check type of data required'.
ld_i_bwttl = '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_PRICE_UPDATE or its description.