SAP Function Modules

PRCH_MBEW_SELECTION SAP Function module







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

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


Pattern for FM PRCH_MBEW_SELECTION - PRCH MBEW SELECTION





CALL FUNCTION 'PRCH_MBEW_SELECTION' "
  EXPORTING
    i_incl_blank =              " boole-boole   Data Element for BOOLE Domain: TRUE (='X') and FALSE (=' ')
    i_bwkey =                   " bwkey         Valuation Area
  TABLES
    r_matnr =                   " ckmpr_ty_r_matnr
    r_bwtar =                   " ckmpr_ty_r_bwtar
*   r_mtart =                   " ckmpr_ty_r_mtart
*   r_matkl =                   " ckmpr_ty_r_matkl
*   r_spart =                   " ckmpr_ty_r_spart
    t_kalnr_all =               " ckmv0_matobj_tbl
  EXCEPTIONS
    NO_DATA = 1                 "               No materials selected
    .  "  PRCH_MBEW_SELECTION

ABAP code example for Function Module PRCH_MBEW_SELECTION





The ABAP code below is a full code listing to execute function module PRCH_MBEW_SELECTION 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:
it_r_matnr  TYPE STANDARD TABLE OF CKMPR_TY_R_MATNR,"TABLES PARAM
wa_r_matnr  LIKE LINE OF it_r_matnr ,
it_r_bwtar  TYPE STANDARD TABLE OF CKMPR_TY_R_BWTAR,"TABLES PARAM
wa_r_bwtar  LIKE LINE OF it_r_bwtar ,
it_r_mtart  TYPE STANDARD TABLE OF CKMPR_TY_R_MTART,"TABLES PARAM
wa_r_mtart  LIKE LINE OF it_r_mtart ,
it_r_matkl  TYPE STANDARD TABLE OF CKMPR_TY_R_MATKL,"TABLES PARAM
wa_r_matkl  LIKE LINE OF it_r_matkl ,
it_r_spart  TYPE STANDARD TABLE OF CKMPR_TY_R_SPART,"TABLES PARAM
wa_r_spart  LIKE LINE OF it_r_spart ,
it_t_kalnr_all  TYPE STANDARD TABLE OF CKMV0_MATOBJ_TBL,"TABLES PARAM
wa_t_kalnr_all  LIKE LINE OF it_t_kalnr_all .


DATA(ld_i_incl_blank) = some text here
DATA(ld_i_bwkey) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_r_matnr to it_r_matnr.

"populate fields of struture and append to itab
append wa_r_bwtar to it_r_bwtar.

"populate fields of struture and append to itab
append wa_r_mtart to it_r_mtart.

"populate fields of struture and append to itab
append wa_r_matkl to it_r_matkl.

"populate fields of struture and append to itab
append wa_r_spart to it_r_spart.

"populate fields of struture and append to itab
append wa_t_kalnr_all to it_t_kalnr_all. . CALL FUNCTION 'PRCH_MBEW_SELECTION' EXPORTING i_incl_blank = ld_i_incl_blank i_bwkey = ld_i_bwkey TABLES r_matnr = it_r_matnr r_bwtar = it_r_bwtar * r_mtart = it_r_mtart * r_matkl = it_r_matkl * r_spart = it_r_spart t_kalnr_all = it_t_kalnr_all EXCEPTIONS NO_DATA = 1 . " PRCH_MBEW_SELECTION
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_i_incl_blank  TYPE BOOLE-BOOLE ,
it_r_matnr  TYPE STANDARD TABLE OF CKMPR_TY_R_MATNR ,
wa_r_matnr  LIKE LINE OF it_r_matnr,
ld_i_bwkey  TYPE BWKEY ,
it_r_bwtar  TYPE STANDARD TABLE OF CKMPR_TY_R_BWTAR ,
wa_r_bwtar  LIKE LINE OF it_r_bwtar,
it_r_mtart  TYPE STANDARD TABLE OF CKMPR_TY_R_MTART ,
wa_r_mtart  LIKE LINE OF it_r_mtart,
it_r_matkl  TYPE STANDARD TABLE OF CKMPR_TY_R_MATKL ,
wa_r_matkl  LIKE LINE OF it_r_matkl,
it_r_spart  TYPE STANDARD TABLE OF CKMPR_TY_R_SPART ,
wa_r_spart  LIKE LINE OF it_r_spart,
it_t_kalnr_all  TYPE STANDARD TABLE OF CKMV0_MATOBJ_TBL ,
wa_t_kalnr_all  LIKE LINE OF it_t_kalnr_all.


ld_i_incl_blank = some text here

"populate fields of struture and append to itab
append wa_r_matnr to it_r_matnr.
ld_i_bwkey = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_r_bwtar to it_r_bwtar.

"populate fields of struture and append to itab
append wa_r_mtart to it_r_mtart.

"populate fields of struture and append to itab
append wa_r_matkl to it_r_matkl.

"populate fields of struture and append to itab
append wa_r_spart to it_r_spart.

"populate fields of struture and append to itab
append wa_t_kalnr_all to it_t_kalnr_all.

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