Application Development and Automation 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: 
Read only

CS_BOM_EXPL_MAT_V2

Former Member
0 Likes
1,871

HI,

I would like get the BOM list for an materialnumber. At the import parameters , when I don´t set the parameter DATUV, I get an error. I don´t understand why. I want dont´t set this parameter, because then I get just the components of the BOM at this date and not valid from this date. Is there other Function Modules?

regards

HI,

I would like get the BOM list for an materialnumber. At the import parameters , when I don´t set the parameter DATUV, I get an error. I don´t understand why. I want dont´t set this parameter, because then I get just the components of the BOM at this date and not valid from this date. Is there other Function Modules?

regards

7 REPLIES 7
Read only

Former Member
0 Likes
1,438

Hi,

Check FM "CSAP_MAT_BOM_READ".

Thanks & Regards,

Navneeth K.

Read only

Former Member
0 Likes
1,438

use CS_BOM_EXPLOSION

Read only

Former Member
0 Likes
1,438

hi

Normally that should not be the case.Datuv parameter is for valid from only so if you are entering sy-datum it will show all the materials which are still valid till date.

Sample:

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

EXPORTING

capid = p_appl

datuv = p_date

mehrs = p_mul

werks = p_plant

mtnrv = mat-material

emeng = p_menge "

TABLES

stb = stb

EXCEPTIONS

alt_not_found = 1

call_invalid = 2

material_not_found = 3

missing_authorization = 4

no_bom_found = 5

no_plant_data = 6

no_suitable_bom_found = 7

OTHERS = 8.

Check if you are passing all the parameters correctly.

Regards

Neha

Read only

0 Likes
1,438

Hi,

I tried it with sy-datum. But I get over 200 Components. I just want the Components for a STLNR from the table MAST. How can I get just these Positions?

regards

Read only

Former Member
0 Likes
1,438

thank you all, it works now.

regards

Read only

0 Likes
1,438

Dear Sabine,

i have also same requirment to display Bom Header and Item details.can u send me Sample coding which u developed,it's very helpful to me..

With Regards

MurugeshRajeev

Read only

0 Likes
1,438

Hi MurugeshRajeev,

I developed the following program. I dont wrote here the DATA deklaration. You can do it with your own parameter that you need. I select as optional the positions of the bomlist if the user need it in this function. I got the right bomlist with the function. I hope it helps you.

I have a Function with parameter:

*" IMPORTING

*" VALUE(MATERIALNUMMER) TYPE MAST-MATNR

*" VALUE(STLAN) TYPE MAST-STLAN

*" VALUE(STLAL) TYPE MAST-STLAL

*" VALUE(POSID) TYPE STPO-STLKN OPTIONAL

*" VALUE(STLNR) TYPE STPO-STLNR OPTIONAL

*" EXPORTING

*" VALUE(RETURN) TYPE BAPIRET2-MESSAGE

*" TABLES

*" STB STRUCTURE STPO

*" STBP STRUCTURE STPO

this is the code:

SELECT STLNR

FROM MAST

Into p_stlnr

WHERE MATNR EQ MATERIALNUMMER AND

STLAN EQ STLAN AND

STLAL EQ STLAL.

if posid is initial.

call function 'CS_BOM_EXPL_MAT_V2'

exporting

  • FTREL = ' '

  • ALEKZ = ' '

  • ALTVO = ' '

  • AUFSW = ' '

  • AUMGB = ' '

  • AUMNG = 0

  • AUSKZ = ' '

  • AMIND = ' '

  • BAGRP = ' '

  • BEIKZ = ' '

  • BESSL = ' '

  • BGIXO = ' '

  • BREMS = ' '

capid = 'BEST'

  • CHLST = ' '

  • COSPR = ' '

  • CUOBJ = 000000000000000

  • CUOVS = 0

  • CUOLS = ' '

datuv = sy-datum

  • DELNL = ' '

  • DRLDT = ' '

  • EHNDL = ' '

  • emeng = pemeng

  • ERSKZ = ' '

  • ERSSL = ' '

  • FBSTP = ' '

  • KNFBA = ' '

  • KSBVO = ' '

  • MBWLS = ' '

  • MKTLS = 'X'

  • MDMPS = ' '

mehrs = 'X'

  • MKMAT = 'X'

  • MMAPS = ' '

  • SALWW = ' '

  • SPLWW = ' '

  • MMORY = ' '

mtnrv = materialnummer

  • NLINK = ' '

  • POSTP = ' '

  • RNDKZ = ' '

  • RVREL = ' '

  • SANFR = ' '

  • SANIN = ' '

  • SANKA = ' '

  • SANKO = ' '

  • SANVS = ' '

  • SCHGT = ' '

  • STKKZ = ' '

stlal = '01'

STLAN = '3'

STPST = '1'

  • SVWVO = 'X'

werks = '0001'

  • NORVL = ' '

  • MDNOT = ' '

  • PANOT = ' '

  • QVERW = ' '

  • verid = pverid

  • VRSVO = 'X'

  • IMPORTING

  • TOPMAT =

  • DSTST =

tables

stb = istb

  • MATCAT =

exceptions

alt_not_found = 1

call_invalid = 2

material_not_found = 3

missing_authorization = 4

no_bom_found = 5

no_plant_data = 6

no_suitable_bom_found = 7

conversion_error = 8

others = 9

.

if sy-subrc <> 0.

  • message id sy-msgid type sy-msgty number sy-msgno

  • with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

RETURN = No partlist.

endif.

LOOP AT istb.

SELECT SINGLE * FROM stpo INTO stb

WHERE stlnr = p_stlnr AND

stlkn = istb-stlkn AND

stpoz = istb-stpoz AND

stvkn = istb-stvkn.

append stb.

endloop.

else.

SELECT *

from stpo

into wa_bkpff

where stlnr EQ stlnr AND

stlkn EQ posid.

append wa_bkpff to stbp.

endselect.

endif.

ENDFUNCTION.

ENDSELECT.

regards

Sabine