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: 

BAPI/FM to get classification data from Material

Former Member
0 Kudos
22,598

I have found VBWS_MARA_CLASSIFICATION_GET but this always tells me that the class isn't found. Then I found a few threads that gave me BAPI_OBJCL_GETDETAIL but that doesn't help if I don't know the class object. Is there any way to get the material classification data through a BAPI or FM that I can put into a BAPI? If not then what do I have to do to get this data?

Regards,

Davis

1 ACCEPTED SOLUTION

Former Member
3,505

Hi Davis,

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.

cheers,

Hema.

4 REPLIES 4

Former Member
0 Kudos
3,505

Hi Davis,

if u r talking about material description then it MAKT.

or,

use the Fn module : read_text.

cheers,

Hema.

Former Member
3,506

Hi Davis,

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.

cheers,

Hema.

0 Kudos
3,505

Hema,

Thank you very much for that information. I

Regards,

Davis

Edited by: Davis on Jan 17, 2008 2:00 PM

Former Member
0 Kudos
3,505

Or Davis u can use the following code, I got it 4m my friend.

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.

cheers,

Hema.