SAP MGW0_WHERE_USED_COMPONENTS Function Module for NOTRANSL: Lesen des/der Kopfmaterial/ien zu einer Komponente
MGW0_WHERE_USED_COMPONENTS is a standard mgw0 where used components SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Lesen des/der Kopfmaterial/ien zu einer Komponente 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 mgw0 where used components FM, simply by entering the name MGW0_WHERE_USED_COMPONENTS into the relevant SAP transaction such as SE37 or SE38.
Function Group: MGW0
Program Name: SAPLMGW0
Main Program:
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MGW0_WHERE_USED_COMPONENTS 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 'MGW0_WHERE_USED_COMPONENTS'"NOTRANSL: Lesen des/der Kopfmaterial/ien zu einer Komponente.
EXPORTING
MGW0_MATNR = "
* MGW0_DATUV = SY-DATUM "
* MGW0_DATUB = '99991231' "
* MGW0_STLAN = ' ' "
* MGW0_WERKS = ' ' "
* MGW0_POSTP = ' ' "
TABLES
STRUCTURED_ARTICLES = "
IMPORTING Parameters details for MGW0_WHERE_USED_COMPONENTS
MGW0_MATNR -
Data type: RC29L-MATNROptional: No
Call by Reference: No ( called with pass by value option)
MGW0_DATUV -
Data type: RC29L-DATUVDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
MGW0_DATUB -
Data type: RC29L-DATUBDefault: '99991231'
Optional: Yes
Call by Reference: No ( called with pass by value option)
MGW0_STLAN -
Data type: RC29L-STLANDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MGW0_WERKS -
Data type: RC29L-WERKSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MGW0_POSTP -
Data type: RC29L-POSTPDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for MGW0_WHERE_USED_COMPONENTS
STRUCTURED_ARTICLES -
Data type: RMGW2WUOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MGW0_WHERE_USED_COMPONENTS 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_mgw0_matnr | TYPE RC29L-MATNR, " | |||
| lt_structured_articles | TYPE STANDARD TABLE OF RMGW2WU, " | |||
| lv_mgw0_datuv | TYPE RC29L-DATUV, " SY-DATUM | |||
| lv_mgw0_datub | TYPE RC29L-DATUB, " '99991231' | |||
| lv_mgw0_stlan | TYPE RC29L-STLAN, " SPACE | |||
| lv_mgw0_werks | TYPE RC29L-WERKS, " SPACE | |||
| lv_mgw0_postp | TYPE RC29L-POSTP. " SPACE |
|   CALL FUNCTION 'MGW0_WHERE_USED_COMPONENTS' "NOTRANSL: Lesen des/der Kopfmaterial/ien zu einer Komponente |
| EXPORTING | ||
| MGW0_MATNR | = lv_mgw0_matnr | |
| MGW0_DATUV | = lv_mgw0_datuv | |
| MGW0_DATUB | = lv_mgw0_datub | |
| MGW0_STLAN | = lv_mgw0_stlan | |
| MGW0_WERKS | = lv_mgw0_werks | |
| MGW0_POSTP | = lv_mgw0_postp | |
| TABLES | ||
| STRUCTURED_ARTICLES | = lt_structured_articles | |
| . " MGW0_WHERE_USED_COMPONENTS | ||
ABAP code using 7.40 inline data declarations to call FM MGW0_WHERE_USED_COMPONENTS
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 MATNR FROM RC29L INTO @DATA(ld_mgw0_matnr). | ||||
| "SELECT single DATUV FROM RC29L INTO @DATA(ld_mgw0_datuv). | ||||
| DATA(ld_mgw0_datuv) | = SY-DATUM. | |||
| "SELECT single DATUB FROM RC29L INTO @DATA(ld_mgw0_datub). | ||||
| DATA(ld_mgw0_datub) | = '99991231'. | |||
| "SELECT single STLAN FROM RC29L INTO @DATA(ld_mgw0_stlan). | ||||
| DATA(ld_mgw0_stlan) | = ' '. | |||
| "SELECT single WERKS FROM RC29L INTO @DATA(ld_mgw0_werks). | ||||
| DATA(ld_mgw0_werks) | = ' '. | |||
| "SELECT single POSTP FROM RC29L INTO @DATA(ld_mgw0_postp). | ||||
| DATA(ld_mgw0_postp) | = ' '. | |||
Search for further information about these or an SAP related objects