SAP REF_SITE_AM_REFERENCE Function Module for Referencing data from ref. site in article master
REF_SITE_AM_REFERENCE is a standard ref site am reference SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Referencing data from ref. site in article master 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 ref site am reference FM, simply by entering the name REF_SITE_AM_REFERENCE into the relevant SAP transaction such as SE37 or SE38.
Function Group: REF_SITE_ARTICLE_MASTER
Program Name: SAPLREF_SITE_ARTICLE_MASTER
Main Program:
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function REF_SITE_AM_REFERENCE 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 'REF_SITE_AM_REFERENCE'"Referencing data from ref. site in article master.
EXPORTING
I_TBNAM = "Table name
I_REFERENZTYP = "
I_MATKL = "Material Group
CHANGING
C_MARC = "Plant Data for Material
C_MPOP = "Forecast Parameters
C_WRPL = "Replenishment: quantities per customer/material
EXCEPTIONS
REF_SITE_NOT_FOUND = 1 ARTICLE_NOT_FOUND = 2 KUNNR_NOT_FOUND = 3 CUSTOMER_IS_NO_PLANT = 4
IMPORTING Parameters details for REF_SITE_AM_REFERENCE
I_TBNAM - Table name
Data type: SPTAB-TBNAMOptional: No
Call by Reference: No ( called with pass by value option)
I_REFERENZTYP -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
I_MATKL - Material Group
Data type: RMMW2-MATKLOptional: No
Call by Reference: No ( called with pass by value option)
CHANGING Parameters details for REF_SITE_AM_REFERENCE
C_MARC - Plant Data for Material
Data type: MARCOptional: No
Call by Reference: No ( called with pass by value option)
C_MPOP - Forecast Parameters
Data type: MPOPOptional: No
Call by Reference: No ( called with pass by value option)
C_WRPL - Replenishment: quantities per customer/material
Data type: WRPLOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
REF_SITE_NOT_FOUND - Reference plant not found
Data type:Optional: No
Call by Reference: Yes
ARTICLE_NOT_FOUND - Article not found
Data type:Optional: No
Call by Reference: Yes
KUNNR_NOT_FOUND - Customer number in WRPL does not exist
Data type:Optional: No
Call by Reference: Yes
CUSTOMER_IS_NO_PLANT - Customer in WRPL is no plant
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for REF_SITE_AM_REFERENCE 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_c_marc | TYPE MARC, " | |||
| lv_i_tbnam | TYPE SPTAB-TBNAM, " | |||
| lv_ref_site_not_found | TYPE SPTAB, " | |||
| lv_c_mpop | TYPE MPOP, " | |||
| lv_i_referenztyp | TYPE C, " | |||
| lv_article_not_found | TYPE C, " | |||
| lv_c_wrpl | TYPE WRPL, " | |||
| lv_i_matkl | TYPE RMMW2-MATKL, " | |||
| lv_kunnr_not_found | TYPE RMMW2, " | |||
| lv_customer_is_no_plant | TYPE RMMW2. " |
|   CALL FUNCTION 'REF_SITE_AM_REFERENCE' "Referencing data from ref. site in article master |
| EXPORTING | ||
| I_TBNAM | = lv_i_tbnam | |
| I_REFERENZTYP | = lv_i_referenztyp | |
| I_MATKL | = lv_i_matkl | |
| CHANGING | ||
| C_MARC | = lv_c_marc | |
| C_MPOP | = lv_c_mpop | |
| C_WRPL | = lv_c_wrpl | |
| EXCEPTIONS | ||
| REF_SITE_NOT_FOUND = 1 | ||
| ARTICLE_NOT_FOUND = 2 | ||
| KUNNR_NOT_FOUND = 3 | ||
| CUSTOMER_IS_NO_PLANT = 4 | ||
| . " REF_SITE_AM_REFERENCE | ||
ABAP code using 7.40 inline data declarations to call FM REF_SITE_AM_REFERENCE
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 TBNAM FROM SPTAB INTO @DATA(ld_i_tbnam). | ||||
| "SELECT single MATKL FROM RMMW2 INTO @DATA(ld_i_matkl). | ||||
Search for further information about these or an SAP related objects