SAP Function Modules

MY_MATERIAL_PRICE_CHANGE SAP Function module







MY_MATERIAL_PRICE_CHANGE 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_CHANGE 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_CHANGE - MY MATERIAL PRICE CHANGE





CALL FUNCTION 'MY_MATERIAL_PRICE_CHANGE' "
  EXPORTING
    i_bukrs =                   " t001-bukrs
    i_sniwe =                   " sniwe
*   i_bktxt =                   " bkpf-bktxt    Document Header Text
*   i_xblnr =                   " bkpf-xblnr    Reference Document Number
*   i_appl_log =                " xfeld         Checkbox
  IMPORTING
    e_mr22_active =             " xfeld         Checkbox
    e_comstamp =                " my_commit_stamp  Balance sheet valuations: last update key at DB commit
    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
  CHANGING
    xs_mysta =                  " mysta         Balance Sheet Valuation: Procedure Statistics Table
  EXCEPTIONS
    BTCI_ERROR = 1              "
    PRCH_ERROR = 2              "
    MLUP_ERROR = 3              "
    MYVA_ERROR = 4              "
    .  "  MY_MATERIAL_PRICE_CHANGE

ABAP code example for Function Module MY_MATERIAL_PRICE_CHANGE





The ABAP code below is a full code listing to execute function module MY_MATERIAL_PRICE_CHANGE 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_mr22_active  TYPE XFELD ,
ld_e_comstamp  TYPE MY_COMMIT_STAMP ,
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 .

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

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

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

SELECT single BKTXT
FROM BKPF
INTO @DATA(ld_i_bktxt).


SELECT single XBLNR
FROM BKPF
INTO @DATA(ld_i_xblnr).

DATA(ld_i_appl_log) = '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. . CALL FUNCTION 'MY_MATERIAL_PRICE_CHANGE' EXPORTING i_bukrs = ld_i_bukrs i_sniwe = ld_i_sniwe * i_bktxt = ld_i_bktxt * i_xblnr = ld_i_xblnr * i_appl_log = ld_i_appl_log IMPORTING e_mr22_active = ld_e_mr22_active e_comstamp = ld_e_comstamp et_msg = ld_et_msg TABLES * t_documents = it_t_documents t_err = it_t_err * t_priceact = it_t_priceact CHANGING xs_mysta = ld_xs_mysta EXCEPTIONS BTCI_ERROR = 1 PRCH_ERROR = 2 MLUP_ERROR = 3 MYVA_ERROR = 4 . " MY_MATERIAL_PRICE_CHANGE
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 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_mr22_active  TYPE XFELD ,
ld_i_bukrs  TYPE T001-BUKRS ,
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_sniwe  TYPE SNIWE ,
it_t_err  TYPE STANDARD TABLE OF SNIWEERR ,
wa_t_err  LIKE LINE OF it_t_err,
ld_et_msg  TYPE BAL_T_MSG ,
ld_i_bktxt  TYPE BKPF-BKTXT ,
it_t_priceact  TYPE STANDARD TABLE OF SMYPRICEACT ,
wa_t_priceact  LIKE LINE OF it_t_priceact,
ld_i_xblnr  TYPE BKPF-XBLNR ,
ld_i_appl_log  TYPE XFELD .

ld_xs_mysta = 'Check type of data required'.

SELECT single BUKRS
FROM T001
INTO ld_i_bukrs.


"populate fields of struture and append to itab
append wa_t_documents to it_t_documents.
ld_i_sniwe = 'Check type of data required'.

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

SELECT single BKTXT
FROM BKPF
INTO ld_i_bktxt.


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

SELECT single XBLNR
FROM BKPF
INTO ld_i_xblnr.

ld_i_appl_log = '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_CHANGE or its description.