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 Same Plant

sergio_cifuentes
Participant
0 Likes
1,008

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.

5 REPLIES 5
Read only

Former Member
0 Likes
895

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

Read only

0 Likes
895

When i use CS_WHERE_USED_MAT, returns NO_WHERE_USED_REC_FOUND

Read only

Former Member
0 Likes
895

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.

Read only

0 Likes
895

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.

Read only

Former Member
0 Likes
895

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