2005 May 17 1:29 PM
Hi all,
I have an component, for which i want to trace the parent material. can you please tell me the table or is there any function module to do so or can i find whethere the given component has Parent Material.
Thanks & Regards.
Guhapriyan
Hi all,
I have an component, for which i want to trace the parent material. can you please tell me the table or is there any function module to do so or can i find whethere the given component has Parent Material.
Thanks & Regards.
Guhapriyan
2005 May 17 1:33 PM
Here is a little code that should help you out.
************************************************************************
* FORM WHERE_USED.
************************************************************************
form where_used tables itab
using matnr
werks.
data: selpool like mc29s.
data: eqpcat like cscequi occurs 0.
data: kndcat like cscknd occurs 0.
data: matcat like cscmat occurs 0.
data: prjcat like cscprj occurs 0.
data: stdcat like cscstd occurs 0.
data: tplcat like csctpl occurs 0.
clear itab. refresh itab.
call function 'CS_WHERE_USED_MAT'
exporting
datub = sy-datum
datuv = sy-datum
matnr = matnr
postp = ' '
stlan = ' '
werks = werks
stltp = ' '
importing
topmat = selpool "Not Currently Used
tables
wultb = itab
equicat = eqpcat "Not Currently Used
kndcat = kndcat "Not Currently Used
matcat = matcat "Not Currently Used
stdcat = stdcat "Not Currently Used
tplcat = tplcat "Not Currently Used
prjcat = prjcat "Not Currently Used
exceptions
material_not_found = 02
no_where_used_rec_found = 03
no_where_used_rec_selected = 04
no_where_used_rec_valid = 05.
endform.
Regards,
Rich Heilman