cancel
Showing results for 
Search instead for 
Did you mean: 

Check a material is component of a bill of material itself

Former Member
0 Kudos

Dear All

I have to check whether a particular material is a component of Bill of material itself.

How is it possible.

Any pointers would be helpful.

Points for sure.

Thanks in advance.

Dinesh

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

SOlved on own

former_member70391
Contributor
0 Kudos

Hi Dinesh,

HI,

BOM is stored in table MAST and its materials in STPO table.

Do the following,

Enter the BOM material Number in MAST for say plant 0001.

Now it will display the details with a BOM Number(Field STLNR).

Now go to STPO and enter this BOM Number got from the previous

table. It will display the materials which are available in

BOM under field IDNRK(Component

Write a simple ABAP program based on these 2 tables. Check the below code, where you can put the materials which you want to exclude in s_IDNRK and BOM in s_mATNR and plant in p_WERKS.

&----


*& Report ZTEST01

*&

&----


*&

*&

&----


REPORT ZTEST01.

TABLES: MAST, STPO.

DATA: BEGIN OF I_CS07_H OCCURS 0,

MATNR LIKE MAST-MATNR,

WERKS LIKE MAST-WERKS,

STLAN LIKE MAST-STLAN,

STLNR LIKE MAST-STLNR,

END OF I_CS07_H.

DATA: BEGIN OF I_CS07_I OCCURS 0,

STLNR LIKE STPO-STLNR,

POSNR LIKE STPO-POSNR,

IDNRK LIKE STPO-IDNRK,

MENGE LIKE STPO-MENGE,

MEINS LIKE STPO-MEINS,

END OF I_CS07_I.

SELECTION-SCREEN: BEGIN OF BLOCK B1.

SELECT-OPTIONS: S_MATNR FOR MAST-MATNR OBLIGATORY,

S_IDNRK FOR STPO-IDNRK .

PARAMETERS : P_WERKS LIKE MAST-WERKS OBLIGATORY.

SELECTION-SCREEN : END OF BLOCK B1.

START-OF-SELECTION.

SELECT * FROM MAST INTO CORRESPONDING FIELDS OF TABLE I_CS07_H

WHERE MATNR IN S_MATNR

AND WERKS EQ P_WERKS

AND STLAN EQ '5'.

SELECT * FROM STPO INTO CORRESPONDING FIELDS OF TABLE I_CS07_I

FOR ALL ENTRIES IN I_CS07_H

WHERE STLNR EQ I_CS07_H-STLNR

AND STLTY EQ 'M'.

LOOP AT I_CS07_H.

WRITE: /1 '|',

2(20) I_CS07_H-MATNR COLOR 7,

120 '|',

/1(120) SY-ULINE.

LOOP AT I_CS07_I WHERE STLNR = I_CS07_H-STLNR.

WRITE: /1 '|', 2(18) I_CS07_I-POSNR COLOR 5,

21 '|', 22(40) I_CS07_I-IDNRK COLOR 5,

63 '|', 64(20) I_CS07_I-MENGE COLOR 5,

85 '|', 86(24) I_CS07_I-MEINS COLOR 5,

120 '|',

/1(120) SY-ULINE.

ENDLOOP.

ENDLOOP.

Thanks & Regards,

Nagaraj Kalbavi

Former Member
0 Kudos

Hi..

Thanks for your inputs.

But my requirement is to check whether a particular material is not a component of a BOM.

So to check this, do I need to explode this and then check, if it gives a material or not?

Please advice.

Lakshmipathi
Active Contributor
0 Kudos

Dear Dinesh

Have you tried with CS12 ??

thanks

G. Lakshmipathi