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: 

material classification data

former_member239066
Participant
0 Kudos

hi guys,

on mm03 we can view classification data of a particular material. does anybody know a function module or bapi that can be used to retrieve classification data for any material?

thanks,

vitish

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check this code

DATA: V_CLASS LIKE KLAH-CLASS VALUE 'MAT_SEL_CLASS_JASC',

V_CLASSTYPE LIKE KLAH-KLART VALUE '023',

V1_OBJECT LIKE AUSP-OBJEK,(nothing but material no)

V_OBJECTTABLE LIKE TCLA-OBTAB VALUE 'MARA',

V_LANGU LIKE SY-LANGU,

V_DATUM LIKE SY-DATUM.

V_LANGU = 'EN'.

V_DATUM = SY-DATUM.

CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'

EXPORTING

CLASS = V_CLASS

CLASSTEXT = 'X'

CLASSTYPE = V_CLASSTYPE

CLINT = 0

FEATURES = 'X'

LANGUAGE = V_LANGU

OBJECT = V1_OBJECT

OBJECTTABLE = V_OBJECTTABLE

KEY_DATE = V_DATUM

INITIAL_CHARACT = 'X'

NO_VALUE_DESCRIPT =

CHANGE_SERVICE_CLF = 'X'

INHERITED_CHAR = ' '

CHANGE_NUMBER = ' '

TABLES

T_CLASS = T_CLASS

T_OBJECTDATA = T_CLOBJDAT

I_SEL_CHARACTERISTIC =

T_NO_AUTH_CHARACT =

EXCEPTIONS

NO_CLASSIFICATION = 1

NO_CLASSTYPES = 2

INVALID_CLASS_TYPE = 3

OTHERS = 4 .

IF SY-SUBRC 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

READ TABLE T_CLOBJDAT INDEX 2. " KEY 'MAT_CHAR_THICKNESS'.

IF SY-SUBRC = 0.

T_OUTPUT1-THICK = T_CLOBJDAT-AUSP1.

ENDIF.

You can also try this BAPI BAPI_OBJCL_GETDETAIL

Regards,

Satish

3 REPLIES 3

Former Member
0 Kudos

Hi,

Check this code

DATA: V_CLASS LIKE KLAH-CLASS VALUE 'MAT_SEL_CLASS_JASC',

V_CLASSTYPE LIKE KLAH-KLART VALUE '023',

V1_OBJECT LIKE AUSP-OBJEK,(nothing but material no)

V_OBJECTTABLE LIKE TCLA-OBTAB VALUE 'MARA',

V_LANGU LIKE SY-LANGU,

V_DATUM LIKE SY-DATUM.

V_LANGU = 'EN'.

V_DATUM = SY-DATUM.

CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'

EXPORTING

CLASS = V_CLASS

CLASSTEXT = 'X'

CLASSTYPE = V_CLASSTYPE

CLINT = 0

FEATURES = 'X'

LANGUAGE = V_LANGU

OBJECT = V1_OBJECT

OBJECTTABLE = V_OBJECTTABLE

KEY_DATE = V_DATUM

INITIAL_CHARACT = 'X'

NO_VALUE_DESCRIPT =

CHANGE_SERVICE_CLF = 'X'

INHERITED_CHAR = ' '

CHANGE_NUMBER = ' '

TABLES

T_CLASS = T_CLASS

T_OBJECTDATA = T_CLOBJDAT

I_SEL_CHARACTERISTIC =

T_NO_AUTH_CHARACT =

EXCEPTIONS

NO_CLASSIFICATION = 1

NO_CLASSTYPES = 2

INVALID_CLASS_TYPE = 3

OTHERS = 4 .

IF SY-SUBRC 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

READ TABLE T_CLOBJDAT INDEX 2. " KEY 'MAT_CHAR_THICKNESS'.

IF SY-SUBRC = 0.

T_OUTPUT1-THICK = T_CLOBJDAT-AUSP1.

ENDIF.

You can also try this BAPI BAPI_OBJCL_GETDETAIL

Regards,

Satish

0 Kudos

hi satish,

thanks for your reply. it is really helpful. but can you please tell me how do i get the classtype of a particular material?

thanks,

vitish.

Former Member
0 Kudos

Hi Vitish,

Use FM 'BAPI_OBJCL_GETDETAIL' to retrieve the classification data.

Import params:

1. Object key : give the material number

2. Object table : give material master table i.e. MARA

3. Class Num: Give the class name from which u have to fetch the characteristic data

4. Class type: give '001' for material

You will get the classification data in the following tables:

ALLOCVALUESNUM

ALLOCVALUESCHAR

ALLOCVALUESCURR

This should be helpful, do get back in case of any queries.

Thanks and regards,

Sonal