SAP MASS_WHERE_USED Function Module for where used list for mass maintenance screens









MASS_WHERE_USED is a standard mass where used SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for where used list for mass maintenance screens processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for mass where used FM, simply by entering the name MASS_WHERE_USED into the relevant SAP transaction such as SE37 or SE38.

Function Group: MASS_GENERAL_UTILITIES
Program Name: SAPLMASS_GENERAL_UTILITIES
Main Program: SAPLMASS_GENERAL_UTILITIES
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function MASS_WHERE_USED pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'MASS_WHERE_USED'"where used list for mass maintenance screens
EXPORTING
TABLE_TO_SEARCH_IN = "Table name
* TABLE_TO_DISPLAY = "Table Name
SEARCH_FOR_FIELD = "Field name
FIELD_CONTENT = "
* STRUCT_TO_RETURN_IN = "Structure to search in

IMPORTING
ROW_SELECTED = "

TABLES
FIELDS_TO_SEARCH_IN = "field list for mass maintenance where used
* P_T_KEY_COMMON_FIELD = "field list for common key field

EXCEPTIONS
USER_CANCEL = 1 ERROR_IN_SELECT = 2 NOT_ALLOWED = 3
.



IMPORTING Parameters details for MASS_WHERE_USED

TABLE_TO_SEARCH_IN - Table name

Data type: DD03L-TABNAME
Optional: No
Call by Reference: Yes

TABLE_TO_DISPLAY - Table Name

Data type: DD03L-TABNAME
Optional: Yes
Call by Reference: Yes

SEARCH_FOR_FIELD - Field name

Data type: DD03L-FIELDNAME
Optional: No
Call by Reference: Yes

FIELD_CONTENT -

Data type: ANY
Optional: No
Call by Reference: Yes

STRUCT_TO_RETURN_IN - Structure to search in

Data type: DD03L-TABNAME
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for MASS_WHERE_USED

ROW_SELECTED -

Data type: ANY
Optional: No
Call by Reference: Yes

TABLES Parameters details for MASS_WHERE_USED

FIELDS_TO_SEARCH_IN - field list for mass maintenance where used

Data type: MASS_FIELD_LIST
Optional: No
Call by Reference: Yes

P_T_KEY_COMMON_FIELD - field list for common key field

Data type: MASS_FIELD_LIST
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

USER_CANCEL -

Data type:
Optional: No
Call by Reference: Yes

ERROR_IN_SELECT -

Data type:
Optional: No
Call by Reference: Yes

NOT_ALLOWED - Lines dispaly not allowed because of errors

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for MASS_WHERE_USED Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_user_cancel  TYPE STRING, "   
lv_row_selected  TYPE ANY, "   
lv_table_to_search_in  TYPE DD03L-TABNAME, "   
lt_fields_to_search_in  TYPE STANDARD TABLE OF MASS_FIELD_LIST, "   
lv_error_in_select  TYPE MASS_FIELD_LIST, "   
lv_table_to_display  TYPE DD03L-TABNAME, "   
lt_p_t_key_common_field  TYPE STANDARD TABLE OF MASS_FIELD_LIST, "   
lv_not_allowed  TYPE MASS_FIELD_LIST, "   
lv_search_for_field  TYPE DD03L-FIELDNAME, "   
lv_field_content  TYPE ANY, "   
lv_struct_to_return_in  TYPE DD03L-TABNAME. "   

  CALL FUNCTION 'MASS_WHERE_USED'  "where used list for mass maintenance screens
    EXPORTING
         TABLE_TO_SEARCH_IN = lv_table_to_search_in
         TABLE_TO_DISPLAY = lv_table_to_display
         SEARCH_FOR_FIELD = lv_search_for_field
         FIELD_CONTENT = lv_field_content
         STRUCT_TO_RETURN_IN = lv_struct_to_return_in
    IMPORTING
         ROW_SELECTED = lv_row_selected
    TABLES
         FIELDS_TO_SEARCH_IN = lt_fields_to_search_in
         P_T_KEY_COMMON_FIELD = lt_p_t_key_common_field
    EXCEPTIONS
        USER_CANCEL = 1
        ERROR_IN_SELECT = 2
        NOT_ALLOWED = 3
. " MASS_WHERE_USED




ABAP code using 7.40 inline data declarations to call FM MASS_WHERE_USED

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
 
"SELECT single TABNAME FROM DD03L INTO @DATA(ld_table_to_search_in).
 
 
 
"SELECT single TABNAME FROM DD03L INTO @DATA(ld_table_to_display).
 
 
 
"SELECT single FIELDNAME FROM DD03L INTO @DATA(ld_search_for_field).
 
 
"SELECT single TABNAME FROM DD03L INTO @DATA(ld_struct_to_return_in).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!