Application Development and Automation 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: 
Read only

Extract the classification data into internal table

Former Member
0 Likes
1,136

Hi all,

I having requirement to extract classification data for material number.

1) Provide the selection option for material number (MATNR).

2) Based on the material number, then extract all that data into internal table as below layout. My problem is how to retrieve the following data from different table based on the MATNR (material number).

Please provide the sample code for select the following data. Thanks.

Classification table

OBJEK (from AUSP table)

MAFID (from AUSP table)

KLART (from AUSP table)

CLASS (from KLAH table)

ATWRT (from AUSP table)

MSEHI (from CABN table)

OBTAB (check if class type=002, set it as “MARA”)

STDCL (from KSSK table)

3 REPLIES 3
Read only

Former Member
0 Likes
749

Hi,

Something to correct my Classification table, it should be as below. Could I know how i can select the below data from different table into internal table. What I the linking between below tables. Thanks.

OBJEK (from AUSP table)

MAFID (from AUSP table)

KLART (from AUSP table)

CLASS (from KLAH table)

ATWRT (from AUSP table)

ATAW1 (from AUSP table)

OBTAB (check if class type=002, set it as “MARA”)

STDCL (from KSSK table)

Read only

0 Likes
749

Hi,

if I understand, you´re trying to get information from the classification system for the material. You can use the following code:

DATA: clases LIKE TABLE OF sclass WITH HEADER LINE,

datos LIKE TABLE OF clobjdat WITH HEADER LINE.

CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'

EXPORTING

class = 'DESK' "clase a buscar

classtype = '001' "tipo de la clase

features = 'X'

language = sy-langu

object = 'PM00A000C055' "Material

objecttable = 'MARA'

key_date = sy-datum

initial_charact = 'X'

change_service_clf = 'X'

TABLES

t_class = clases

t_objectdata = datos

EXCEPTIONS

no_classification = 1

no_classtypes = 2

invalid_class_type = 3

OTHERS = 4.

loop at datos.

endloop.

Read only

Former Member
0 Likes
749

I've solved my own. Thanks.