‎2005 Mar 28 8:53 AM
Hi All,
I am developing a report which displays items at bom level. But unable to do so using 'CS_BOM_EXP_MAT_V2' functional module.
Kindly tell me which are necessary parameters which are necessary for this functional module.
In display mode all parameters are optional but it is not working .
Regards,
EXP
‎2005 Mar 28 7:46 PM
Hi Diliip,
Here's the list of possible CAPID values (my guess is you need production BOM values and hence <b>PP01</b>)
<b>BEST -> Inventory management
DISP -> MRP
INST -> Plant maintenance
PC01 -> Costing
PP01 -> Production - general
PPRW -> Production - rework
SD01 -> Sales and Distribution</b>
Here's the list of possible STLAN values (my guess is you need production BOM values and hence <b>1</b>)
<b>1 -> Production
2 -> Engineering/design
3 -> Universal
4 -> Plant maintenance
5 -> Sales
6 -> Costing</b>
Here is an example call that works for me
<b>DATA: t_stpox TYPE stpox OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = 'PP01'
datuv = sy-datum
mtnrv = <u>Your Material</u>
stlan = '1'
werks = <u>Your Plant</u>
TABLES
stb = t_stpox
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.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.</b>
Hope that helps!
Rishi
‎2005 Mar 28 9:22 AM
Hi Dilip,
Try the FM call using these parameters, it should work.
call function 'CS_BOM_EXPL_MAT_V2'
exporting
capid = ' '
datuv = sy-datum
mtnrv = t_bom-matnr
stlan = t_bom-stlan
werks = t_bom-werks
mehrs = 'X'
tables
stb = t_stb
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.
Regards,
Vijay
‎2005 Mar 28 12:08 PM
Dear Vijay,
Sending u the sample program.The error is object not found.
Kindly help in this.
tables : afko,
makt,
afru,
stpo,
mast.
data : begin of it_result1 occurs 0,
werks like aufk- 1
matnr like mast-matnr,"material no 1
menge like stpo-menge,"total ordered qty 3
maktx like makt-maktx,"material description 2
vmvpr like mbew-vmvpr,"Price Control Indicator in Previous Period 4
verpr like mbew-verpr,"if the indicator is s then standard price else v then moving price 4
stprs like MBEW-STPRS, " 4
dmbtr like mseg-dmbtr, "actual concumption 5
aufnr like afko-aufnr,"pp order no
stlnr like afko-stlnr,"bom
idnrk like stpo-idnrk, " 3
end of it_result1 .
data : begin of it_stb occurs 0.
include structure STPOX.
data : end of it_stb.
selection-screen begin of block blk with frame title text-001.
select-options : s_werks for mast-werks obligatory. " plant
parameters : p_matnr like mast-matnr."material no
select-options : s_aufnr for afko-aufnr ."order no
selection-screen end of block blk.
select amatnr bmaktx cmenge dvmvpr dverpr dstprs estlnr estlan fwerks"edmbtr
into corresponding fields of table it_result1 from mast as a
inner join makt as b on amatnr = bmatnr
inner join stpo as c on astlnr = cstlnr
inner join mbew as d on amatnr = dmatnr
inner join afko as e on astlnr = estlnr
inner join aufk as f on eaufnr = faufnr
inner join jest as g on fobjnr eq gobjnr AND STAT EQ 'I0009'
where awerks in s_werks and amatnr = p_matnr
and f~aufnr in s_aufnr.
delete adjacent duplicates from it_result1 comparing matnr.
loop at it_result1.
write :/2 it_result1-matnr inverse color 7 on,it_result1-maktx inverse color 7 on , it_result1-aufnr.
endloop.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
CAPID = 'X'
DATUV = sy-datum
MDMPS = 'X'
MEHRS = 'X'
MTNRV = it_result1-matnr
WERKS = it_result1-werks
MDNOT = 'X'
TABLES
stb = it_stb
‎2005 Mar 28 3:41 PM
Hi Dilip,
Check the value of CAPID in the Exporting parameter of the function module whether it is correct or not.
for the possible values you can go to transaction code -CS12
then press F4 in BOM Application. It will give possible value of the CAPID.
Regards,
Vijay
‎2005 Mar 28 7:46 PM
Hi Diliip,
Here's the list of possible CAPID values (my guess is you need production BOM values and hence <b>PP01</b>)
<b>BEST -> Inventory management
DISP -> MRP
INST -> Plant maintenance
PC01 -> Costing
PP01 -> Production - general
PPRW -> Production - rework
SD01 -> Sales and Distribution</b>
Here's the list of possible STLAN values (my guess is you need production BOM values and hence <b>1</b>)
<b>1 -> Production
2 -> Engineering/design
3 -> Universal
4 -> Plant maintenance
5 -> Sales
6 -> Costing</b>
Here is an example call that works for me
<b>DATA: t_stpox TYPE stpox OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = 'PP01'
datuv = sy-datum
mtnrv = <u>Your Material</u>
stlan = '1'
werks = <u>Your Plant</u>
TABLES
stb = t_stpox
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.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.</b>
Hope that helps!
Rishi
‎2007 May 23 7:49 PM
hi:
is this FM only run through program & not alone in se37?
thanks
renu