SAP CS_ALT_SELECT_MAT Function Module for NOTRANSL: automatische Alternativenselektion (Materialstückliste)
CS_ALT_SELECT_MAT is a standard cs alt select mat 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: automatische Alternativenselektion (Materialstückliste) 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 cs alt select mat FM, simply by entering the name CS_ALT_SELECT_MAT into the relevant SAP transaction such as SE37 or SE38.
Function Group: CSS3
Program Name: SAPLCSS3
Main Program: SAPLCSS3
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CS_ALT_SELECT_MAT 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 'CS_ALT_SELECT_MAT'"NOTRANSL: automatische Alternativenselektion (Materialstückliste).
EXPORTING
* ALL = ' ' "all valid alternatives desired
* NRFDC = ' ' "Search with alt. appl. only if up
* STLAL = ' ' "Alternative BOM
* STLAN = ' ' "BOM usage
* VPRIO = ' ' "BOM usage with high priority
WERKS = "Plant
* AENRR = ' ' "
* CAPID = ' ' "Application ID according to table
* CSLID = ' ' "Selection ID for usage sequence
* DATUV = 00000000 "Valid On
* DIALF = ' ' "Manual selection
* LOSGR = 0 "Lot size
MATNR = "Material number
* NOTAB = 'X' "Ignore table consideration from application
TABLES
MASTB_WA = "Work area (internal table) f. MAST
STKOB_WA = "Work area (internal table) f. STKO
STZUB_WA = "Work area (internal table) f. STZU
EXCEPTIONS
ALT_NOT_FOUND = 1 BOM_NOT_ACTIVE = 2 BOM_NOT_FOUND = 3 CALL_INVALID = 4 NO_ALT_FOUND = 5 NO_BOM_FOUND = 6
IMPORTING Parameters details for CS_ALT_SELECT_MAT
ALL - all valid alternatives desired
Data type: CSDATA-XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NRFDC - Search with alt. appl. only if up
Data type: CSDATA-XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
STLAL - Alternative BOM
Data type: MASTB-STLALDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
STLAN - BOM usage
Data type: MASTB-STLANDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VPRIO - BOM usage with high priority
Data type: CSDATA-XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
WERKS - Plant
Data type: MASTB-WERKSOptional: No
Call by Reference: No ( called with pass by value option)
AENRR -
Data type: CSDATA-XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CAPID - Application ID according to table
Data type: TC04-CAPIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CSLID - Selection ID for usage sequence
Data type: TCS41-CSLIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DATUV - Valid On
Data type: STKOB-DATUVDefault: 00000000
Optional: Yes
Call by Reference: No ( called with pass by value option)
DIALF - Manual selection
Data type: CSDATA-XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LOSGR - Lot size
Data type: MASTB-LOSVNOptional: Yes
Call by Reference: No ( called with pass by value option)
MATNR - Material number
Data type: MASTB-MATNROptional: No
Call by Reference: No ( called with pass by value option)
NOTAB - Ignore table consideration from application
Data type: CSDATA-XFELDDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CS_ALT_SELECT_MAT
MASTB_WA - Work area (internal table) f. MAST
Data type: CS01_MASTB_TABOptional: No
Call by Reference: No ( called with pass by value option)
STKOB_WA - Work area (internal table) f. STKO
Data type: CS01_STKOB_TABOptional: No
Call by Reference: No ( called with pass by value option)
STZUB_WA - Work area (internal table) f. STZU
Data type: CS01_STZUB_TABOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ALT_NOT_FOUND - (special) alternative not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
BOM_NOT_ACTIVE - Bill of material is not active (st
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
BOM_NOT_FOUND - (special) bill of material not fou
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CALL_INVALID - Invalid call
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_ALT_FOUND - no alternative found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_BOM_FOUND - no bill of material found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CS_ALT_SELECT_MAT 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_all | TYPE CSDATA-XFELD, " SPACE | |||
| lt_mastb_wa | TYPE STANDARD TABLE OF CS01_MASTB_TAB, " | |||
| lv_alt_not_found | TYPE CS01_MASTB_TAB, " | |||
| lv_nrfdc | TYPE CSDATA-XFELD, " SPACE | |||
| lv_stlal | TYPE MASTB-STLAL, " SPACE | |||
| lv_stlan | TYPE MASTB-STLAN, " SPACE | |||
| lv_vprio | TYPE CSDATA-XFELD, " SPACE | |||
| lv_werks | TYPE MASTB-WERKS, " | |||
| lv_aenrr | TYPE CSDATA-XFELD, " SPACE | |||
| lt_stkob_wa | TYPE STANDARD TABLE OF CS01_STKOB_TAB, " | |||
| lv_bom_not_active | TYPE CS01_STKOB_TAB, " | |||
| lv_capid | TYPE TC04-CAPID, " SPACE | |||
| lt_stzub_wa | TYPE STANDARD TABLE OF CS01_STZUB_TAB, " | |||
| lv_bom_not_found | TYPE CS01_STZUB_TAB, " | |||
| lv_cslid | TYPE TCS41-CSLID, " SPACE | |||
| lv_call_invalid | TYPE TCS41, " | |||
| lv_datuv | TYPE STKOB-DATUV, " 00000000 | |||
| lv_no_alt_found | TYPE STKOB, " | |||
| lv_dialf | TYPE CSDATA-XFELD, " SPACE | |||
| lv_no_bom_found | TYPE CSDATA, " | |||
| lv_losgr | TYPE MASTB-LOSVN, " 0 | |||
| lv_matnr | TYPE MASTB-MATNR, " | |||
| lv_notab | TYPE CSDATA-XFELD. " 'X' |
|   CALL FUNCTION 'CS_ALT_SELECT_MAT' "NOTRANSL: automatische Alternativenselektion (Materialstückliste) |
| EXPORTING | ||
| ALL | = lv_all | |
| NRFDC | = lv_nrfdc | |
| STLAL | = lv_stlal | |
| STLAN | = lv_stlan | |
| VPRIO | = lv_vprio | |
| WERKS | = lv_werks | |
| AENRR | = lv_aenrr | |
| CAPID | = lv_capid | |
| CSLID | = lv_cslid | |
| DATUV | = lv_datuv | |
| DIALF | = lv_dialf | |
| LOSGR | = lv_losgr | |
| MATNR | = lv_matnr | |
| NOTAB | = lv_notab | |
| TABLES | ||
| MASTB_WA | = lt_mastb_wa | |
| STKOB_WA | = lt_stkob_wa | |
| STZUB_WA | = lt_stzub_wa | |
| EXCEPTIONS | ||
| ALT_NOT_FOUND = 1 | ||
| BOM_NOT_ACTIVE = 2 | ||
| BOM_NOT_FOUND = 3 | ||
| CALL_INVALID = 4 | ||
| NO_ALT_FOUND = 5 | ||
| NO_BOM_FOUND = 6 | ||
| . " CS_ALT_SELECT_MAT | ||
ABAP code using 7.40 inline data declarations to call FM CS_ALT_SELECT_MAT
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 XFELD FROM CSDATA INTO @DATA(ld_all). | ||||
| DATA(ld_all) | = ' '. | |||
| "SELECT single XFELD FROM CSDATA INTO @DATA(ld_nrfdc). | ||||
| DATA(ld_nrfdc) | = ' '. | |||
| "SELECT single STLAL FROM MASTB INTO @DATA(ld_stlal). | ||||
| DATA(ld_stlal) | = ' '. | |||
| "SELECT single STLAN FROM MASTB INTO @DATA(ld_stlan). | ||||
| DATA(ld_stlan) | = ' '. | |||
| "SELECT single XFELD FROM CSDATA INTO @DATA(ld_vprio). | ||||
| DATA(ld_vprio) | = ' '. | |||
| "SELECT single WERKS FROM MASTB INTO @DATA(ld_werks). | ||||
| "SELECT single XFELD FROM CSDATA INTO @DATA(ld_aenrr). | ||||
| DATA(ld_aenrr) | = ' '. | |||
| "SELECT single CAPID FROM TC04 INTO @DATA(ld_capid). | ||||
| DATA(ld_capid) | = ' '. | |||
| "SELECT single CSLID FROM TCS41 INTO @DATA(ld_cslid). | ||||
| DATA(ld_cslid) | = ' '. | |||
| "SELECT single DATUV FROM STKOB INTO @DATA(ld_datuv). | ||||
| DATA(ld_datuv) | = 00000000. | |||
| "SELECT single XFELD FROM CSDATA INTO @DATA(ld_dialf). | ||||
| DATA(ld_dialf) | = ' '. | |||
| "SELECT single LOSVN FROM MASTB INTO @DATA(ld_losgr). | ||||
| "SELECT single MATNR FROM MASTB INTO @DATA(ld_matnr). | ||||
| "SELECT single XFELD FROM CSDATA INTO @DATA(ld_notab). | ||||
| DATA(ld_notab) | = 'X'. | |||
Search for further information about these or an SAP related objects