SAP DETERMIN_SOURCE_OF_SUPPLY_KEY Function Module for Determine Source of Supply Key
DETERMIN_SOURCE_OF_SUPPLY_KEY is a standard determin source of supply key SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Determine Source of Supply Key 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 determin source of supply key FM, simply by entering the name DETERMIN_SOURCE_OF_SUPPLY_KEY into the relevant SAP transaction such as SE37 or SE38.
Function Group: WSOS_REF
Program Name: SAPLWSOS_REF
Main Program:
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function DETERMIN_SOURCE_OF_SUPPLY_KEY 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 'DETERMIN_SOURCE_OF_SUPPLY_KEY'"Determine Source of Supply Key.
EXPORTING
I_MATNR = "Material Number
I_WERKS = "Plant
I_ATTYP = "Material Category
IMPORTING
E_BWSCL = "Source of Supply
E_MARA = "General Material Data
E_MARC = "Plant Data for Material
EXCEPTIONS
BWSCL_NOT_FOUND = 1 MARA_NOT_FOUND = 2 MARC_NOT_FOUND = 3 ERROR = 4
IMPORTING Parameters details for DETERMIN_SOURCE_OF_SUPPLY_KEY
I_MATNR - Material Number
Data type: MARA-MATNROptional: No
Call by Reference: Yes
I_WERKS - Plant
Data type: T001W-WERKSOptional: No
Call by Reference: Yes
I_ATTYP - Material Category
Data type: MARA-ATTYPOptional: No
Call by Reference: Yes
EXPORTING Parameters details for DETERMIN_SOURCE_OF_SUPPLY_KEY
E_BWSCL - Source of Supply
Data type: MARA-BWSCLOptional: No
Call by Reference: Yes
E_MARA - General Material Data
Data type: MARAOptional: No
Call by Reference: Yes
E_MARC - Plant Data for Material
Data type: MARCOptional: No
Call by Reference: Yes
EXCEPTIONS details
BWSCL_NOT_FOUND -
Data type:Optional: No
Call by Reference: Yes
MARA_NOT_FOUND -
Data type:Optional: No
Call by Reference: Yes
MARC_NOT_FOUND -
Data type:Optional: No
Call by Reference: Yes
ERROR - DE-EN-LANG-SWITCH-NO-TRANSLATION
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for DETERMIN_SOURCE_OF_SUPPLY_KEY 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_e_bwscl | TYPE MARA-BWSCL, " | |||
| lv_i_matnr | TYPE MARA-MATNR, " | |||
| lv_bwscl_not_found | TYPE MARA, " | |||
| lv_e_mara | TYPE MARA, " | |||
| lv_i_werks | TYPE T001W-WERKS, " | |||
| lv_mara_not_found | TYPE T001W, " | |||
| lv_e_marc | TYPE MARC, " | |||
| lv_i_attyp | TYPE MARA-ATTYP, " | |||
| lv_marc_not_found | TYPE MARA, " | |||
| lv_error | TYPE MARA. " |
|   CALL FUNCTION 'DETERMIN_SOURCE_OF_SUPPLY_KEY' "Determine Source of Supply Key |
| EXPORTING | ||
| I_MATNR | = lv_i_matnr | |
| I_WERKS | = lv_i_werks | |
| I_ATTYP | = lv_i_attyp | |
| IMPORTING | ||
| E_BWSCL | = lv_e_bwscl | |
| E_MARA | = lv_e_mara | |
| E_MARC | = lv_e_marc | |
| EXCEPTIONS | ||
| BWSCL_NOT_FOUND = 1 | ||
| MARA_NOT_FOUND = 2 | ||
| MARC_NOT_FOUND = 3 | ||
| ERROR = 4 | ||
| . " DETERMIN_SOURCE_OF_SUPPLY_KEY | ||
ABAP code using 7.40 inline data declarations to call FM DETERMIN_SOURCE_OF_SUPPLY_KEY
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 BWSCL FROM MARA INTO @DATA(ld_e_bwscl). | ||||
| "SELECT single MATNR FROM MARA INTO @DATA(ld_i_matnr). | ||||
| "SELECT single WERKS FROM T001W INTO @DATA(ld_i_werks). | ||||
| "SELECT single ATTYP FROM MARA INTO @DATA(ld_i_attyp). | ||||
Search for further information about these or an SAP related objects