‎2014 Nov 13 1:50 PM
Hi experts,
Could someone help me with FM CS_BOM_EXPL_MAT_V2? I`m calling this function with the parameters below, because i need to find lines where the stlal column is equal to 2:
CALLFUNCTION'CS_BOM_EXPL_MAT_V2'
EXPORTING
datuv = '01.01.1900'
ehndl = '1'
emeng = t_emeng
mktls = 'X'
mehrs = 'X'
mtnrv = wa_mat-matnr
stlal = '2'
stlan ='05'
svwvo = 'X'
werks = ''
vrsvo = 'X'
IMPORTING
topmat = it_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
.
But, for some reason, the FM is populating the stb itab with lines where the stlal field is equal to 1 (1 and 2 in some cases).
| STUF | WEGXX | B | TTIDX | VWEGX | OJTXB | BAUSF | STLAN | STLAL | A |
| 1 | 1 | M | 1 | 0 | MATERIAL AAAA | 0,00 | 5 | 1 | |
| 1 | 2 | M | 1 | 0 | MATERIAL BBBB | 0,00 | 5 | 1 |
Is it the normal behavior of this FM?
‎2014 Nov 13 3:12 PM
i dont think this will do what you want. this is a FM to show a specific BOM structure for a specific material, and the STLAL parameter is used to help select the BOm that will be displayed, not the STLAL values of the items within the returned data.
Have you considered simply reading table MAST, looking for STLAL values of 2?
‎2014 Nov 13 3:09 PM
Did you try with STLAL = '02' ?
The presence of the conversion routine 'ALPHA' seems to indicate the need of the leading zeroes.
Please check this thread http://scn.sap.com/thread/3508364
Regards
‎2014 Nov 13 4:40 PM
Hi Francesco
Thank you for answer.
I think it is not applicable for "stlal" because this field has is length 1.
Anyway I did it for the field stlan,
Best Regards.
‎2014 Nov 13 4:48 PM
Ok. Thanks to you
I've checked the parameters in CS_BOM_EXPL_MAT_V2 and STLAN is CHAR 1 (data element STLAN), while STLAL is CHAR 2 (data element STALT) but maybe there is something else I don't know about the topic.
Best regards.
‎2014 Nov 13 3:12 PM
i dont think this will do what you want. this is a FM to show a specific BOM structure for a specific material, and the STLAL parameter is used to help select the BOm that will be displayed, not the STLAL values of the items within the returned data.
Have you considered simply reading table MAST, looking for STLAL values of 2?