- Purpose: To create/change/delete/read the details of Material Classification data.
- Description: Using Material Classifications standard BAPI’s has below limitations
A. If characteristics for class numbers are of different data types (CHAR or NUMC or CURR) and if any class number misses any data type characters, then script doesn’t work.
B. If everything fine with data type, User can able to maintain only one class number per class. But there are many cases where each class type can have multiple class numbers assigned.
Following is the interface for the function module.
- I_Mode
- Flag to check which action need to be performed.
- Allowed values are:
‘GETDETAIL’= To read the characteristics Values.‘CREATE’ =To create the characteristics Values.‘CHANGE’ =To change the characteristics Values.‘DELETE’=To delete the characteristics Values.‘F4DETAILS’=To get the Permitted/allowed values of any Class number.‘GETMATCLASS’=To get the assigned material class numbers for any object. SK-this works for other objects, too.,i.e. can pass in equipment # , obj table EQUI, class type 002 and get list of classes.
- I_OBJECTKEY: Key of object to be classified
- I_OBJECTTABLE: Name of database table for object
- I_CLASSNUM: Respective Class number for which Action to be performed
- I_CLASSTYPE: Respective Class Type for which Action to be performed
- I_KEYDATE: Key date
- I_UNVALUATED_CHARS: Output Characteristics Without Assigned Values
- I_LANGUAGE: Language Key from SAP Logon
- I_STATUS: Classification status
- I_STANDARDCLASS: Indicator: Standard Class
- I_CHANGENUMBER: Change Number
- I_NO_DEFAULT_VALUES: Default Values
- I_LANGU_ISO: Language according to ISO 639
- I_LANGU_INT: Language Key from SAP Logon
- I_WITH_VALUES: Indicator with values
- STATUS: Classification Status
- STANDARDCLASS
- CLASSIF_STATUS: Classification Status
Table Parameters
- ALLOCVALUES: This table contains the values of all data types i.e NUM, DATE, TIME, CHAR, BOOLEAN and CURR Values. First column of this table will be a flag to differentiate the different data types and second column contains the respective class numbers.
- ALL_MULTI_CLASS_VALUES: This table contains the structure of classification data which user want to use for Create and Change Conditions for respective class numbers.
- CV_IM_CHARACTERISTICS: This table contains INPUT values and required Characteristics values. (Note- This Table Only using when I_MODE = ‘F4DETAILS’)
- CV_EX_CHARACTERISTICS: This Table contains OUTPUT values only and return Chars with Attributes values. (Note- This Table Only using when I_MODE = ‘F4DETAILS’)
- CV_EX_CHAR_VALUES: This table Contains OUTPUT Values and return Allowed Values for Characteristics. (Note- This Table Only using when I_MODE = ‘F4DETAILS’)
- ALLOCLIST: This table will return the material classes assigned to any object. (Note- This Table Only using when I_MODE = ‘GETMATCLASS’)
- WIN_RETURN: This table contains the return messages.
- INVALID_MODE: This exception occurs in case user has provided Wrong entry as input for Mode of Operation.
- MANDATORY_PARAM: This exception occurs if user has not provided one or more parameters that are required for that Mode of Operation.
- MANDATORY_PARAM_MISSING
- NOT_AUTHORIZED_TRN_MT_CLASIFIC
- NO_CHARCTERISTICS_VALUE_FOUND
- NOT_AUTHORIZED_BAPI_OBJCL_CRTE
- NOT_AUTHORIZED_BAPI_TRN_COMMIT
- NOT_AUTHORIZED_BAPI_OBJCL_CHGE
- NOT_AUTHORIZED_BAPI_GETDETAIL
- NOT_AUTHORIZED_BAPI_DELETE
- NOT_AUTHORIZED_GET_CHARACTICS
Use Cases:
Following use cases are defined for this WFM.
Note-All the use cases will run independent of each other.
Case 1:- Read Classifications Details:-
For Single Class Number:-
User can read the classification details by providing relevant input values and the result data will returned into a single Table ‘ALLOCVALUES’.
I_Mode should be entered as ‘GETDETAIL’ for this scenario.
Execution of WFM can be done by providing fields Object Key (I_OBJECTKEY), Object Table (I_OBJECTTABLE) , Class Number (I_CLASSNUM) , Class Type ( I_CLASSTYPE) and others.
The Output Table ‘ALLOCVALUES´ will contains data of all the Numeric Values, Alphanumeric Values and Currency Values in a single table where through Return FLAG = ‘NUM’ ,FLAG = ‘CHAR’ or FLAG =‘CURR’ , user can identify the specific data type values.
Following message is returned in table WIN_RETURN on successful execution of FM.
For Multiple Class Numbers: -
I_Mode should be entered as ‘GETDETAIL’ for this scenario.
Tables will contain data in this scenario.
User can pass the details for Multiple Class numbers by providing relevant input values as below.
Table ‘ALL_MULTI_CLASS_VALUES´ will contains the required INPUT values for different class number as below.
The Output Table ‘ALLOCVALUES´ will contains data of all the Numeric Values, Alphanumeric Values and Currency Values for respective class numbers as below.
Following message is returned in table WIN_RETURN for respective class numbers on successful execution of FM.
Case 2- Create Classifications: -
For Single Class Number :-
I_Mode should be entered as ‘CREATE’ for this scenario.
User can Create Assignments by providing relevant input values as below.
Table ‘ALLOCVALUES´ will contains the required INPUT values for different data types and for a single class number.
Once, we execute RFM with the data provided as above. It will create a new assignment for the respective classification.
Following message is returned in table WIN_RETURN on successful execution of FM.
Same can be checked on T-code ‘MM03’ as below.
For Multiple Class Numbers: -
I_Mode should be entered as ‘CREATE’ for this scenario.
Tables will contain data in this scenario.
User can Create Assignments for Multiple Class numbers by providing relevant input values as below.
Table ‘ALLOCVALUES´ will contains the required INPUT values for different data types and for respective class number as below.
Table ‘ALL_MULTI_CLASS_VALUES’ will contains the details of Multiple Class Numbers and Class Types as below.
Once, we execute RFM with the data provided as above. It will create a new assignment for the respective classification.
Following message is returned in table WIN_RETURN on successful execution of FM.
Case 3:- Change Classifications:
For Single Class Number: -
User also has the provision to modify existing classification assignments. If the details are changed successfully, then the relevant success message is returned to user in interface table RETURN.
Mode should be entered as ‘CHANGE’ for this scenario.
User can change the assignments by providing relevant input values as below.
Table ‘ALLOCVALUES’ contains the relevant values for single class number as below.
Following message is returned in table WIN_RETURN on successful execution of FM.
For Multiple Class Numbers: -
I_Mode should be entered as ‘CREATE’ for this scenario.
Tables will contain data in this scenario.
User can change the Assignments for Multiple Class numbers by providing relevant input values as below.
Table ‘ALLOCVALUES´ will contains the required INPUT values for different data types and multiple class numbers as below.
Table ‘ALL_MULTI_CLASS_VALUES’ will contains the details of Multiple Class Numbers and Class Types as below.
Once, we execute RFM with the data provided as above. It will change the assignments for the respective class numbers.
Following message is returned in table WIN_RETURN on successful execution of FM.
Case 4:- Delete Assignments:-
User can delete the any Assignments by providing relevant input values as below.
For Single Class Numbers: -
User can Delete any existing Assignments.
I_Mode should be entered as ‘DELETE’ for this scenario.
Following message is returned in table WIN_RETURN on successful execution of FM.
For Multiple Class Numbers: -
I_Mode should be entered as ‘DELETE’ for this scenario.
Tables will contain data in this scenario.
User can DELETE the Assignments for Multiple Class numbers by providing relevant input values as below.
Table ALL_MULTI_CLASS_VALUES will contain the multiple class numbers data as below
Once, we execute RFM with the data provided as above. It will delete the assignments for the respective class numbers.
Following message is returned in table WIN_RETURN on successful execution of FM.
Case 5:- Read Possible Values:-
User can read the possible Assignments values by providing relevant input values as below.
For Single Class Numbers: -
I_Mode should be entered as ‘F4DETAILS’ for this scenario.
Table ‘ALLOCVALUES’ and ‘ALL_MULTI_CLASS_VALUES’ and ‘CV_IM_CHARACTERISTICS´ will remain empty for this scenario.
Table ‘CV_EX_CHARACTERISTICS’ and Table ‘CV_EX_CHAR_VALUES’ will contains the result data after execution of RFM.
In both table ‘CV_EX_CHARACTERISTICS’ and ‘CV_EX_CHAR_VALUES’, the first two field represent the respective class name and class numbers.
For Multiple Class Numbers: -
I_Mode should be entered as ‘F4DETAILS’ for this scenario.
Tables will contain data in this scenario.
User can get the possible allowed vales for any respective class number and class type as below.
Table ‘CV_IM_CHARACTERISTICS´ will contains the details of respective class number and class types as below.
Table ‘ALLOCVALUES’ and ‘ALL_MULTI_CLASS_VALUES’ will remain empty for this scenario.
Table ‘CV_EX_CHARACTERISTICS’ and Table ‘CV_EX_CHAR_VALUES’ will contain the result data after execution of RFM.
In both table ‘CV_EX_CHARACTERISTICS’ and ‘CV_EX_CHAR_VALUES’, the first two field represent the respective class name and class numbers.
Case 6:- Read Classes for Object:-
User can read the details of classes assigned to any object by providing relevant input values and the result data will returned into a single Table ‘ALLOCLIST’.
I_Mode should be entered as ‘GETMATCLASS’ for this scenario.
Table ALLOCLIST will return all the assigned class numbers.
Following message is returned in table WIN_RETURN on successful execution of FM.