2008 Mar 06 3:41 AM
I have builded the itab like this.
LEVEL CHILD PARENT QTY
1 C1 P1 2
1 C1 P2 3
2 P1 P3 2
2 P1 P4 2
2 P1 P5 2
3 P2 P6 2
When i give C1 as Input( The top most Node )
The output must be calculated for its lowest nodes
C1 -> P1 -> P3 = 4
C1 -> P1 -> P4 = 4
C1 -> P1 -> P5 = 4
C1 -> P2 -> p6 = 6
Displayed as
P3 - > 4
P4 - > 4
P5 - > 4
P6 - > 6
I just need a logic for this....Its a traversal technique..
2008 Mar 06 4:49 AM
2008 Mar 06 5:50 AM
The given function will help you to understand logic of performance
call function 'CS_BOM_EXPL_MAT_V2'
exporting
ftrel = ' ' "eingeschr. mehrst. - Au
altvo = ' ' "Alternativenvorrang
aufsw = ' ' "Auftragsstufe und -weg
aumgb = 'X' "Ausschussmenge berechne
aumng = f_bom_explosion-aumng "Ausschuu00EFmenge
auskz = 'X' "Ausschuu00EF bercksichtige
bagrp = ' ' "Baugruppeneinschru00F4nkung
beikz = ' ' "Beistellkennzeichen
bessl = ' ' "Selektionskennzeichen Be
bgixo = s_bgixo "BauGrpInfo nur fR Aufge "E40WDX
BGIXO = ' ' "BauGrpInfo nur fR Aufge "E40WDX
BREMS = 'X' "P30K044491
brems = ' ' "P30K044491
capid = h_capid "Anwendungskennung
cospr = ' ' "intern: Auftrags-(CO-)sp
cuobj = f_bom_explosion-cuobj "Konfiguration
datuv = t_kvmk-aldat "Datum gltig am
delnl = ' ' "nicht lagerh. lu00B3schen
ehndl = '1' "Einsatzw. bercksichtigen
emeng = f_bom_explosion-emeng "Einsatzmg. + Auss
erskz = ' ' "Ersatzteilkennzeichen
erssl = ' ' "Sel.kennz. Ersatzteil
fbstp = ' ' "Eing. mehrst. bei Fremdb
ksbvo = 'X' "SOBSLs interpretieren "E40ROB
mbwls = ' ' "Naterialbewertung lesen
mktls = ' ' "Kein Mat.kurztext
mdmps = 'X' "Eing. mehrst. bei DUMMY
mdnot = 'X' "Nicht mehrst. bei ART M
mehrs = 'X' "mehrstufige Auflu00B3sung
mkmat = s_mkmat "Eing. mehrst.; KMAT
mmory = s_mmory "Performance
mtnrv = f_bom_explosion-matnr "Material
postp = ' ' "POSITIONSTYP
rndkz = h_rndkz "RUNDEN: ' '=IMMER, '1'
rvrel = ' ' "RV-relevant
sanfr = ' ' "Fertigung
sanin = ' ' "Instandhaltung
sanka = ' ' "Kalkulation
sanko = ' ' "Konstruktion
sanvs = ' ' "Versand
schgt = ' ' "Schttgut
stkkz = ' ' "IH-Baugruppe
stlal = f_bom_explosion-stalt "Stcklistenalt.
stlan = f_bom_explosion-stlan "Stcklistenverw.
werks = f_bom_explosion-werks "Werk
qverw = '6'
verid = f_bom_explosion-verid "Fertigungsversion
importing
topmat = f_cstmat"DATEN ZUM EINSTIEGSMAT.
tables
stb = t_stpol
MATCAT = T_MATCAT "E40WDX
exceptions
alt_not_found = 06
call_invalid = 10
missing_authorization = 04 "P30K081483
no_bom_found = 01
no_suitable_bom_found = 05.
See ALso links [ABAP- ALV displaying the quantity of a Material and its BOM availability|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap-%2balv%2bdisplaying%2bthe%2bquantity%2bof%2ba%2bmaterial%2band%2bits%2bbom%2bavailability]
[Fetching BOM Components for Materials and Displaying Data -- Materials can vary from time to time|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/6139] [original link is broken] [original link is broken] [original link is broken];
[Explode BOMs in Enterprise Portal using htmlb tree - Part 1 (ABAP)|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1647] [original link is broken] [original link is broken] [original link is broken];
Edited by: Roman Kolesnikoff on Mar 6, 2008 6:51 AM
Edited by: Roman Kolesnikoff on Mar 6, 2008 6:59 AM
Edited by: Roman Kolesnikoff on Mar 6, 2008 7:01 AM
2008 Mar 06 7:05 AM
Hi,
The following link may be useful for you.
http://eecs.ucf.edu/courses/cop3502h/spr2007/trees2.pdf
Regards
vadi