‎2011 Sep 19 3:33 PM
Hello experts,
I am at present using FM 'CS_BOM_EXPLOSION' but its for single level BOM explosion now requirement is for muti level BOM explosion for this I had used FM 'CS_BOM_EXPL_MAT_V2'.
But I need to display components or items in my report which I am getting in field OBJNR of STBP table returned through FM 'CS_BOM_EXPLOSION'.
The problem is if I am using FM 'CS_BOM_EXPL_MAT_V2' then I am getting component description in field OJTXP but I need object number(OBJNR).
So, Is there any way that I can achieve muti-level BOM through FM 'CS_BOM_EXPLOSION' or How should I get OBJNR
by using FM 'CS_BOM_EXPL_MAT_V2'.
Please help.
‎2011 Sep 19 3:59 PM
Hi...
Did you try to create a custom recursive function to read BOM? You should pass matnr, level, plant and status as actual parameters.. When you reach the deepest level you set status to false and recursevely come back.. This is the best way I think to reach your target... If you want I can pass you some code...
Hope to help
‎2011 Sep 19 3:59 PM
Hi...
Did you try to create a custom recursive function to read BOM? You should pass matnr, level, plant and status as actual parameters.. When you reach the deepest level you set status to false and recursevely come back.. This is the best way I think to reach your target... If you want I can pass you some code...
Hope to help
‎2011 Sep 19 4:14 PM
Thanks for the earliest reply, I will appreciate If you Share some code...
Regards,
Shubh
‎2011 Sep 19 4:25 PM
Hi...
I can send you this code but you have to adapt it to your needs...
Your form should have this kind of declaration ... fdeep in first launch is 0 ...
form explode_bom using value(fdeep)
value(fmatnr)
value(fplant)
value(fqtbase) "optional
changing fstatus.
Inside your form you have to do all kinds of control you need , to bypass for example types of BOM you don't need or kind of materials you don't want...
You have to keep local_status for local form memory status and
work_status to pass to your sub form call...
like this...
local_status = ctrue.
work_status = ctrue.
w_deep = fdeep + 1.
perform read_diba tables it_mast "It will contain data for further exploding
using fmatnr
changing no_diba "No diba exception
prs_altern "Alternative BOM if you want to check it
w_tdiba. "BOM Type
if no_diba eq 'X'.
fstatus = cfalse.
EXIT.
ELSE.
* DO what you want
* Read BOM positions and data
perform read_bom tables it_mast
it_stko
it_stpo.
loop at it_stpo.
perform explode_bom using w_deep
it_stpo-idnrk
fplant
tmp_qtbase
changing work_status.
if work_status eq cfalse.
local_status = cfalse.
endif.
endloop.
if local_status eq ctrue.
fstatus = ctrue.
else.
fstatus = cfalse.
endif.
ENDIF.
I hope this can help somehow...
‎2011 Sep 19 5:00 PM
Thanx This is helpfull for me.
But Still I have one doubt,
As in FM 'CS_BOM_EXPLOSION' there is export parameter VBELN (sales order no.) which i am passing in my FM.
But now I want to use FM 'CS_BOM_EXPL_MAT_V2' . In this function module I didn't found any sales order no. field so how should I design Logic according to sales order no. ??
‎2011 Sep 19 5:27 PM
Sales order have materials in positions...you have to study BOMs from material, not from sales order..
CS_BOM_EXPL_MAT_V2 is for material and CS_BOM_EXPLOSION is a general BOM explosion
You have to create a list of material of your sale order and study your BOM from this point... for every sale order you explode recoursevely its positions....
try this...
‎2011 Sep 20 3:49 AM
‎2011 Sep 20 2:18 PM
‎2011 Sep 20 3:06 PM
actually you can use CS_BOM_EXPLOSION as well for multilevel explosion. just make sure you set Parameter MEHRS = 'X' and BREMS = space.
‎2011 Sep 22 2:07 PM
@florian:
You are right FM 'CS_BOM_EXPLOSION' is working as multilevel BOM explosion after setting the fields MEHRS = 'X' and BREMS = ' ' .
Thank you for suggestion.
Edited by: shubh_ag on Sep 22, 2011 3:08 PM