‎2006 Jun 06 2:58 PM
When displaying a material using MM03, I then select the classification view, I'm looking at the values for a particular class. Can anyone tell me how to read the current values for a certain characteristic description using a function module etc.
Thanks
C
‎2006 Jun 06 3:16 PM
Hi,
Did you look at the funciton BAPI_OBJCL_GET_DETAILS to get the configuration for a specific material?
Regards,
Ravi
‎2006 Jun 06 3:33 PM
Hi Ravi,
It's telling me BAPI_OBJCL_GET_DETAILS does not exist
‎2006 Jun 06 3:57 PM
Hi,
Look at the BAPI's under classification system in the BAPI transaction, you will find a huge list of BAPI's there for dealing with material classification.
Regards,
Ravi
‎2006 Jun 06 3:18 PM
You can use CLFM_SELECT_AUSP (or also can directly select from the table AUSP).
Here is a sample for how to use the FM:
First apply CONVERSION_EXIT_ATINN_INPUT on the characateristic name of your charactersitic and store the value in g_feature (TYPE atinn).
Then
CALL FUNCTION 'CLFM_SELECT_AUSP'
EXPORTING
MAFID = O
CLASSTYPE = 001 (material class)
OBJECT = Material no.
FEATURE = G_FEATURE
TABLES
EXP_AUSP = T_EXP_AUSP
‎2006 Jun 06 3:32 PM
I tried that but nothing was returned, these are my parameters.
CALL FUNCTION 'CLFM_SELECT_AUSP'
EXPORTING
MAFID = O
CLASSTYPE = 023 (Batch)
OBJECT = Material no.
FEATURE = G_FEATURE
TABLES
EXP_AUSP = T_EXP_AUSP
I also tried to read from AUSP uing Material No as the object and had no joy there either.
‎2006 Jun 06 3:36 PM
If you are trying to get material classification values, use CLASSTYPE = '001'. Why are you using '023'?
I forgot the exact format of OBJECT also. Just once go to AUSP, all the classification values are stored there. Give classtype '001' and ATINN as your characteristic name and pick up any of the results displayed to see how the material no. is converted to OBJECT.
‎2006 Jun 06 4:30 PM
It's the current characteristic value against Class type 023(Batch) - Object 'Material No' I want to read, the classification was the view I selected from the initial screen of MM03.
Let me explain in more detail as I was only using transaction MM03 to describe what values I wanted to read.
We have a program that uploads a CSV file to upload Batch characteristics. This program uses the FUNCTION 'CLMM_MAINTAIN_CLASSIFICATIONS' to do this. However using this FM you have to pass it 2 tables, i.e. 'Valuation_old' and a 'Valuation_new'. The problem I have is I don't know how to retreive the old (or at this moment in time the current values), therefore I'm currently manually having to enter a value against each characteristic description I want to change as this FM doesn't seem to work if you don't know the EXACT value.
‎2006 Jun 06 4:48 PM
Ok then you are right to use '023'.
I am giving you here the exact code I wrote. Should work for you as well. By the way, did you check AUSP in SE16?
DATA: g_object type objnum,
g_feature type atinn.
Store material no.
g_object = p_matnr.
Get the internal format of characteristic value
MDT_PRODUCT_NUMBER.
call function 'CONVERSION_EXIT_ATINN_INPUT'
exporting
input = <your charac name>
importing
output = g_feature.
Get product number (EXP_AUSP-ATWRT).
call function 'CLFM_SELECT_AUSP'
exporting
mafid = c_mafid " O
classtype = c_classtype " 001
object = g_object " Object no.
feature = g_feature
tables
exp_ausp = t_exp_ausp
exceptions
no_values = 1
others = 2.
if sy-subrc = 0.
when retrieval is successful,read table t_exp_ausp and get product no.
read table t_exp_ausp into w_exp_ausp index 1.
<your desired value> = w_exp_ausp-atwrt.
‎2006 Jun 06 4:51 PM
Hi,
CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
EXPORTING
OBJECTKEY =
OBJECTTABLE =
CLASSNUM =
CLASSTYPE =
KEYDATE = SY-DATUM
UNVALUATED_CHARS = ' '
LANGUAGE = SY-LANGU
IMPORTING
STATUS =
STANDARDCLASS =
TABLES
ALLOCVALUESNUM =
ALLOCVALUESCHAR =
ALLOCVALUESCURR =
RETURN =
You should be able to get the current allocations using the above function for the given classes the material is allocated
Regards,
Ravi
Note :Please mark all the helpful answers
‎2006 Jun 07 9:42 AM
Thanks for that, I can now read the values and the program updates the current value with the new value, however this only happens if there is a current value. If the value is null (when looking in MM03) the program will not update the value. Any ideas?
C
‎2006 Jun 07 9:52 AM
If you want to update the classification data for a material use the BAPI BAPI_OBJCL_CHANGE.
Regards,
Ravi
‎2006 Jun 06 3:50 PM
Hi,
Are you passing complete Material #'s because whole material number(leading 0's) needs to be passed.
You can use FM CONVERSION_EXIT_MATN1_INPUT to convert material number.
Then you can directly retrieve values from AUSP table or use FM CLFM_SELECT_AUSP.
Cheers,
Vikram
Pls reward for helpful replies!!
‎2006 Jun 06 3:59 PM
Hi c,
Try this code
get classes assigned to object(here object is material no)
CALL FUNCTION 'CACL_OBJECT_READ_ALLOCATIONS'
EXPORTING
object = temp_objnum(matnr)
object_type = const_obj_type(mara)
class_type = const_class_type(001)
TABLES
object_identification = itab_objid
allocations = itab_alloc
EXCEPTIONS
error = 1
warning = 2
OTHERS = 3.
IF sy-subrc <> 0.
return-type = 'E'.
return-id = 'ZMM'.
return-number = '000'.
return-message = 'Error reading classes assigned to object'.
EXIT.
ENDIF.
read itab_alloc with key class = 'class which you want to get characteristics and values'
CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
EXPORTING
objectkey = temp_objnum(matnr)
objecttable = const_obj_type(mara)
classnum = itab_alloc-class
classtype = '001'
unvaluated_chars = 'X'
TABLES
allocvaluesnum = itab_char_num
allocvalueschar = itab_char_char
allocvaluescurr = itab_char_curr
return = tret.
READ TABLE tret INDEX 1.
IF tret-type = 'E'.
return-type = 'E'.
return-id = 'ZPM'.
return-number = '000'.
return-message = 'Error reading values'.
EXIT.
ENDIF.
Hope you can find from here how to get the characteristic values.
Also reward points if it helps.
I had a similer requirement and this is my code.
Thanks,
Rajesh.
‎2006 Jun 06 4:06 PM
Hi,
1 more thought, MAFID value is 'O' and not '0' (zero).
Cheers,
Vikram
Pls reward for helpful replies!!
‎2006 Jun 06 4:12 PM
Hi,
Use Fm CONVERSION_EXIT_MATN1_INPUT to convert material number and pass output material # to the below FM.
CALL FUNCTION 'CLFM_SELECT_AUSP'
EXPORTING
MAFID = O " This is 'O' and not '0' (zero)
CLASSTYPE = 001 "material class or i/p as per ur req.
OBJECT = Material no. "18 digit
FEATURE = G_FEATURE "optional
TABLES
EXP_AUSP = T_EXP_AUSP
You will get results in T_EXP_AUSP table.
Cheers,
Vikram
Pls reward for helpful replies!!