01-11-2006 3:00 AM
Hi experts,
Where can i find material warranty period table relations.
I saw material warranty period in MM03->CLASSIFICATION view.But i could not find the tables for material & warranty period relations.
Reward guaranteed
cheers
kaki
01-11-2006 3:37 AM
Hi Kaki
The classification data is generally read using the function modules
BAPI_OBJCL_GET_KEY_OF_OBJECT
BAPI_OBJCL_GETCLASSES_KEY
BAPI_CLASS_GET_CHARACTERISTICS
The different table where these are stored are CABN, KLAH, KSSK, INOB, KSML ect.
Hope this helps.
Thanks
Lakshman
01-11-2006 3:37 AM
Hi Kaki
The classification data is generally read using the function modules
BAPI_OBJCL_GET_KEY_OF_OBJECT
BAPI_OBJCL_GETCLASSES_KEY
BAPI_CLASS_GET_CHARACTERISTICS
The different table where these are stored are CABN, KLAH, KSSK, INOB, KSML ect.
Hope this helps.
Thanks
Lakshman
01-11-2006 3:43 AM
Hi Lakshman,
I found CABNT-ATBEZ(warranty period) & CABN-ANZST(months).
But i could not find related MATERIAL tables.
Thanks
kaki
01-11-2006 3:50 AM
Hi Kaki,
At what level do you have the classification? Do you have at material level or batch level? Depending on that, the class type will either be 001 or 022. Now using this and material number(internal representation), call function module CLSE_CLASSIFICATION_OF_OBJECTS(I may be slightly wrong on the name as I am not in front of the system). This will return you an internal table with all the classification values of your material. Check the characteristic name of your material warranty period and get its value from this internal table.
Let me know if you need help in this regard,
Srinivas
OK, the function module name is <b>CLAF_CLASSIFICATION_OF_OBJECTS</b>
Message was edited by: Srinivas Adavi
01-11-2006 4:15 AM
Here is some sample code calling this function module.
data: object like type ausp-objek.
data: classtab type table of sclass.
data: obtab type table of clobjdat with header line.
call function 'CLAF_CLASSIFICATION_OF_OBJECTS'
exporting
classtype = '001'
object = object
tables
t_class = classtab
t_objectdata = obtab
exceptions
no_classification = 1
no_classtypes = 2
invalid_class_type = 3
others = 4
IF sy-subrc = 0.
READ TABLE obtab WITH KEY atnam = 'MATERIAL_WARRANTY_PERIOD'.
IF sy-subrc = 0 AND obtab-ausp1 <> '?'.
MOVE obtab-ausp1 TO warranty.
ENDIF.
ENDIF.
01-11-2006 4:22 AM
Hi Srinivas ,
I got the details into T_OBJECTDATA
REPORT TEST.
DATA:T_OBJECTDATA LIKE CLOBJDAT OCCURS 0 WITH HEADER LINE.
DATA:T_CLASS LIKE SCLASS OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
EXPORTING
CLASS = 'ZCS_SALESCODE '
CLASSTEXT = 'X'
CLASSTYPE = '001'
CLINT = 0
FEATURES = 'X'
LANGUAGE = SY-LANGU
OBJECT = 'CS-REPLACEDOOR'
* OBJECTTABLE = ' '
KEY_DATE = SY-DATUM
INITIAL_CHARACT = 'X'
* NO_VALUE_DESCRIPT =
CHANGE_SERVICE_CLF = 'X'
* INHERITED_CHAR = ' '
* CHANGE_NUMBER = ' '
TABLES
T_CLASS = T_CLASS
T_OBJECTDATA = T_OBJECTDATA
* 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.
Thanks a lot.
full points alloted
cheers
kaki
01-11-2006 3:41 AM
KLAH and KSSK, but you should use FMs to retrieve the data:
* "/ Classifications
data: begin of exp_objects occurs 0.
include structure clobj.
data: class like klah-class.
data: end of exp_objects.
data: begin of exp_objects2 occurs 0.
include structure clobj.
data: class like klah-class.
data: end of exp_objects2.
data: begin of imp_features occurs 0,
dummy,
end of imp_features.
data: begin of exp_values occurs 0.
include structure ausp.
data: end of exp_values.
data: begin of imp_seltab occurs 0.
include structure comw.
data: end of imp_seltab.
data: begin of fund_class occurs 0.
data: fund like fmfincode-fincode.
data: end of fund_class.
data: begin of i_class occurs 0,
obj like kssk-objek,
int_class like kssk-klart.
data: end of i_class.
perform get_objects_in_class. "top level of class
perform get_objects_in_class2. "remaining class levels and objs
form get_objects_in_class.
* get class internal number --------------------------------------------
select * from klah
where klart = '042'
and class in s_class.
* get objects using class id -------------------------------------------
clear exp_objects2.
refresh exp_objects2.
call function 'CLSC_SELECT_OBJECTS'
exporting
imp_direction = ' '
imp_exit_after_found = ' '
imp_klah = klah
imp_language = sy-langu
imp_language_neutral = ' '
imp_no_of_sortcolumns = 5
imp_object = ' '
imp_object_feature = ' '
tables
exp_objects = exp_objects2
exp_values = exp_values
imp_features = imp_features
imp_seltab = imp_seltab
exceptions
no_objects_found = 01
one_object_found = 02.
if sy-subrc = 01.
message e025 with 'No objects found.'.
else.
loop at exp_objects2.
move-corresponding exp_objects2 to exp_objects.
move klah-class to exp_objects-class.
collect exp_objects.
endloop.
endif.
endselect.
if sy-subrc ne 0.
message e025 with 'Type and Class not found.'.
endif.
endform. " GET_OBJECTS_IN_CLASS
form get_objects_in_class2.
data: inobjek like inob-cuobj.
loop at exp_objects
where mafid = 'K'. "classes
* get class internal number --------------------------------------------
select * from klah
where klart = '042'
and class = exp_objects-obj.
endselect.
* get objects using class id -------------------------------------------
clear exp_objects2. refresh exp_objects2.
call function 'CLSC_SELECT_OBJECTS'
exporting
imp_direction = ' '
imp_exit_after_found = ' '
imp_klah = klah
imp_language = sy-langu
imp_language_neutral = ' '
imp_no_of_sortcolumns = 5
imp_object = ' '
imp_object_feature = ' '
tables
exp_objects = exp_objects2
exp_values = exp_values
imp_features = imp_features
imp_seltab = imp_seltab
exceptions
no_objects_found = 01
one_object_found = 02.
if sy-subrc = 0.
loop at exp_objects2.
move-corresponding exp_objects2 to exp_objects.
move klah-class to exp_objects-class.
collect exp_objects.
endloop.
endif.
endloop. "exp_objects
* keep objects only ----------------------------------------------------
loop at exp_objects
where mafid ne 'O'. "objects
delete exp_objects.
endloop.
* Convert internal nunbers to object numbers
loop at exp_objects.
inobjek = exp_objects-obj.
call function 'CUOB_GET_OBJECT'
exporting
object_number = inobjek
importing
object_id = exp_objects-obj
exceptions
not_found = 1.
check not sy-subrc eq 1.
modify exp_objects.
endloop.
* Put the Funds Centres and classifications into a table to be used by
* a binary search.
loop at exp_objects.
move exp_objects-obj+4(6) to fund_class-fund.
append fund_class.
endloop.
sort fund_class by fund.
endform. " GET_OBJECTS_IN_CLASS2
This is just cut and paste from an application that gets classifications, but not for material. You'll have to re-work it to meet your requirements.
Rob