SAP CS_ALT_SELECT_KND Function Module for NOTRANSL: automatische Alternativenselektion (Materialstückliste)
CS_ALT_SELECT_KND is a standard cs alt select knd 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 knd FM, simply by entering the name CS_ALT_SELECT_KND 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_KND 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_KND'"NOTRANSL: automatische Alternativenselektion (Materialstückliste).
EXPORTING
* CAPID = ' ' "Application ID from table TC04
* CSLID = ' ' "Selection ID for sequence of usages
* DATUV = 00000000 "Valid On
MATNR = "Material number
* NRFDC = ' ' "Find with alternative application only if NRFD
* STLAN = ' ' "BOM usage
WERKS = "Plant
VBELN = "
VBELP = "
TABLES
KDSTB_WA = "Work area (int. table) for MASTB
STKOB_WA = "Work area (int. table) for STKOB
STZUB_WA = "Work area (int. table) for STZUB
EXCEPTIONS
BOM_NOT_ACTIVE = 1 BOM_NOT_FOUND = 2 CALL_INVALID = 3 NO_ALT_FOUND = 4 NO_BOM_FOUND = 5 ONLY_LINK_FOUND = 6
IMPORTING Parameters details for CS_ALT_SELECT_KND
CAPID - Application ID from table TC04
Data type: TC04-CAPIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CSLID - Selection ID for sequence of usages
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)
MATNR - Material number
Data type: MASTB-MATNROptional: No
Call by Reference: No ( called with pass by value option)
NRFDC - Find with alternative application only if NRFD
Data type: CSDATA-XFELDDefault: 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)
WERKS - Plant
Data type: MASTB-WERKSOptional: No
Call by Reference: No ( called with pass by value option)
VBELN -
Data type: KDSTB-VBELNOptional: No
Call by Reference: No ( called with pass by value option)
VBELP -
Data type: KDSTB-VBPOSOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CS_ALT_SELECT_KND
KDSTB_WA - Work area (int. table) for MASTB
Data type: CS01_KDSTB_TABOptional: No
Call by Reference: No ( called with pass by value option)
STKOB_WA - Work area (int. table) for STKOB
Data type: CS01_STKOB_TABOptional: No
Call by Reference: No ( called with pass by value option)
STZUB_WA - Work area (int. table) for STZUB
Data type: CS01_STZUB_TABOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
BOM_NOT_ACTIVE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
BOM_NOT_FOUND - (Specific) BOM not found (data err)
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 (valid) alternative found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_BOM_FOUND - BOM not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ONLY_LINK_FOUND - Allocation record found, but no BOM
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CS_ALT_SELECT_KND 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_capid | TYPE TC04-CAPID, " SPACE | |||
| lt_kdstb_wa | TYPE STANDARD TABLE OF CS01_KDSTB_TAB, " | |||
| lv_bom_not_active | TYPE CS01_KDSTB_TAB, " | |||
| lv_cslid | TYPE TCS41-CSLID, " SPACE | |||
| lt_stkob_wa | TYPE STANDARD TABLE OF CS01_STKOB_TAB, " | |||
| lv_bom_not_found | TYPE CS01_STKOB_TAB, " | |||
| lv_datuv | TYPE STKOB-DATUV, " 00000000 | |||
| lt_stzub_wa | TYPE STANDARD TABLE OF CS01_STZUB_TAB, " | |||
| lv_call_invalid | TYPE CS01_STZUB_TAB, " | |||
| lv_matnr | TYPE MASTB-MATNR, " | |||
| lv_no_alt_found | TYPE MASTB, " | |||
| lv_nrfdc | TYPE CSDATA-XFELD, " SPACE | |||
| lv_no_bom_found | TYPE CSDATA, " | |||
| lv_stlan | TYPE MASTB-STLAN, " SPACE | |||
| lv_only_link_found | TYPE MASTB, " | |||
| lv_werks | TYPE MASTB-WERKS, " | |||
| lv_vbeln | TYPE KDSTB-VBELN, " | |||
| lv_vbelp | TYPE KDSTB-VBPOS. " |
|   CALL FUNCTION 'CS_ALT_SELECT_KND' "NOTRANSL: automatische Alternativenselektion (Materialstückliste) |
| EXPORTING | ||
| CAPID | = lv_capid | |
| CSLID | = lv_cslid | |
| DATUV | = lv_datuv | |
| MATNR | = lv_matnr | |
| NRFDC | = lv_nrfdc | |
| STLAN | = lv_stlan | |
| WERKS | = lv_werks | |
| VBELN | = lv_vbeln | |
| VBELP | = lv_vbelp | |
| TABLES | ||
| KDSTB_WA | = lt_kdstb_wa | |
| STKOB_WA | = lt_stkob_wa | |
| STZUB_WA | = lt_stzub_wa | |
| EXCEPTIONS | ||
| BOM_NOT_ACTIVE = 1 | ||
| BOM_NOT_FOUND = 2 | ||
| CALL_INVALID = 3 | ||
| NO_ALT_FOUND = 4 | ||
| NO_BOM_FOUND = 5 | ||
| ONLY_LINK_FOUND = 6 | ||
| . " CS_ALT_SELECT_KND | ||
ABAP code using 7.40 inline data declarations to call FM CS_ALT_SELECT_KND
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 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 MATNR FROM MASTB INTO @DATA(ld_matnr). | ||||
| "SELECT single XFELD FROM CSDATA INTO @DATA(ld_nrfdc). | ||||
| DATA(ld_nrfdc) | = ' '. | |||
| "SELECT single STLAN FROM MASTB INTO @DATA(ld_stlan). | ||||
| DATA(ld_stlan) | = ' '. | |||
| "SELECT single WERKS FROM MASTB INTO @DATA(ld_werks). | ||||
| "SELECT single VBELN FROM KDSTB INTO @DATA(ld_vbeln). | ||||
| "SELECT single VBPOS FROM KDSTB INTO @DATA(ld_vbelp). | ||||
Search for further information about these or an SAP related objects