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

Function Module for Displaying BOM

Former Member
0 Likes
13,348

Friends,

Can anyone of you specify a function module that

displays the "Bill of Materials (BOMs)" relavant to a

Top Level Material

Regards,

Usha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
5,777

Hi Erwan,

Thanks for the reply.

Could you please explain the implications of the

exporting (namely- capid, emeng, datuv) & importing parameters you have specified in your

function module?

Regards,

Usha

6 REPLIES 6
Read only

Former Member
0 Likes
5,777

Hi try this :

  CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
    EXPORTING
      auskz                 = ' '
      capid                 = 'PP01'
      datuv                 = sy-datum
      emeng                 = '1.000'
      stlan                 = '1'
      mtnrv                 = matnr
      mehrs                 = 'X'
      mmory                 = '1'
      stpst                 = '0'
      werks                 = werks
    IMPORTING
      topmat                = selpool
      dstst                 = dstst_flg
    TABLES
      stb                   = stb
      matcat                = matcat
    EXCEPTIONS
      material_not_found    = 4
      no_plant_data         = 8
      no_bom_found          = 12
      no_suitable_bom_found = 16.

Hope this helps.

Erwan.

Read only

0 Likes
5,777

Hi Erwan,

I was trying to search a Function for the multilevel BOM for a material and I could just find it for single level.

The function you specified works perfectly fine showing

all items in one structure and the higher level items in another.

Thanks a lot!

Cheers,

Mp.

Edited by: Mp on Jun 30, 2008 3:54 PM

Read only

Former Member
0 Likes
5,778

Hi Erwan,

Thanks for the reply.

Could you please explain the implications of the

exporting (namely- capid, emeng, datuv) & importing parameters you have specified in your

function module?

Regards,

Usha

Read only

0 Likes
5,777

Capid is an id which indicate the domain area :

BEST Inventory management

PC01 Costing

PP01 Production - general

SD01 Sales and distribution

emeng = 1 as it's the quantity of the "finish product".

Datuv : with this parameter set to sy-datum, it 'll retrieve the valid BOM.

Stlan : 1,2 or 3 as it's a productio bom or sales bom, ...etc ( like in cs03 )

Hope it helps,

Erwan.

Read only

0 Likes
5,777

Hi Usha,

You can also use function module - CSAP_MAT_BOM_READ.

Import parameters are -

Material Number

Plant

Bom Usage

Valid From

Valid to

Function module will return all related BOMs in T_STKO / T_STPO.

Give a try. If you need more help, please let me know.

Thanks and Warm Regards.

Pras Durafe

Read only

Former Member
0 Likes
5,777

the easiest function module is:-

the only input required is matnr and plant ..... hard-core the values of STLAL and STLAN as follows:-

********************

CALL FUNCTION 'CABM_READ_BOM'

EXPORTING

I_MATNR = MATNR

I_WERKS = WERK

I_STLAL = '01'

I_STLAN = '1'

TABLES

EXP_BOM_DATA = IT_CAL

EXP_ITM_DATA = IT_ITM

EXCEPTIONS

NO_RECORD_FOUND = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

*********************************

You shall get the BOM in table itm...... and the matnr as IDNRK.