on 05-29-2012 7:04 AM
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.
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).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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:
STUFE | Level (in multi-level BOM explosions) |
WEGXX | Path (Predecessor) |
VWEGX | Path (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.
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 :
MATNR | INDEX |
---|---|
66 | 1 |
73 | 2 |
75 | 3 |
74 | 4 |
table STB out put is like below:
STUFE | WEGXX | TTIDX | VWEGX | IDNRK | POSTP | POSNR |
---|---|---|---|---|---|---|
1 | 1 | 1 | 0 | 73 | L | 0040 |
2 | 1 | 2 | 1 | 75 | L | 0010 |
3 | 1 | 3 | 1 | 76 | L | 0010 |
2 | 2 | 2 | 1 | D | 0020 | |
1 | 2 | 1 | 0 | T | 0050 | |
1 | 3 | 1 | 0 | 74 | L | 0060 |
2 | 3 | 4 | 3 | 80 | L | 0010 |
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:
STUFE | WEGXX | TTIDX | VWEGX | IDNRK | POSTP | POSNR | PARENT |
---|---|---|---|---|---|---|---|
1 | 1 | 1 | 0 | 73 | L | 0040 | 66 |
2 | 1 | 2 | 1 | 75 | L | 0010 | 73 |
3 | 1 | 3 | 1 | 76 | L | 0010 | 75 |
2 | 2 | 2 | 1 | D | 0020 | 73 | |
1 | 2 | 1 | 0 | T | 0050 | 66 | |
1 | 3 | 1 | 0 | 74 | L | 0060 | 66 |
2 | 3 | 4 | 3 | 80 | L | 0010 | 74 |
Now sort the above table by STUFE and the by POSNR (see the result below)
STUFE | WEGXX | TTIDX | VWEGX | IDNRK | POSTP | POSNR | PARENT |
---|---|---|---|---|---|---|---|
1 | 1 | 1 | 0 | 73 | L | 0040 | 66 |
1 | 2 | 1 | 0 | T | 0050 | 66 | |
1 | 3 | 1 | 0 | 74 | L | 0060 | 66 |
2 | 1 | 2 | 1 | 75 | L | 0010 | 73 |
2 | 2 | 2 | 1 | D | 0020 | 73 | |
2 | 3 | 4 | 3 | 80 | L | 0010 | 74 |
3 | 1 | 3 | 1 | 76 | L | 0010 | 75 |
Now write the logic I mentioned in my previous replies to make display like below (CS11 type format):
STUFE | IDNRK | POSTP | POSNR |
---|---|---|---|
1 | 73 | L | 0040 |
1 | T | 0050 | |
1 | 74 | L | 0060 |
1 | 73 | ||
2 | 75 | L | 0010 |
2 | D | 0020 | |
1 | 74 | ||
2 | 80 | L | 0010 |
2 | 75 | ||
3 | 76 | L | 0010 |
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 :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.