2006 Dec 04 9:52 AM
Hi,
I am giving material in my screen(Table control) and i am using "CS_BOM_EXPL_MAT_V2"
function module to display BOM's.
In this function module i have to give PLANT..then only it will display BOM's..
But in my screen i am not getting polant from user...I am getting only the materials.
How to get the Plant for that material.
Help required in this regard...Also let me know how to check whether BOM exists for this material (suggestion for Coding required...not thru CS03 Tcode)
2006 Dec 04 9:55 AM
Hi Sumi,
You can get all the plants from where the material exists in MARC table.
But the problem is that the same material, can exist in different plant, and can have a different BOM depending on the plant.
( If you are sure a material have only one plant -> no problem, just get it in MARC )
To check if the BOM exist, just check the SY-SUBRC after the CALL FM :
EXCEPTIONS
material_not_found = 4
no_plant_data = 8
no_bom_found = 12
no_suitable_bom_found = 16.
Hope this helps,
Erwan
2006 Dec 04 11:31 AM
hi
you can fire a select query on table MAST from where you can get
plant (field: werks) and the BOM (field:stlnr) for a material.
once you get the BOM , from STPO table , entering stlnr obtained from MAST will give you the components (field : idnrk) for that bom.