SAP CS_WHERE_USED_CLA_VIA_CLA Function Module for Bills of material; class use via classes









CS_WHERE_USED_CLA_VIA_CLA is a standard cs where used cla via cla SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Bills of material; class use via classes 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 where used cla via cla FM, simply by entering the name CS_WHERE_USED_CLA_VIA_CLA into the relevant SAP transaction such as SE37 or SE38.

Function Group: CSS5
Program Name: SAPLCSS5
Main Program: SAPLCSS5
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CS_WHERE_USED_CLA_VIA_CLA 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_WHERE_USED_CLA_VIA_CLA'"Bills of material; class use via classes
EXPORTING
DATUB = "Date 'valid to'
DATUV = "Date 'valid from'
KLART = "Class type
KLASS = "Class
POSTP = "Item category
STLAN = "BOM usage
WERKS = "Plant
* STLTP = ' ' "
* NEWSI = ' ' "

IMPORTING
TOPKLA = "Data on the initial material

TABLES
WULTB = "WHERE-USED listg table (items)
KNDCAT = "Assembly table: sales orders
MATCAT = "Assembly table: materials

EXCEPTIONS
CALL_INVALID = 1 CLASS_NOT_FOUND = 2 NO_WHERE_USED_REC_FOUND = 3 NO_WHERE_USED_REC_SELECTED = 4 NO_WHERE_USED_REC_VALID = 5
.



IMPORTING Parameters details for CS_WHERE_USED_CLA_VIA_CLA

DATUB - Date 'valid to'

Data type: RC29L-DATUB
Optional: No
Call by Reference: No ( called with pass by value option)

DATUV - Date 'valid from'

Data type: RC29L-DATUV
Optional: No
Call by Reference: No ( called with pass by value option)

KLART - Class type

Data type: KLAH-KLART
Optional: No
Call by Reference: No ( called with pass by value option)

KLASS - Class

Data type: KLAH-CLASS
Optional: No
Call by Reference: No ( called with pass by value option)

POSTP - Item category

Data type: RC29L-POSTP
Optional: No
Call by Reference: No ( called with pass by value option)

STLAN - BOM usage

Data type: RC29L-STLAN
Optional: No
Call by Reference: No ( called with pass by value option)

WERKS - Plant

Data type: RC29L-WERKS
Optional: No
Call by Reference: No ( called with pass by value option)

STLTP -

Data type: RC29A-ATABR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

NEWSI -

Data type: CSDATA-XFELD
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for CS_WHERE_USED_CLA_VIA_CLA

TOPKLA - Data on the initial material

Data type: CSXKLA
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for CS_WHERE_USED_CLA_VIA_CLA

WULTB - WHERE-USED listg table (items)

Data type: STPOV
Optional: No
Call by Reference: No ( called with pass by value option)

KNDCAT - Assembly table: sales orders

Data type: CSCKND
Optional: No
Call by Reference: No ( called with pass by value option)

MATCAT - Assembly table: materials

Data type: CSCMAT
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

CALL_INVALID - Function module call incomplete or invalid

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

CLASS_NOT_FOUND - Class not available

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_WHERE_USED_REC_FOUND - no where used record available

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_WHERE_USED_REC_SELECTED - no where used record selected

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_WHERE_USED_REC_VALID - no valid where used record available

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for CS_WHERE_USED_CLA_VIA_CLA 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_datub  TYPE RC29L-DATUB, "   
lt_wultb  TYPE STANDARD TABLE OF STPOV, "   
lv_topkla  TYPE CSXKLA, "   
lv_call_invalid  TYPE CSXKLA, "   
lv_datuv  TYPE RC29L-DATUV, "   
lt_kndcat  TYPE STANDARD TABLE OF CSCKND, "   
lv_class_not_found  TYPE CSCKND, "   
lv_klart  TYPE KLAH-KLART, "   
lt_matcat  TYPE STANDARD TABLE OF CSCMAT, "   
lv_no_where_used_rec_found  TYPE CSCMAT, "   
lv_klass  TYPE KLAH-CLASS, "   
lv_no_where_used_rec_selected  TYPE KLAH, "   
lv_postp  TYPE RC29L-POSTP, "   
lv_no_where_used_rec_valid  TYPE RC29L, "   
lv_stlan  TYPE RC29L-STLAN, "   
lv_werks  TYPE RC29L-WERKS, "   
lv_stltp  TYPE RC29A-ATABR, "   SPACE
lv_newsi  TYPE CSDATA-XFELD. "   SPACE

  CALL FUNCTION 'CS_WHERE_USED_CLA_VIA_CLA'  "Bills of material; class use via classes
    EXPORTING
         DATUB = lv_datub
         DATUV = lv_datuv
         KLART = lv_klart
         KLASS = lv_klass
         POSTP = lv_postp
         STLAN = lv_stlan
         WERKS = lv_werks
         STLTP = lv_stltp
         NEWSI = lv_newsi
    IMPORTING
         TOPKLA = lv_topkla
    TABLES
         WULTB = lt_wultb
         KNDCAT = lt_kndcat
         MATCAT = lt_matcat
    EXCEPTIONS
        CALL_INVALID = 1
        CLASS_NOT_FOUND = 2
        NO_WHERE_USED_REC_FOUND = 3
        NO_WHERE_USED_REC_SELECTED = 4
        NO_WHERE_USED_REC_VALID = 5
. " CS_WHERE_USED_CLA_VIA_CLA




ABAP code using 7.40 inline data declarations to call FM CS_WHERE_USED_CLA_VIA_CLA

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 DATUB FROM RC29L INTO @DATA(ld_datub).
 
 
 
 
"SELECT single DATUV FROM RC29L INTO @DATA(ld_datuv).
 
 
 
"SELECT single KLART FROM KLAH INTO @DATA(ld_klart).
 
 
 
"SELECT single CLASS FROM KLAH INTO @DATA(ld_klass).
 
 
"SELECT single POSTP FROM RC29L INTO @DATA(ld_postp).
 
 
"SELECT single STLAN FROM RC29L INTO @DATA(ld_stlan).
 
"SELECT single WERKS FROM RC29L INTO @DATA(ld_werks).
 
"SELECT single ATABR FROM RC29A INTO @DATA(ld_stltp).
DATA(ld_stltp) = ' '.
 
"SELECT single XFELD FROM CSDATA INTO @DATA(ld_newsi).
DATA(ld_newsi) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!