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: 

Getting CLINT from MATNR

Former Member
0 Kudos

Hi everyone! I'm working some changes in a report in wich my only input is a material number (MATNR). What I need is to obtain, using just this number, the Internal Class Number of the material (CLINT) in order to select the class description (CLASS and KLART) from KLAH table. Does anybody know how to do this, what tables should I use, or at least where to start searching?

Thanks a lot,

Fernando.

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

Instead of searching for tables, try to make use of the following FMs:

BAPI_OBJCL_GETCLASSES

BAPI_OBJCL_GETDETAIL

YOu should pass the OBJECTKEY = material number and

OBJECTTABLE = 'MARA'.

Regards,

Ravi

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos

Instead of searching for tables, try to make use of the following FMs:

BAPI_OBJCL_GETCLASSES

BAPI_OBJCL_GETDETAIL

YOu should pass the OBJECTKEY = material number and

OBJECTTABLE = 'MARA'.

Regards,

Ravi

0 Kudos

Thanks Ravi. I've tried it, but I get a dump because of a missing parameter, CLASSTYPE_IMP.

Do you happen to know what that one is, or where can I search to figure it out?

Thanks again,

Fernando.

Former Member
0 Kudos

hi Fernando,

Classtype_imp is a mandatory field so pas it in this way to avoid the error...

call function 'BAPI_OBJCL_GETCLASSES'
         exporting
              objectkey_imp   = objnum
              objecttable_imp = 'MARA'
              classtype_imp   = '022'
         tables
              alloclist       = alloclist
              return          = return.
    if alloclist[] is initial.
      write: / 'No Class Allocation for Material: ',
               <wa_batch>-matnr, <wa_batch>-pack_id.
      continue.
    endif.

0 Kudos

Hi, thanks, I figured out that it's obligatory, my problem is that I just don't have any other data about the material than it's number and what I have to find out is precisely the class.

Thanks again,

Fernando.