‎2005 Jun 09 8:24 PM
Hi ,
How can i determine that a material number is a BOM and if that is the case then how can i find the components of it.
Regards
Arun
‎2005 Jun 09 8:36 PM
First hit against the MAST table with the material number. Then hit against STPO with the internal BOM number to get the components. There are also some function modules that will do this to.
data: xmast type mast.
data: istpo type table of stpo with header line.
Select Single * from mast
where matnr = p_matnr.
If sy-subrc = 0.
Write:/ 'This material has a BOM'.
else.
Write:/ 'No BOM found'.
Endif.
write:/ 'Components'.
select * into corresponding fields of table istpo
from stpo
where stlnr = xmast-stlnr.
loop at istpo.
write:/ istpo-idnrk.
endloop.
Regards,
Rich Heilman
‎2005 Jun 09 8:36 PM
First hit against the MAST table with the material number. Then hit against STPO with the internal BOM number to get the components. There are also some function modules that will do this to.
data: xmast type mast.
data: istpo type table of stpo with header line.
Select Single * from mast
where matnr = p_matnr.
If sy-subrc = 0.
Write:/ 'This material has a BOM'.
else.
Write:/ 'No BOM found'.
Endif.
write:/ 'Components'.
select * into corresponding fields of table istpo
from stpo
where stlnr = xmast-stlnr.
loop at istpo.
write:/ istpo-idnrk.
endloop.
Regards,
Rich Heilman
‎2005 Jun 09 10:37 PM
Hi Arun,
I know you have marked this problem as solved, but in the case where you have multiple level BOMS, just selecting using the tables mast/istpo is not going to get the full list (not unless you recurse the selects).
I would recommend going straight for the function: CS_BOM_EXPL_MAT_V2 (think spelling is correct).
This way you'll get full explosion (for the specified plant also!).
Cheers,
Brad