Use CS_BOM_EXPL_MAT_V2
Since to make a report in form of tree to list the materials with its materials semielborados until arriving at all the components of this material. I am using BAPI CS_BOM_EXPL_MAT_V2 and not since I can do?
Check these links
Help reqd in CS_BOM_EXPL_MAT_V2
Thanks
mahesh
Similar Messages
-
BOM: Problem using CS_BOM_EXPL_MAT_V2 - URGENT!!!
hai friends,
i am using CS_BOM_EXPL_MAT_V2 fn module in my code. when i pass mtnrv = 'GK02PB.05SBIS' , i did' get any output from the above fn module. but other than the above value like mtnrv = 'OSA875CCWOF' ,i am getting output.
thanks in advance,
With regards,
senthil kumar.rHi senthil,
1. I suppose u want to explode the BOM.
2. CS_BOM_EXPLOSION
use the above FM
in the below mentioned fashion.
3.
CALL FUNCTION 'CS_BOM_EXPLOSION'
EXPORTING
capid = 'PP01'
emeng = bmeng
datuv = sy-datum
mtnrv = matnr
stlan = '1'
werks = werks
mehrs = 'X'
IMPORTING
TOPEQUI =
TOPMAT =
TOPTPL =
DSTST =
TABLES
stbd = stbd
stbe = stbe
stbk = stbk
stbm = stbm
stbp = stbp
stbt = stbt
EXCEPTIONS
alt_not_found = 1
call_invalid = 2
missing_authorization = 3
no_bom_found = 4
no_plant_data = 5
no_suitable_bom_found = 6
object_not_found = 7
conversion_error = 8
OTHERS = 9
regards,
amit m. -
Short dump using CS_BOM_EXPL_MAT_V2 with different user ids
Hi
We are getting a short dump in our program when using FM'CS_BOM_EXPL_MAT_V2' and this is happening only for super user roles but not with regular user ids in production. We are not able to identify the solution yet, and it needs to be resolved as quickly as possible. Anyhelp, really appreciated.
Thanks
Anil
Here is our code:
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
aumgb = 'X'
capid = 'PP01'
datuv = p_valfrm
ehndl = '1'
emeng = 1
mbwls = ' '
mehrs = 'X'
mmory = '1'
mtnrv = p_matnr
stlal = p_stlal
stlan = p_stlan
werks = p_werks
TABLES
stb = i_stb
matcat = i_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.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.Hi senthil,
1. I suppose u want to explode the BOM.
2. CS_BOM_EXPLOSION
use the above FM
in the below mentioned fashion.
3.
CALL FUNCTION 'CS_BOM_EXPLOSION'
EXPORTING
capid = 'PP01'
emeng = bmeng
datuv = sy-datum
mtnrv = matnr
stlan = '1'
werks = werks
mehrs = 'X'
IMPORTING
TOPEQUI =
TOPMAT =
TOPTPL =
DSTST =
TABLES
stbd = stbd
stbe = stbe
stbk = stbk
stbm = stbm
stbp = stbp
stbt = stbt
EXCEPTIONS
alt_not_found = 1
call_invalid = 2
missing_authorization = 3
no_bom_found = 4
no_plant_data = 5
no_suitable_bom_found = 6
object_not_found = 7
conversion_error = 8
OTHERS = 9
regards,
amit m. -
How to use CS_BOM_EXPL_MAT_V2 to include bom under Phantom
Hi every1,
How can I get documentation for this function module CS_BOM_EXPL_MAT_V2
We want to explode BOM on single level ,including Material which is coming under Phantom assembly too.
eg. I have one material 1xxxxx.
after exploding single level bom suppose I'll get these material
1xxxx1
1xxxx2
1xxxx3 and if 1xxxx3 is Phantaom assembly and under this item again I may have 1xxxx1 as bom item.
that means for my parent material 1xxxxx, I want 1xxxx1 should come 2 times !
Is there any simpliest way to get or for this item again I need to use this FM again ?
Pl. do help me.
Thanks in Advance.Hi,
THE FM 'CS_BOM_EXPLOSION_MAT' mentioned above holds true if u dont hv any alternatives for the BOM.
eg: If ur component in turn has BOM with 3 alternatives namely 01,02,03
then ideally FM should pick all the items uder these 3 components but this FM picks by default the 1st
alternative & ignores the rest.
So there are changes dat the list which u hv gpt is not 100%.
Through Tcode CS12 u can see the level wise components for a BOM.
U can gather the component details with this Tcode if u hv very few BOMs to explore.
But if the count is higher u hv to select acoding way for it....
Attaching a part of code to explore multilevel BOM.....hope dis ll help u......
1 ST LEVEL
SELECT MATNR WERKS STLNR IDNRK STLAL
FROM ZMAT_PLANT
INTO TABLE IT_BOM
FOR ALL ENTRIES IN IT_INPUT **maintain materials to be explored in IT_INPUT
WHERE WERKS = IT_INPUT-WERKS AND
MATNR = IT_INPUT-MATNR.
CONCATENATE DOWNLOAD
'1_FILE'
'.TXT'
INTO DOWNLOAD1.
LOOP AT IT_BOM ASSIGNING <FS_BOM>.
MOVE <FS_BOM>-MATNR TO IT_CHECK_MAT-MATNR.
MOVE <FS_BOM>-WERKS TO IT_CHECK_MAT-WERKS.
APPEND IT_CHECK_MAT.
COUNT = COUNT + 1.
ENDLOOP.
SORT IT_CHECK_MAT BY MATNR WERKS.
DELETE ADJACENT DUPLICATES FROM IT_CHECK_MAT COMPARING MATNR WERKS.
2 ND LEVEL
IF NOT IT_BOM[] IS INITIAL.
SELECT *
FROM ZCOMPONENTS
INTO TABLE IT_STPO
FOR ALL ENTRIES IN IT_BOM
WHERE MATNR = IT_BOM-IDNRK AND
WERKS = IT_BOM-WERKS.
ENDIF.
SORT IT_STPO BY MATNR WERKS.
CONCATENATE DOWNLOAD
'2_FILE'
'.TXT'
INTO DOWNLOAD1.
LOOP AT IT_STPO ASSIGNING <FS_STPO>.
MOVE <FS_STPO>-MATNR TO IT_CHECK_MAT-MATNR.
MOVE <FS_STPO>-WERKS TO IT_CHECK_MAT-WERKS.
APPEND IT_CHECK_MAT.
COUNT = COUNT + 1.
ENDLOOP.
UNASSIGN <FS_STPO>.
SORT IT_CHECK_MAT BY MATNR WERKS.
DELETE ADJACENT DUPLICATES FROM IT_CHECK_MAT COMPARING MATNR WERKS.
SORT IT_STPO BY IDNRK WERKS.
LOOP AT IT_STPO.
READ TABLE IT_CHECK_MAT WITH KEY MATNR = IT_STPO-IDNRK
WERKS = IT_STPO-WERKS
BINARY SEARCH.
IF SY-SUBRC <> 0.
MOVE IT_STPO-IDNRK TO IT_STPO1-MATNR.
MOVE IT_STPO-WERKS TO IT_STPO1-WERKS.
APPEND IT_STPO1.
ENDIF.
COUNT = COUNT + 1.
ENDLOOP.
REGARDS ,
AJIT.
Edited by: AJIT THAKUR on Apr 16, 2009 10:51 AM
Edited by: AJIT THAKUR on Apr 16, 2009 10:54 AM -
Hi,
I want to find last children of a material.I am using FM CS_BOM_EXPL_MAT_V2. Although STPOX internal table as STUFE for level but we can't get all the last child of material directly.
For example material A as child A1 and A2 this sub divided into A1- A11, A12 and A2 - A21 , A22 and again A21 -A211,A212 and A22 - A221,A222
so the last children are A11,A12,A211,A212,A221,A222. So if we use max of STUFE it will omit A11 and A12.Do i need to program a custom logic to get last child using Stufe and WEGXX or is there any other method available to get Last Children of the Material or is there any other Function module to get the Last child of the material.
Thanks in Advance.You will have to write your own custom logic after calling the function module. In my case, it is easy, because the lowest level materials will always be raw materials(material type ZROH) as opposed to a semi-finished material(material type HALB). Your's may be different.
REgards,
Rich Heilman -
Refresh using CS_BOM_EXPL_MAT_V2 2 times
Hi,
my problem is:
1. use fm CS_BOM_EXPL_MAT_V2 to get BOM data.
2. I modify the BOM using a Batch Input
3. use fm CS_BOM_EXPL_MAT_V2 to get the BOM updated.
the FM in the 3th step load the old data and not the updated BOM.
Any suggest?
Can i clear the program cache?Hello,
I'm answering to this threat even though it's 5 years old just in case somebody is looking out for the solution like I was a couple of weeks ago.
The FM CS_BOM_EXPL_MAT_V2 calls internally another FM called GET_STPO. Inside GET_STPO you will find structure STPOCTL which will contain material's information for the previous run of CS_BOM_EXPL_MAT_V2. Also, FM GET_STPO calls FM GET_STATS which will contain the structure STASCTL; both these structures need to be cleared in order for the Function Module to retrieve fresh data from the database, instead of just returning the same data that was returned in the first run.
In the Function Group CSIO, which contains all these Function Modules, there's a Function Module in charge of clearing these structures plus another internal tables which will contain the material's information, you need to call this FM right after your 1st iteration in order to clear the buffer. The Function Module is CSIO_REFRESH_BUFFER or CS_IO_BOM_BUFFER_SMASH, depending on your SAP implementation.
Hope this helps anyone
Message was edited by: Matthew Billingham - changed formatting to make more readable -
Multi-level BOM explosion using CS_BOM_EXPL_MAT_V2
Hi All,
I would like to know, if anyone has used the function module 'CS_BOM_EXPL_MAT_V2' to prepare a report to read multi-level BOM just like CS12. If anyone has, can you please let me know how we can read the individual materials in the BOM from this FM.
Hope my question is clear, await inputs.
VivekHi vivek,
We use this code to restrict the BOM line item for particular movements. C if that can help u out.
CALL FUNCTION 'CS_BOM_EXPL_KND_V1'
EXPORTING
capid = ''
datuv = sy-datum
emeng = 1
mehrs = 'X'
mtnrv = i_mseg-matnr
stlal = '1'
stlan = '1'
stpst = 0
svwvo = 'X'
werks = i_mseg-werks
vbeln = aufk-kdauf
vbpos = aufk-kdpos
VERID = ' '
vrsvo = 'X'
IMPORTING
TOPMAT =
DSTST =
TABLES
stb = ZStb
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
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT zstb BY mtart.
LOOP AT zstb.
IF zstb-mtart = 'Material type ' OR zstb-mtart = 'Material type ' .
ELSE.
DELETE zstb .
ENDIF.
ENDLOOP.
CLEAR: v_menge, v_matnr, v_bwart, vv_menge, vvv_menge, zstb.
LOOP AT zstb.
SELECT menge matnr bwart
INTO (v_menge,v_matnr,v_bwart)
FROM aufm
WHERE aufnr = i_mseg-aufnr
AND werks = i_mseg-werks
AND matnr = zstb-idnrk
AND ( bwart = '261' OR bwart = '262' ).
and meins = 'FT2'.
LOOP AT zstb.
SELECT SINGLE matnr INTO vv_matnr FROM mara WHERE matnr = v_matnr
AND mtart = zstb-mtart.
IF sy-subrc = 0.
CASE v_bwart.
WHEN '261' .
vv_menge = vv_menge + v_menge.
WHEN '262' .
vvv_menge = vvv_menge + v_menge.
ENDCASE.
ENDIF.
ENDLOOP.
ENDSELECT.
CLEAR vf_menge.
vf_menge = vv_menge - vvv_menge.
CLEAR vv_menge.
CLEAR vvv_menge.
Regards,
Vishal -
Help reqd in CS_BOM_EXPL_MAT_V2
Hi,
I'm using CS_BOM_EXPL_MAT_V2 to explode a BOM. Even though I have checked import parameter MEHRS = 'X', the BOM only explodes to the first level. Inshort the function module is not outputting the sub components under the components of the header material( i.e. level 2 and further)...
Does anyone know how to resolve this ?
Regards,
Aravindhi Aravind,
WELCOME TO SDN
Check these Links
'CS_BOM_EXPL_MAT_V2 ?
Re: CS_BOM_EXPL_MAT_V2 Problem
http://erp.ittoolbox.com/groups/technical-functional/sap-r3-dev/573891#
http://www.sap-img.com/abap/abap-clipboard-utilities-for-beautiful-commented-code.htm
Regards,
Santosh
Note: Reward Points if helpful -
In bom explosion afterthat i ll get routing ,workcenter.plnnr ,plnty = n
Hi Experts
my requirement is to explode the bom like cs12 tcode in pp
after that we ll find which component is having routing ,then we pick the
workcenter if the material procurement type is E OR X.
HERE I AM USING MARC,MAPL,PLPO,CRHD.
1.USING CS_BOM_EXPL_MAT_V2 TO EXPLODE THE BOM
MARC IF BESKZ = E OR
===> BESKZ = X ==> MAPL
MATNR MATNR
WERKS PLNTY
BESKZ PLNNR
PLPO
PLNTY
PLNNR
VORNR
ARBID--CRHD
LTXA1 OBJID
VGE01 ARPBL
VGW01
VGW02
WERKS
HERE WE USED TO GET BESKZ = X OR E
AFTER THAT COMAPARE MARC-MATNR = MATNR & ISTPO-IDNRK
MAPL AND PLPO HERE WE USED TO RELATE BETWEEN PLNNR
PLNTY = 'N'
109013030 IS THE HEADER MATERIAL HAVE THE FOLLOWING BOM
.1 610001440
..2 L021000260
.1 912500076
HERE .1 - LEVEL 1,..2 LEVEL 2.
USING CA03 TO GIVE THE MATERIAL WE GOT THE OPERATIONS AND WORKCENTER
IN TABLE MAPL , GIVE THE MATNR AND PLANT ,PLNNR
AFTER THAT I RELATE THE PLNNR TO PLPO
FETCH ALL THE RELEVANT FIELDS FIVE OPERATIONS CAME
BUT IN CA03 THE SAMEMATEIALS GIVE ONLY 3 OPERATIONS ONLY CAME
how can i sove this issue.
very urgent
thanks in advance
Regards
dsHI
MARC ,MAPL only having the plnnr,plnty
not having vornr,stues
plpo is having all the fields
how can i pass plnnr with vornr,stues,vornr to plpo
Regards
ds -
How to find out the immediate parent for a material
I am Exploding a material by using CS_BOM_EXPL_MAT_V2. Now i am getting items for that perticular materil.
how can i find out parent material for a given Item material.
Please any one help me on this.
Thanks in advance
VenkatHi,
Refer to this thread.
FM to get all Parent material/BOM of the given material
Regards,
Vimal. -
Bomexplosion,workcenter with routing
Purpose
The purpose of this report is to show the summary of Routing details of a Finished component from Raw material via Semi-finished component in a single report.
Concept of BOM for finished components are defined in terms of semi finished goods. Hence, routing of a Finished component from raw materials can not be seen directly in system through standard report.
But users need to have the details of a routing of a Finished component from raw material in one report. To provide the details in single report, development is required.
<b>INPUT IS</b>
MATERIAL
PLANT
I tried this following method
1. <b>USING CS_BOM_EXPL_MAT_V2</b>
TO explode the bom with header materials- ISTPO-IDNRK
2. after I am using <b>MARC</b> table with the following fields
MATNR,WERKS,BESKZ---- HERE I CLASIFED THE MATERIAL procurement type
E OR X OR F.
3. IF BESKZ = E OR X --- CHECK <b>MAPL</b> with the following fields
MATNR,WERKS ,PLNTY,PLNNR. PLNTY = N
4. After that I am using the table PLPO with the following fields
PLNTY,PLNNR,VORNR,ARBID,LTXA1,VGE01,VGW01,VGW02,WERKS
5. After I am using the table<b> CRHD</b> with the following fields
OBJID,ARBPL
6. IF MARC BESKZ = F.
7. Using the following table with the fields <b>EORD</b>-MATNR,LIFNR,FLIFN = X
8. After using the <b>EINA</b> with the following fields MATNR,LIFNR,INFNR.
9. After using <b>EINE</b> with the following fields INFNR,APLFZ.
REQUIRED OUTPUT IS
1.material
2.materials description
3.workcenter
4.vendor
5.operation description
6.uom
7.qty
8.setuptime
9.processingtime
10.delivery time
PROBLEM
On executing the program, the out put contains some extra operations which is not there in the CA03 output of the component.
Please help us in solving this issue.
very urgent
Regards
dsThis is your 5th post about your abap program !
You never closed the other.
In a previous I advice you to check against the validity date of routing, I also suggest you to use FM CARO_ROUTING_READ.
Erwan -
What do you mean by changing a Function Group in upgradation projects
Hi ABAPers,
I am new to upgradation project will any one help me in understanding the concepts like.
1) what do you mean by changing a Function Group in upgradation projects
2) what is the relation b/w the Maintenance view and function group
3) what happens when we regenerate the table maintenance in se11
4) how can i restore the changes that have done to FG after regenerating
5) Suggest me is there any Tcode or procedure to see the code in Remote system (like how we compare the versions of remote system)
Could you please help me ..
Any relevant docs you can send it to [email protected]
Thanks in advance..Hello Smriti,
Exploding a BOM means to display all the components and sub-components for a BOM in a particular transaction (eg) VA01,CO01,ME22N etc..
You can use the SAP FM's depend on the Functionality:
CS_BOM_EXPLOSION General BOM explosion
CS_BOM_EXPLOSION_EQUI BOM explosion - initial screen: equipment
CS_BOM_EXPLOSION_MAT BOM explosion (old version); as of 3.0, use CS_BOM_EXPL_MAT_V2
CS_BOM_EXPL_EQU_V2 BOM explosion for equipment
CS_BOM_EXPL_KND_V1 BOM explosion for material
CS_BOM_EXPL_MAT_V2 BOM explosion for material
CS_BOM_EXPL_PSP_V1
CS_BOM_EXPL_TPL_V1 BOM explosion for functional location
CSS7 Explode BOM (Document)
CS_BOM_EXPL_DOC_V1 BOM explosion: document sub-assemblies
CS_BOM_EXPL_GNRL2_V1 General BOM explosion: document sub-assemblies
CSSO
CS_SO_MODE_BOM_EXPLOSION
As per Garet in response to your question better talk to the Functional team to get the better underatanding for your requirement.
Check the below link for more details on BOM:
http://sap-img.com/sap-sd/what-is-bom-referring-to-sap-sd.htm
Thanks,
Greetson -
Function module needed to read all the BOM statuses
Dear Friends,
In a report we are using CS_BOM_EXPL_MAT_V2 function module to get the dispaly the BOMs. But it is displaying only the BOMs which are in Active stauts e.g 1 & 3.
My requirement is needs to read both active and inactive BOMs. Inactive BOM status is 2.
suggest me if there is any another FM or any another way to get all the BOM status materials.
Thanks for your help.
Srinivas.You need to supply another application for alternative determination (field CAPID). It should be possible to customize one for your needs using "Define Order of Priority for BOM Usages" and "Define Applications" under "Production->Basic Data->Bill of Material->Alternative Determination"
Edited by: Carsten Grafflage on Aug 5, 2010 1:44 PM: Corrected one string from customizing - sorry. -
Is there a Function Module to read all BOM Variants
Hi,
I have a requirement to read all the BOM variants of Engineering BOM through a Function Module and pass this information to Third Party Application.
Is there any such Function module/BAPI?
Need your expert advice.
Thanks and Regards,
OmPrakashHi ,
If you want to use 'CS_BOM_EXPL_MAT_V2' funtion to get the BOM components, you need to give the importing parameter mtnrv( material number).
the components are stored in TABLES : stb.
I am doing this way.
but werks, date , and capid are optional .
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
mtnrv = i_matnr
werks = i_werks
datuv = i_date
capid = l_capid
IMPORTING
topmat = ms_cstmat
TABLES
stb = lt_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.
Please give it a try.
BR,
Ovidiu -
BOM Exlposion for Assembly Materials
Dear Friends,
I want function module to be explode the BOM for Materials which are Having checked by Assebmly(Field is STLKZ) .I am able to explode the BOM which are Having Phatum Indicator using CS_BOM_EXPL_MAT_V2 which is having DUMPS(Phantun Indicator) .I need to find out the Assembly Indicator .
Pls Help me How to Find out Assemble Indicator for Materials.You can pass the component material to the table MAST. If any value exists against the component number than this material has Assembly indicator active.
Another option is when using the FM CS_BOM_EXPL_MAT_V2 . Check if table STB(Structure-Stpox) with field XTLTY(BOM Category) is equal to type 'M'.The passing condition will give Assembly indicator.
Regards,
Anurag
Maybe you are looking for
-
All of my downloaded apps will exit out of them, how do I fix this?
The apps I've downloaded will open and close out after a short period of time, I've turned off my location services as suggested but they still do it. I have tons of space left on my iPad so I have no idea how to get them to stop...help please!
-
Hi Experts, my task is to convert a smartform into pdf & download & email. in two different programs download program i converted smartform using 'CONVERT_OTF_2_PDF' and its working fine with no problem. and in email program when tried the same one,
-
Disable auto Pick confirmation for EK00 output - Outbound Delivery
Hello experts, Need help with Outbound Delivery Picking output typ EK00, I have setup the output type to be triggered automatically upon Delivery creation, It's printing the pick List as desired, But the problem is it's also confirming the Pick quant
-
I took my battery out to reset my phone. Now it won't turn on from a white screen that says App error 532 and a reset button. Every time I reset it goes back to the error code screen. HELP!!!!!!!
-
hi Team, We have IDOC sent from ECC system at 7:30 AM but in SXMB_MONI shows 'processing started' at 11:12 AM. So just wondering how do i trace, why there was a delay in processing? How do i calculate the diff. hops of messages and time spent at each