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

BOM release

Former Member
0 Likes
2,948

HI friends,

can any one give me an overview of how BOM is created, Exploded and a BOM is released.

Please Let me know,

Thanks in Advance,

Regards,

Roberts.K

18 REPLIES 18
Read only

Former Member
0 Likes
2,177

Hi Roberts,

A BOM or Bill Of Materials is basically a list of components and the quantities that go into the making of a semi-finished or finished product. You create a BOM using CS01 transaction. A BOM will have different statuses, and usage(experimental, sales, production, etc).

A BOM can be of one level or multiple levels meaning that if the making of a semi-finished or finished product includes just direct materials, then it is one level, but if the making of a product involves making some intermediate semi-finished products then you have a multi-level BOM.

As an example, let us take the manufacturing of cigarettes. A cigarette is a finished product and its BOM may contain blended tobacco, foil, filter and some flavors. Now within this list, a filter, or a flavoring material may by itself needs to be manufactured before assembling into the cigarette. So they will have their own BOMs. This BOM within BOM may go down to some additional levels depending on the complexity of the manufacturing of the finished product. So from the highest level(at the finished product level), when you want to know all the materials that went into the making of it, then you will not only look at its BOM but also expand the included BOMs which is BOM explosion.

The tables involved are MAST, STKO, STAS, STPO etc. Please let me know if you need addiotional information.

Regards,

Srinivas

Read only

0 Likes
2,177

Hi Srinivas,

Thank you very much for the information,

any function modules to see BOM's .

How to see a BOM explosion, any function module , i.e a BOM under a BOM, and what is the difference between <b>WBS BOM</b> and <b>Material BOM</b> .

Please Let me know ,

Thanks in advance,

Regards,

Roberts.K

Read only

0 Likes
2,177

CS_BOM_EXPLOSION AND CS_BOM_EXPL_MAT_V2 THIS TWO FM IS USED TO SEE THE MATERIAL BOM. IT IS WORK SAME AS CS12 STD TCODE. THE PARAMETER ARE PLANT / MATERIAL / USAGE OF BOM / LEVEL.

Read only

0 Likes
2,177

<b>Material BOM</b> is used to rollup to the finished material (could also be used for calculating the cost of a material and the materials involved in a sale of a finished material)

i.e. What Materials are needed to produce a particular finished product (A = D + E), what costs impact the production of a finished product (C = F + G), what materials need to be shipped as part of a sales order (TV = TV + user guide + rebate forms).

On a similar analogy the <b>WBS BOM</b> is used to rollup the various elements of a Project (also used for calculating the cost of a project)

Hope that helps!

Rishi<b></b>

Read only

0 Likes
2,177

Hai Joseph,

Thanks for the information, i will get back to you if i need any clarification.

Thanks once again,

Regards,

Roberts.K

Read only

0 Likes
2,177

Hi Srinivas,

My requirement is to put the level of BOM in a structure as .1,..2,..3 as it goes down the nodes.Can u guide me how to go about?

Vijay

Read only

0 Likes
2,177

Hello,

sample code:

DATA: l_dglvl LIKE stpol_add-dglvl.

DATA: l_lvl TYPE i.

DATA: l_lvl_c(2).

  LOOP AT stb.
    CLEAR: l_dglvl,
           l_lvl,
           l_lvl_c.
    l_lvl = stb-stufe.
    l_lvl_c = stb-stufe.
    DO l_lvl TIMES.
      CONCATENATE '.' l_dglvl INTO l_dglvl.
    ENDDO.
    CONCATENATE l_dglvl l_lvl_c INTO l_dglvl.
    CONDENSE l_dglvl.
....
  endloop.

Hope this helps you.

But have you marked this as question? How do you close this thread??

Regards, Murugesh AS

Message was edited by: Murugesh Arcot

Read only

0 Likes
2,177

Thank you Murugesh.I dunno I messed it up..lemme see if i can close it

Vijay

Read only

0 Likes
2,177

What is STB?

Read only

0 Likes
2,177

STB is the internal table containing the BOM.

It is the result of the Call Function 'CS_BOM_EXPL_MAT_V2' which enable to explode your BOM.

Take a look at the following piece of code :


*    I Tables for  "call CS_BOM_EXPL_MAT_V2 "
data: begin of t_stb occurs 0.
        include structure stpox.
data: end of t_stb.
data: begin of matcat occurs 50.
        include structure cscmat.
data: end of matcat.
data: dstst_flg like csdata-xfeld.
data: begin of selpool.
        include structure cstmat.
data: end of selpool.


...

  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.

  sort t_stb by stufe.

Hope this helps.

Erwan.

Read only

0 Likes
2,177

Hi,

Also have alook at FUGR: CSS4 / CSAP for other BOM related FMs / APIs.

Regards, Murugesh AS

Read only

0 Likes
2,177

THANK YOU ERWAN AND MURUGESH

Read only

0 Likes
2,177

