Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Function Module to Read attributes value from Classification tab

Former Member

Dear Experts ,

We are using material classification in the material master. Under classification tab of material master , we are maintaining certain characteristics and their corresponding values.

I want to read those values and use those in one of the report.

Can you please help me in identifying Function Module which will return the values of all the attributes of that material.

Thanks in advnce,

Regards,

Nikhil

8 REPLIES 8

former_member320332
Contributor
0 Kudos

Hi Nikhil,

You can Use 'BAPI_OBJCL_GETDETAIL' it requires OBJECTKEY -material number in your case

OBJECTTABLE- MARA, CLASSNUM-Give your class name,CLASSTYPE-give your class type also

another FM for this functionality CLAF_CLASSIFICATION_OF_OBJECTS.

Regards,

Pawan

former_member404244
Active Contributor
0 Kudos

Hi,

You can use the function module CLAF_CLASSIFICATION_OF_OBJECTS .

You can also try to use the table AUSP to read the values..You need to specify the OBJEK as material number(18 char).

Regards,

Nagaraj

anup_deshmukh4
Active Contributor
0 Kudos

Hello Nikhil if you have plant and Material you will fetch the CUOBJ field from MARC table and pass it to

VC_I_GET_CONFIGURATION you will get you desired value in the return table

0 Kudos

Dear Anup ,

The Material in question is not confiurable material. Hence CUOBJ field in MARC in blank.

Please suggest.

Regards,

Nikhil

0 Kudos

You can check those details using CT06 transaction.

FM CLAF_CLASSIFICATION_OF_OBJECTS can be used to retrive the data using program.


    CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
      EXPORTING
        class              = gc_class
        classtext          = 'X'
        classtype          = gc_classtype
        clint              = gc_mmpsk
        features           = 'X'
        language           = sy-langu
        object             = l_object
        key_date           = sy-datum
        initial_charact    = 'X'
        change_service_clf = ' '
        inherited_char     = 'X'
      TABLES
        t_class            = lt_class
        t_objectdata       = lt_objectdata
      EXCEPTIONS
        no_classification  = 1
        no_classtypes      = 2
        invalid_class_type = 3
        OTHERS             = 4.

tushar_shukla
Active Participant

Use BAPI 'BAPI_OBJCL_GETCLASSES' to retrieve the classification details for given material. Refer the documentation of BAPI for more details . Here is sample code for BAPI call .

       
 DATA :   v_objectkey TYPE bapi1003_key-object ,          
              v_classtype TYPE bapi1003_key-classtype .

          v_objectkey = matnr.            " material 
         v_classtype = '023'.             " Classification type          

        CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
            EXPORTING
              objectkey_imp     = v_objectkey
              objecttable_imp   = 'MARA''
              classtype_imp     = v_classtype
              read_valuations   = 'X'
            TABLES
              alloclist       = l_i_alloclist
              allocvalueschar = l_i_char_value
              return          = l_i_return.

0 Kudos

HI Tushar ,

I tried to use this BAPI.

But I am getting message as "Object does not Exists".

Please suggest.

Regards,

Nikhil

0 Kudos

Nikhil,

You may be passing some incorrect parameter to this BAPI , I just mentioned above a sample code , please try with passing existing material number and classification type to BAPI in your system. You can pass hardcoded value 'MARA' to objecttable_imp parameter.

I used this BAPI in past and it worked perfectly for me .