2007 Nov 02 6:25 PM
Hi i'm using the FM 'CS_BOM_EXPL_MAT_V2' to extract de BOM of a material, but it returns me materials that are not in the same plant (werks),
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = v_appli
datuv = v_date
mehrs = 'X'
mtnrv = ti_mast-matnr
rndkz = ' '
stkkz = ' '
stlan = v_usage
stlal = v_stlal
werks = ti_mast-werks
nlink = 'X'
IMPORTING
topmat = w_topmat
TABLES
stb = itab_bom
EXCEPTIONS
alt_not_found = 01
call_invalid = 02
material_not_found = 03
missing_authorization = 04
no_bom_found = 05
no_plant_data = 06.
2007 Nov 02 6:51 PM
HI
You can use other functionmodule also as
CALL FUNCTION 'CS_WHERE_USED_MAT'
EXPORTING
datub = sy-datum
datuv = sy-datum
matnr = matnr
postp = space
stlan = '1'
werks = werks
IMPORTING
topmat = lt_topmat
TABLES
wultb = lt_wultb
equicat = lt_equicat
kndcat = lt_kndcat
matcat = lt_matcat
stdcat = lt_stdcat
tplcat = lt_tplcat
EXCEPTIONS
call_invalid = 01
material_not_found = 02
no_where_used_rec_found = 03
no_where_used_rec_selected = 04
no_where_used_rec_valid = 05.
May be it will helpful.
Lincon
2007 Nov 02 7:44 PM
2007 Nov 02 8:20 PM
Try using this FM.
Shreekant.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
FTREL = ' '
ALTVO = ' '
AUFSW = ' '
AUSKZ = ' '
BAGRP = ' '
BEIKZ = ' '
BESSL = ' '
BGIXO = ' '
BREMS = ' '
CAPID = P_CAPID
DATUV = V_DATUV
EMENG = ' '
ERSKZ = ' '
ERSSL = ' '
MBWLS = ' '
MTNRV = W_MARC_MKAL-MATNR
MDMPS = ' '
MEHRS = ' '
MMORY = ' '
POSTP = ' '
SANKO = ' '
SANFR = ' '
SANKA = ' '
SANIN = ' '
SANVS = ' '
RNDKZ = ' '
RVREL = ' '
SCHGT = ' '
STKKZ = ' '
STLAL = '01'
STLAN = '1'
WERKS = P_WERKS-LOW
IMPORTING
TOPMAT = XTOPMAT
DSTST = XFELD
TABLES
STB = XSTPOX
MATCAT = XMATCAT
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.
2007 Nov 02 9:26 PM
Thanks Shreekant, but with this it only shows one level, and if i put an 'X' to MEHRS, it still returning a lot of components that are not in the same plant as the material.
2007 Nov 02 9:32 PM
Well, the FM has not been released for customer use, so you use it at your own peril, but why not just get rid of the entries you don't want after the the FM completes?
Rob