cancel
Showing results for 
Search instead for 
Did you mean: 

Bom multi level report.

Former Member
0 Kudos

Dear Expert,

In my scenario I m setting up variant configuration for a multi level bom structure. The values are enter for the characteristics during sale order creation should be used as dependency in determine the component of the 2nd level configurable matl.I have to generate a multi level bom report with ref to
sale order and item nos.For that I m using a FM CS_BOM_EXPL_MAT_V2 and its working fine. But I stuck in output of my report. It should be same as t-code CS11 output.E.g Header Matl A and its comp B & C.Then B as a header its comp D & E.

Please let me know to get the output same as CS11, is there any field in this FM to get it or is there any other table to get this. Waiting for ur reply.

Regards.

Swapnil.

Accepted Solutions (1)

Accepted Solutions (1)

sjeevan
Active Contributor
0 Kudos

It's not that hard, CS11 just uses color in it's rows, if you just google "colors in alv grid sap" you will find numerous examples of codes.

Example : LINK 1

This is the main part gd_layout-info_fieldname = 'LINE_COLOR'. in your build layout.

In your code make it gd_layout-info_fieldname = 'C300'. when BOM Item number is initial while building the field catalog.

C300 is the code for light yellow color.

Deactivate or remove sort buttons in your GUI status (pf_status).

Former Member
0 Kudos

Hi Jeevan,

Now my report showing below output.E.g

BOM Header Material 1111 has the components 1121 and 1122. These components are at level 1.Component 1121 is a BOM Header as well and contains the components 1311, 1312 and 1313. These components are at level 2.Component 1313 is a BOM Header as well and contains the components 1141,

out put is like this.

1111      1121

1111       1122

1111       1311

1111       1312

1111       1313

1111         1141

Which i dont req.I req below one.

level   item    

0     1121                          

1     1121

1     1122

---------------------

1     1121

  2     1311

  2     1312

  2      1313

--------------------

2        1313

3         1141.

As u mentioned should i get the above output.I know in MAST i give matl name it gives bom nos.Then this bom nos if i pass in STPO it gives me the comp details.Please guide me to get the above output.

Regards.

Swapnil

Former Member
0 Kudos

hello experts i m waiting for ur reply

sjeevan
Active Contributor
0 Kudos

First, to explode a sales order item which has variant configuration, you normally don't use CS_BOM_EXPL_MAT_V2, because that function module is for exploding regular BOM.

You need to use CS_BOM_EXPL_KND_V1, it is a function module for multi-level bom explosion, the out put of that FM is what you exactly see in production order after all the dependencies are satisfied.

I'm pasting the parameters that needs to passed to get complete BOM explosion according to variant configurator.

call function 'CS_BOM_EXPL_KND_V1'

       exporting

        altvo                       = ' '

        aufsw                       = ' '

        aumgb                       = ' '

*       aumng                       =

        auskz                       = ' '

        amind                       = ' '

        bagrp                       = ' '

        beikz                       = ' '

        bessl                       = ' '

        bgixo                       = ' '

        brems                       = ' '

        capid                       = 'PP01'

*       CHLST                       = ' '

*       COSPR                       = ' '

        cuobj                       = vbap-cuobj

*       CUOVS                       = 0

*       CUOLS                       = ' '

         datuv                       = sy-datum

*       DELNL                       = ' '

*       DRLDT                       = ' '

         ehndl                       = '1'

         emeng                       = '1'

*       ERSKZ                       = ' '

*       ERSSL                       = ' '

*       FBSTP                       = ' '

*       KNFBA                       = ' '

*       KSBVO                       = ' '

         mbwls                       = ' '

*       MKTLS                       = 'X'

*       MDMPS                       = ' '

         mehrs                       = 'X'

*       MKMAT                       = ' '

*       MMAPS                       = ' '

*       SALWW                       = ' '

*       SPLWW                       = ' '

         mmory                       = '1'

         mtnrv                       = vbap-matnr

*       NLINK                       = ' '

*       POSTP                       = ' '

*        rndkz                       = '1'

*       RVREL                       = ' '

*       SANFR                       = ' '

*       SANIN                       = ' '

*       SANKA                       = ' '

*       SANKO                       = ' '

*       SANVS                       = ' '

*       SCHGT                       = ' '

*       STKKZ                       = ' '

*       STLAL                       = ' '

*       STLAN                       = ' '

         stpst                       = 0

