2007 Jul 27 4:52 PM
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.
2007 Jul 27 4:59 PM
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
2007 Jul 27 4:59 PM
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
2007 Jul 27 7:31 PM
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.
2007 Jul 27 7:35 PM
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.
2007 Jul 27 7:45 PM
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.