Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Plant in BOM-ABAP

Former Member
0 Kudos
102

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)

2 REPLIES 2

Former Member
0 Kudos
68

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

Former Member
0 Kudos
68

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.