So Erwan, how do i need to create 'stb' as and moreover what do i need to give at the place of 'matnr' and 'werks' in the code u have mentioned.

Do i need to create 'Stb' of STPOX struct type?

I am using BOM for the first time...so plz help me.

Vijay

Read only

0 Likes
2,177

Hello,

Data: stb LIKE stpox OCCURS 0 WITH HEADER LINE.

MATNR - you give the material for which you would like see the exploded BOM and WERKS is the Plant.

Please debug Tx. CS12 which uses the above FM.

Best Regards, Murugesh AS

Read only

0 Likes
2,177

Thank you Murugesh.Can you look into the below code

I just want to check how it gives me..So for test purpose i wrote this...What is wrong with this it doesnot execute.

REPORT ZBOM .

data: begin of t_stb occurs 0.

include structure stpox.

data: end of t_stb.

data: begin of matcat occurs 50.

include structure cscmat.

data: end of matcat.

data: dstst_flg like csdata-xfeld.

data: begin of selpool.

include structure cstmat.

data: end of selpool.

DATA: l_dglvl LIKE stpol_add-dglvl.

DATA: l_lvl TYPE i.

DATA: l_lvl_c(2).

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

EXPORTING

AUSKZ = ' '

CAPID = 'PP01'

DATUV = sy-datum

EMENG = '1.000'

MEHRS = 'X'

MMORY = '1'

MTNRV = '1535'

STLAN = '1'

STPST = '0'

WERKS = '1040'

IMPORTING

TOPMAT = selpool

DSTST = dstst_flg

TABLES

stb = t_stb

MATCAT = matcat

EXCEPTIONS

MATERIAL_NOT_FOUND = 4

NO_BOM_FOUND = 8

NO_PLANT_DATA = 12

NO_SUITABLE_BOM_FOUND = 16

sort t_stb by stufe.

.

IF sy-subrc <> 0.

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

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

ENDIF.

LOOP AT t_stb.

CLEAR: l_dglvl,

l_lvl,

l_lvl_c.

l_lvl = t_stb-stufe.

l_lvl_c = t_stb-stufe.

DO l_lvl TIMES.

CONCATENATE '.' l_dglvl INTO l_dglvl.

ENDDO.

CONCATENATE l_dglvl l_lvl_c INTO l_dglvl.

CONDENSE l_dglvl.

WRITE:/ l_dglvl.

Endloop.

Read only

0 Likes
2,177

Hi Murugesh,

I think the code I pasted is totally messed up..See what I want to do is get those BoM Levls Concatenated with . in a internal table and want to print them on screen to check the program.Could you plz elmme know about that.

Vijay

Read only

0 Likes
2,177

Hello,

Please check the following code:

REPORT ZBOM .

data: t_stb LIKE stpox OCCURS 0 WITH HEADER LINE,

matcat LIKE cscmat OCCURS 0 WITH HEADER LINE,

g_dstst LIKE csdata-xfeld,

topmat LIKE cstmat.

*data: begin of t_stb occurs 0.

*include structure stpox.

*data: end of t_stb.

*data: begin of matcat occurs 50.

*include structure cscmat.

*data: end of matcat.

*data: dstst_flg like csdata-xfeld.

*data: begin of selpool.

*include structure cstmat.

*data: end of selpool.

parameters p_MTNRV like mara-matnr.

parameters p_werks like marc-werks.

DATA: l_dglvl LIKE stpol_add-dglvl.

DATA: l_lvl TYPE i.

DATA: l_lvl_c(2).

CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

EXPORTING

*AUSKZ = ' '

CAPID = 'PP01'

DATUV = sy-datum

ehndl = '1'

*EMENG = '1.000'

MEHRS = 'X'

MMORY = '1'

MTNRV = p_MTNRV

*STLAN = '1'

*STPST = '0'

WERKS = p_werks

IMPORTING

TOPMAT = topmat

DSTST = g_dstst

TABLES

stb = t_stb

MATCAT = matcat

EXCEPTIONS

MATERIAL_NOT_FOUND = 4

NO_BOM_FOUND = 8

NO_PLANT_DATA = 12

NO_SUITABLE_BOM_FOUND = 16

sort t_stb by stufe.

.

IF sy-subrc <> 0.

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

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

ENDIF.

LOOP AT t_stb.

CLEAR: l_dglvl,

l_lvl,

l_lvl_c.

l_lvl = t_stb-stufe.

l_lvl_c = t_stb-stufe.

DO l_lvl TIMES.

CONCATENATE '.' l_dglvl INTO l_dglvl.

ENDDO.

CONCATENATE l_dglvl l_lvl_c INTO l_dglvl.

CONDENSE l_dglvl.

WRITE:/ l_dglvl.

write: t_stb-idnrk.

Endloop.

This gives output in the expected format.

Hope this helps you.

Best Regards, Murugesh AS

Read only

0 Likes
2,177

Hello,

If my reply has answered your query, award points and please close this thread. Else, let me know if you have any further questions.

Best Regards, Murugesh AS