*       SVWVO                       = 'X'

         werks                       = vbap-werks

*       NORVL                       = ' '

*       MDNOT                       = ' '

*       PANOT                       = ' '

*       QVERW                       = ' '

         vbeln                       = vbap-vbeln

         vbpos                       = vbap-posnr

*       VERID                       = ' '

*       VRSVO                       = 'X'

       importing

         topmat                      = v_topmat

*       DSTST                       =

       tables

         stb                         = it_stb

         MATCAT                      = it_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.

To display like the way you see in CS11:

Table it_stb will display all the components in the multi-level explosion and it's very confusing to see which component belong to which parent(assembly), to find out that, you need to use the output table it_matcat which has the field INDEX (Index in the Category Table) now use this field to find out the parent (assembly) of that particular component by using the field  TTIDX of the table it_stb. This is pretty much joining the tables except this is internal table join (not the database table join)

If your BOM is very complex with same material at different levels, you may have to make use of the following fields also, in building your logic for program:

STUFELevel (in multi-level BOM explosions)
WEGXXPath (Predecessor)
VWEGXPath (for multi-level BOM explosions)

You may have to define a separate internal table and group the materials according to their corresponding parent materials. Use the coloring like I mentioned in my first reply. 

Former Member
0 Kudos

Hi Jeevan,

Thanks for ur reply,i will check it and get back to u.

Regards.

Former Member
0 Kudos

Hi Jeevan,

If it is possible please give me the code because i m unable to write the code.

Regards.

sjeevan
Active Contributor
0 Kudos

This is a very simple program, the function module does everything for you, all you need to do is re-arrange the data.

I gave you the logic, I cannot write syntax of ABAP for you, for that you need to get with an experienced programmer and develop the report.

Look at the following flow (only fields relevant to logic are displayed below):

table MATCAT out put is like below :

MATNRINDEX
661
732
753
744

table STB out put is like below:

STUFEWEGXXTTIDXVWEGXIDNRKPOSTPPOSNR
111073L0040
212175L0010
313176L0010
2221
D0020
1210
T0050
131074L0060
234380L0010

You need to join above two tables on the field TTIDX and INDEX

sample code

loop at STB.

read table MATCAT with key INDEX = STB-TTIDX.

if SY-SUBRC = 0.

STB-PARENT = MATNR.

modify STB.

endif.

endloop.

It will look like this:

STUFEWEGXXTTIDXVWEGXIDNRKPOSTPPOSNRPARENT
111073L004066
212175L001073
313176L001075
2221
D002073
1210
T005066
131074L006066
234380L001074

Now sort the above table by STUFE and the by POSNR (see the result below)

STUFEWEGXXTTIDXVWEGXIDNRKPOSTPPOSNRPARENT
111073L004066
1210
T005066
131074L006066
212175L001073
2221
D002073
234380L001074
313176L001075

Now write the logic I mentioned in my previous replies to make display like below (CS11 type format):

STUFEIDNRKPOSTPPOSNR
173L0040
1
T0050
174L0060
173

275L0010
2
D0020
174

280L0010
275

376L0010
Former Member
0 Kudos

Hi Jeevan,

Thanks a lot.It solve my problem.

Regards.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jeevan ,

  i cant create discussion... dont mistake continue here...

  i followed ur procedure.. but up to level 10 customized report similar to CS11 format.

Each level have one parent materil. but level 11 have 3 parent material. so its will be collapsed.

how to solve this issue.

In Standard CS11 :

In Customized Report :

Former Member
0 Kudos

Hi Jeevan...

After sorting ths STB table.. what can i do?

you saying " Now write the logic I mentioned in my previous replies to make display like below (CS11 type format): " ... but where available your previous replies..

i want know how to display the yellow line records.. urgent.. reply soon..

sjeevan
Active Contributor
0 Kudos

Subramani,

Define another internal table type STB with header line e.g TEMP_STB, move MATNR from MATCAT to IDNRK and INDEX from MATCAT to STUFE and '0' (zero) to WEGXX.

Now use the command,

APPEND LINES OF <itab1> TO <itab2>.

then append STB and TEMP_STB

now sort by STUFE and WEGXX (in that order)

Use the following example to color your row:

http://www.sapdev.co.uk/reporting/alv/alvgrid_color.htm

You're expected to create a separate thread to ask your own question. This is what would be called hijacking someone else's thread.

Jeevan