BOM: Finding Children Nodes For a Given Parent Node

Hi,
I am trying to find the longest path for a particular BOM material. I am using the FM CS_BOM_EXPL_MAT_V2 to explode the BOM to get the materials (including children nodes etc.). I think, in this scenario, a recursive function would be the best way to go. The problem is to find the children nodes for a node in a particular level. Looking at the structure STPOX and the fields STUFE (Level), WGEXX (path) , TTIDX (index) and VWGEX (path, multi-level), I cannot find a logical way to link the children nodes to a parent node although visually I can see how things are connected when the FM returns the STB table..
For example: TBL_STB returns from FM:
STUFE     WEGXX     BMTYP     TTIDX     VWEGX     OJTXB
1     1     M     1     0     MATXX1
2     1     M     2     1     MATXX2
3(a)     1     M     3     1              MATXX3     
4(c)     1     M     4     1              MATXX4               
4(d)     2     M     4     1              MATXX5     
3(b)     2     M     3     1              MATXX6     
4(e)     3     M     5     2              MATXX7     
4(f)     4     M     5     2              MATXX8     
Visually, we can tell that  Level 2 has one item 2, level 3 has 2 items, 3(a) and 3(b), Level 4 has 4 items where 4c and 4d are connected to 3a and 4e and 4f are connected to 3b.
Going through STPOX structure itself, how can we find out that 4c and 4d belongs to assembly 3a but 4e and 4f belong to 3b??  If someone can explain the uses of the differnet indicators in STPOX (or other) where I can find out the children from the parent, it would be greatly helpful to write the recursive function..
Thanks in advance..
P.S. I will give points out immediately for any useful answers..
Edited by: Shuvo Datta on Sep 10, 2008 6:17 PM

Figured it out myself

Similar Messages

  • How to find latest child for a given parent in same table?

    More details:
    Here I am giving an example -
    Orig_ID     Chg_to_ID
    A     B
    B     C
    C     D
    D     Null
    From source I use to get Orig_ID values, using Orig_ID value have to find latest Child(Chg_to_ID) to that at any level.
    Latest child identify by Null value in the column "Chg_to_ID".
    If I get B --> need to replace B with D. I may get any value A or B or C or D -- but at an end I have to replace those values with 'D', since it is latest for any of those parents.
    I tried to use "Connect By Prior", but it is tooo slow ofcourse query not returned after 10min also. Plz advise.

    First time every employee will be assingend an ID and may changed/merged to another ID basing on some other conditins. So, any time first assigned ID may changed to new ID and will be updated to another column "Chg_to_ID" as winner ID and at the same time one more records will be created with new ID as ID and Null in "Chg_to_ID".
    In my first post, given an example, here pasting again:
    Orig_ID     Chg_to_ID
    A-------------->B
    B-------------->C
    C-------------->D
    D-------------->Null
    In detail: One employee first assigned ID as "A" after wards changed to "B". At that time data would be like below
    Orig_ID     Chg_to_ID
    A-------------->B
    B-------------->Null
    After that B change to C, now it looks like this:
    Orig_ID     Chg_to_ID
    A-------------->B
    B-------------->C
    C-------------> Null
    For each change one record will be inserted.
    My requirement is -- Orig_ID may get A or B or C, but I need to replace those with "C", since it is latest child. For latest child "Chg_to_ID" is NULL.
    Plz let me know for any clarifications.

  • EHSM - Create Vendor - error: 'Could not find a document for the given key'

    Dear all,
    In the Chemical Approval Process I have attached a SDS document to the Approval Request. You can assign a Vendor to the SDS. As there are no (EHSM) Vendors currently available in the system I would like to create a new (EHSM) Vendor by clicking on 'Create Vendor'.
    This will lead me to the following Webdynpro Application: Edit Vendor (EHFND_UI_VENDOR_OVP).
    Only one field is shown in the Webdynpro named: 'Name of the Vendor'. After typing a name e.g. 'test', the following error message appears; 'Could not find a document for the given key'. See also attached document. This issue looks like a missing number range, however I could not find a EHSM number range for Vendors.
    How to solve this issue?
    More information:
    Software Component: SAP EHS Management (EHSM) Support Package: 3
    Process: Chemical Approval
    Webdynpro application: EHFND_UI_VENDOR_OVP
    Thank you.
    Kind regards,
    Roy

    Hi
    babooraj
    This might be a problem with Windows Power Shell.
    The solution is to copy the folder: "PSWorkflow" from "C:\Windows\System32\WindowsPowerShell\v1.0\Modules\"
    to "C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules"
    Than everything works fine.
    Ps.: @Microsoft, please fix this problem in future versions.
    Thomas van Veen

  • Find the 'DAY' for a given 'DATE'

    Hi Folks,
    I need a help regarding finding the day for a given date.
    My requirement is that..,
             If I enter a date using 'parameters', it should write the 'day' for the corresponding date.
    To be more specific.....,
    if I enter date as ' 07/15/2008 ' it should return me  the day as 'Tuesday'.
    Regards,
    Naveen G

    HI,
    FM LIST WITH RESPECT TO DAY, WEEK, AND MONTH.
    CALCULATE_DATE : Calculates the future date based on the input .
    DATE_TO_DAY : Returns the Day for the entered date.
    DATE_COMPUTE_DAY : Returns weekday for a date
    DATE_GET_WEEK : Returns week for a date
    RP_CALC_DATE_IN_INTERVAL : Add days / months to a date
    MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
    END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
    HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
    FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
    MONTH_NAMES_GET : Get the names of the month
    WEEK_GET_FIRST_DAY : Get the first day of the week
    HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format
    SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours
    L_MC_TIME_DIFFERENCE : Find the time difference between two date/time
    HR_99S_INTERVAL_BETWEEN_DATES : Difference between two dates in days, weeks, months
    LAST_DAY_OF_MONTHS : Returns the last day of the month
    DATE_CHECK_PLAUSIBILITY :Check for the invalid date.
    Reward points if useful,
    siri

  • Find The Transaction for the given EXIT Name

    Hi Friends,
                    This is my doubt,pls dont think in the other sense
    I know how to find the EXIT for a given Transaction. My question is that IS THERE IS ANY WAY TO FIND THE TRANSACTION FOR A GIVEN EXIT NAME.Could any one help me out on this.My fuctional guys are giving me the EXIT names and asking me to find for which transaction the exit triggers.
    Thanks & Regards
    Vijaya Lakshmi

    hi lakshmi,
    try the following steps.
    1. give the exit name in SMOD.(J45A0007) go to display mode
    2. click component and take the exit name.(EXIT_SAPMJ45A_009)
    3. here SAPMJ45A is the progam name, so that in SE38 give the progame name click the Where used button and select the transaction and deselect other checkbox.
    4. you will get the transaction code.
    Reward if found helpful.
    Regards,
    Boobalan Suburaj

  • Context Mapping: child-nodes of non-mapped parent nodes

    I am somewhat curious about Context Mapping in WebDynpro.
    Which parents nodes need to be mapped in order to map child nodes ? Does a child node has more than one parent node (e.g. grandparent - two steps above) ?
    A.1  -
    MAPPED----
    >    B.1
      - A1.1   NOT MAPPED
      - A1.2   NOT MAPPED
            - A.1.2.1     MAPPED TO>    B.1.2.4
            - A.1.2.2   NOT MAPPED
      - A1.3   NOT MAPPED
    Is it sufficient that only one of these parent nodes (e.g. direct parent node not mapped, but parent node of this parent node is mapped) need to be mapped so that the child node can be mapped ?
    Is this assumption true or not ?
    The SAP library states:
    "Conversely, child nodes of non-mapped parent nodes cannot be mapped, otherwise this would result in irresolvable conflicts at runtime with respect to the parent-child relation in the context and the mapping relation." (http://help.sap.com/saphelp_nw04/helpdata/de/51/a3384162316532e10000000a1550b0/content.htm)
    This statement is not absolutely clear on this issue.

    Let me put it this way
    You have a node vehicle and you have a child node for that the car. The car node have parameters car1, car2.
    Let the vehicle node have parameters veh1 and veh2
    Then if you map vehicle node one to any other node (say in the comp. controller) you have the option of mapping its children i.e veh1,veh2 and carnode.
    You can have that veh1 is mapped and veh2 is not mapped.
    vehicle node(mapped)
    veh1(may or may not be mapped)
    veh2(may or may not be mapped)
    car node(may or may not be mapped)
    If instead you try to map only the car node the vehicle node will also get mapped automatically but not it's child parameters like veh1 and veh2.
    vehicle node(mapped)
    veh1(may or may not be mapped)
    veh2(may or may not be mapped)
    car nodemapped)
    car1(may or may not be mapped)
    car2(may or may not be mapped)
    Hope this would help.
    Do revert for further clarification
    Regards
    Noufal

  • How to add an item object as a child for a specified parent node in AdvancedDataGrid in Flex?

    Hi all,
              This is the code, to add a object as a child into a specified parent node in AdvancedDataGrid in flex.
    <?xml version="1.0" encoding="utf-8"?><mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onCreationComplete()" width="100%" height="100%">
    <mx:Script><![CDATA[
    importmx.controls.Alert; 
    importmx.collections.IHierarchicalCollectionViewCursor; 
    importmx.collections.IHierarchicalCollectionView;  
    importmx.collections.ArrayCollection; [
    Bindable]private var objectAC:ArrayCollection = newArrayCollection(); 
    //This method is used to construct the ArrayCollection 'flatData' 
    private function onCreationComplete():void{
    var objOne:Object = newObject(); objOne.name =
    "Rani"; objOne.city =
    "Chennai";objectAC.addItem(objOne);
    var objTwo:Object = newObject(); objTwo.name =
    "Rani"objTwo.city =
    "Bangalore";objectAC.addItem(objTwo);
    var objThree:Object = newObject(); objThree.name =
    "Raja"; objThree.city =
    "Mumbai";objectAC.addItem(objThree);
    //This method is used to add one object as a child item for the parent node 'Rani' 
    private function addChildItem():void{
    var dp:IHierarchicalCollectionView = groupedADG.dataProvider asIHierarchicalCollectionView;  
    varcurent:IHierarchicalCollectionViewCursor = groupedADG.dataProvider.createCursor();  
    var dummyParentNode:Object = {name:"Rani", city:"New Delhi"};  
    var obj:Object = null; 
    while(curent.current){
    // To get the current node objectobj = curent.current;
    // Add Child item, when depth = 1 and Node name should be "Rani" 
    if (curent.currentDepth == 1 && obj["GroupLabel"] == "Rani"){
    dp.addChild(curent.current, dummyParentNode);
    curent.moveNext();
    groupedADG.dataProvider = dp;
    groupedADG.validateNow();
    groupedADG.dataProvider.refresh();
    ]]>
    </mx:Script> 
    <mx:AdvancedDataGrid id="groupedADG" x="10" y="15" designViewDataType="tree" defaultLeafIcon="{null}" sortExpertMode="true" width="305" > 
    <mx:dataProvider> 
    <mx:GroupingCollection id="gc" source="{objectAC}"> 
    <mx:grouping> 
    <mx:Grouping> 
    <mx:GroupingField name="name"/> 
    </mx:Grouping> 
    </mx:grouping> 
    </mx:GroupingCollection> 
    </mx:dataProvider> 
    <mx:columns> 
    <mx:AdvancedDataGridColumn headerText="Name" dataField="name"/> 
    <mx:AdvancedDataGridColumn headerText="City" dataField="city"/> 
    </mx:columns> 
    </mx:AdvancedDataGrid> 
    <mx:Button x="10" y="179" label="Open the folder 'Rani'. Then Click this Button" width="305" click="addChildItem()" /> 
    </mx:Application> 

    Hi,
    It's not possible to 'append' a StringItem or a TextField (or any other lcdui.Item object) to a Canvas or GameCanvas. You can only draw lines, draw images, draw text, etc etc, on a Canvas screen. So, you can only 'simulate' the look and feel of a TextField (on a Canvas) by painting it and adding source code for command handling (like key presses). However, this will be quite some work!!
    lcdui.Item objects can only be 'appended' to a Form-like Displayable.
    Cheers for now,
    Jasper

  • How to find the Datasources for the given table names ?

    Hi All,
    I have an urgent requirement where I ned to find the names of BW Datasources, created for the given table names.
    Both the tables and Datasources are in BW system only. I can see the table in SE11 but I am unable to find its associated Datasources in the 'Where Used List'.
    Is there any method ?
    Will assign points to satisfactory answers.
    Regards,
    Srinivas

    Hi,
    Check this thread on how to find the DS.
    I have the field name, please help me find the data source.
    Once you identify your DS you find which all Data targets are fed by trying to see the " Show data flow" in RSA1 for this data source.
    Hope this helps.
    Thanks,
    JituK
    Edited by: Jitu Krishna on Apr 30, 2008 11:52 AM

  • How to find Handling unit for a given Sales order...

    From which table can we find the Handling unit for a given Sales order?

    hi this will help u.
    SALES AND DISTRIBUTION TABLES
    KONV Conditions for Transaction Data
    KONP Conditions for Items
    LIKP Delivery Header Data
    LIPS Delivery: Item data
    VBAK Sales Document: Header Data
    VBAP Sales Document: Item Data
    VBBE Sales Requirements: Individual Records
    VBEH Schedule line history
    VBEP Sales Document: Schedule Line Data
    VBFA Sales Document Flow
    VBLB Sales document: Release order data
    VBLK SD Document: Delivery Note Header
    VBPA Sales Document: Partner
    VBRK Billing: Header Data
    VBRP Billing: Item Data
    VBUK Sales Document: Header Status and Administrative Data
    VBUP Sales Document: Item Status
    VEKP Handling Unit - Header Table
    VEPO Packing: Handling Unit Item (Contents)
    VEPVG Delivery Due Index
    with regards,
    Hema Sundara,
    pls reward if u find it helpful.

  • How to find Assembly Numbers for a given Equipment Number

    Hi all,
    Can anyone pls help me out in finding the assembly numbers for a given equipment number??
    Thkz in advance.
    Harpreet.

    Hi
    Try a code like this:
    DATA: BEGIN OF MCHA_KEY,
           MATNR TYPE MATNR,
           WERKS TYPE WERKS_D,
           CHARG TYPE CHARG_D,
          END   OF MCHA_KEY.
    DATA: BATCHCLASS LIKE BAPI_CLASS_KEY-CLASSTYPE VALUE '022'.
    DATA: OBJECT_CLASSIFICATION LIKE  BAPI_OBJECT_VALUES
                                                  OCCURS 0 WITH HEADER LINE,
          CLASS_OBJECTS LIKE  BAPI_CLASS_OBJECTS  OCCURS 0 WITH HEADER LINE.
    DATA: _CLASSNUM LIKE BAPI_CLASS_KEY-CLASSNUM.
        BAPIFLAG = 'X'.
        CALL FUNCTION 'BAPI_CLASS_GET_CLASSIFICATIONS'
             EXPORTING
                  CLASSTYPE              = '022'
                  CLASSNUM               = _CLASSNUM
                  CHARACTS_OF_CLASS_ONLY = BAPIFLAG
             TABLES
                  OBJECT_CLASSIFICATION  = OBJECT_CLASSIFICATION
                  CLASS_OBJECTS          = CLASS_OBJECTS
             EXCEPTIONS
                  OTHERS                 = 1.
    Max

  • Runtime ik springs: child nodes break when a parent node is moved

    There is something wrong with IK armature springs when used in runtime mode. Child nodes become disjointed with user interaction of parent nodes.
    Drag spring on right from different points to see bug here: http://gardenofpossibilities.org/flash/ik_spring_runtime_bug/spring_runtimebug.html
    I filed this as a bug, but wanted to mention it here in case others have a similar problem or anyone has a workaround:
    Steps to reproduce bug:
    1. Build simple movieclip based armature
    2. add springs to bones
    3. set armature to runtime and publish
    Results:
    Armature child nodes become disjointed with user interaction of parent nodes. Same disjointed behavior occurs when armature is moved with actionscript 3 ik.mover.
    Expected results:
    Armature nodes should remain properly connected when user or actionscript 3 ik_mover moves any node.
    My Analysis:
    When springs are 0 (no spring) armature works correctly. It appears that the problem is caused by child nodes pivoting at parent node head, when they should actually pivot at parent node tail. Also, when armature becomes disjointed, dragging or moving tail node (furthest from root) restores joints.
    I've posted and example of the bug here: http://gardenofpossibilities.org/flash/ik_spring_runtime_bug/spring_runtimebug.html
    ...and a .zip archive of the fla: http://gardenofpossibilities.org/flash/ik_spring_runtime_bug/
    Please enlighten me on what is wrong, how to fix (if possible). If this is a documented bug, please provide a reference to it.
    Thanks!

    I posted this two months ago. Does anybody have anything to add on this issue? Are there any Adobe programmer/engineers out there? I've even filed a bug report, but have not received any feedback. Not a peep. Please?

  • Mapping problem of Child Node elements as per Parent Node conditions

    Hi,
    I have an IDOC to SOAP scenario,I have to map the following fields of IDOC,
    E1EDPT1 (0..999..)
    _TDID (0..1)
    _ E1EDPT2 (0..999..)
    _  TDLINE (0..1)
    Whenever I have the element TDID = Z011, I have to map the element TDLINE to the target Message Type AVL_QTY , which is as below (any one)
    ITEM_TEXTS (0..unbounded)
    _ ITEM_TEXT (0..unbounded)
                   |_  AVL_QTY (0..1)
    I have done a graphical mapping where the Node ITEM_TEXTS is created only if the above condition is met, ITEM_TEXT and AVL_QTY are mapped directly to E1EDPT2 and TDLINE.
    This works for only one item, it fails for multiple.
    Please suggest a solution...
    Thanks and Regards,
    Rohit.

    Hello,
    Thanks for the above suggestion!
    But still the problem exits.
    I have currently mapped the field in such a way that it gives proper solution but every item i.e. E1EDP01 segment must have an E1EDPT1 segment with element TDID = Z011.
    Mapping in Text View looks like below:
    /ns0:MT_CONTRACT_DOWNLOAD_MOnline/CONTRACT_ITEM/AVL_QT=addCorresponding(removeContexts(index(ifWithoutElse(stringEquals(/ORDERS05/IDOC/E1EDP01/E1EDPT1/TDID, const(value=Z011)), /ORDERS05/IDOC/E1EDP01/E1EDPT1/E1EDPT2/TDLINE, keepss=false), start=1, inc=1, type=0, result)), removeContexts(ifWithoutElse(stringEquals(/ORDERS05/IDOC/E1EDP01/E1EDPT1/TDID, const(value=Z011)), /ORDERS05/IDOC/E1EDP01/E1EDPT1/E1EDPT2/TDLINE, keepss=false)), result)
    UDF for addCorresponding method:
    int flg=0;
    for (int i=0; i<indexes.length; i++)
        if(! indexes<i>.equals("1"))
                   result.addValue(tdTexts<i>);
         else
              if(flg == 0)
                        result.addValue(tdTexts<i>);
                        flg = 1;
              else
                             result.addContextChange();
                             result.addValue(tdTexts<i>);
    Suppose if there are 3 items, the above condition is met in 1st and 3rd item, and if the 2nd item has TDID = Z008, then in the output i get three item values with the TDLINE values in the first two items itself, it doesnt recognise that 2nd item hasnt matched the condition.
    Thanks and Regards,
    Rohit.

  • Sizing a Node based on the Parent Node Size, How?

    Hi All, I'd like to base the dimensions of my nodes (width/height) based on the size of the Stage.
    To explain this in greater detail.... if I run my app on a 1024x768 monitor or on a 1920x1080 monitor then I have different aspect ratio's and screen space I can utilize. Just the same if the size of the window is manipulated then my Node content should "recalculate" their dimensions.
    How can you ask for the size of a Stage or Scene from a child node?
    Edited by: AndrewHughes on Feb 18, 2009 4:18 AM

    I sure hope someone has something better than this, because it's an aweful hack..... also if the Scene is empty at the start the window just closes, hence the 0x0 rectangle.
    //first create the stage...
    var stage = Stage {
        title: "MyApp"
        scene: Scene {
            content: [Rectangle {
                    x: 0,
                    y: 0
                    width: 0,
                    height: 0
                    fill: Color.BLACK
    //have to do a bound reference to on replace trigger that the size has changed and reconstruct the ui.
    var width:Number = bind stage.width on replace {reconstruct()};
    var height:Number = bind stage.height on replace {reconstruct()};
    //reconstruct the ui completely
    public function reconstruct():Void{
        stage.scene.content = [
            ImageView {
                image: Image {url: "http://forums.sun.com/im/a2v8_forums.gif"}
                fitHeight: height
                fitWidth: width
            Text {
                font: Font {
                    size: 24
                x: stage.width * .25,
                y: stage.height * .25
                content: "{stage.width}(w)"
            Text {
                font: Font {
                    size: 24
                x: stage.width * .75,
                y: stage.height * .75
                content: "{stage.width}(w)"
                rotate: 90
        println("Redrew everything... for new window size.");
    }

  • Account Type for Rollup/Parent Nodes in Fusion GL Hierarchies

    We are currently implementing Fusion GL.  As part of creating reporting hierarchies, there is some unclarity around requirements for how to assign the Account Type field (Asset, Liability, Owner's Equity, Exp, Rev) for the rollup/parent nodes in the natural account dimension.  Does the Account Type field impact any reporting or functionality when applied to a rollup/parent node?  Or can they all be defaulted to one option?
    Thanks.

    Hello Vadim,
    Thanks for prompt reply.
    Can you please elaborate with an example.
    I have a GL account no 4000 for AST and my parent node is NEWB
    After loading master data I am getting ACCTYPE for GL Account No 4000 as AST but my parent node NEWB is EXP due to above mentioned mapping.
    Do I have to map all my GL accounts and hierarchy nodes in my conversion file with respective ACCTYPE?
    Regards
    Gaurav

  • Get the Stock for a given Material no

    Hi,
         I'm an ABAP consultant, new to MM.
         I have a requirement - For a given Production Order I have to find the Material and respective BOM Explosion. Once that is done I have to get the Stock for those Materials [Child Materials].
    I have used AUFK and AFPO to get the material from the Production Order and Used MAST table to get the other details and passed it to FM - 'CS_BOM_EXPL_MAT_V2' - This gives me the Child materials.
    Now I want to know how can I find the Stock for a given Material. I want to get the Overall Unrestricted stock. Which Table do I have to use. Is there any standard Function Module [FM] or BAPI to get it.
    Please help.
    Thanks & Regards,
    Ashish

    I have gone through  the MARD table. I want to confirm - for a Material no there are more than 1 plant and for each plant there are more than storage location. So I have to add the Unrestricted Stock of all those to get the Full Unrestricted Stock.
    Please refer Transaction MMBE - I have to use that output.

Maybe you are looking for

  • IPad suddenly no longer detected by iTunes

    The cable works on my iPhone 5, so it's not the USB port nor the cable itself. My iPhone 5 and iPhone 4 are both recognized by iTunes and iPhoto, however suddenly today I couldn't sync my iPad. Any solutions, gratefully accepted. Thanks.

  • Return of Goods from Customer to a Manufacturing Plant

    Hi, This is a scenario of Return of Goods from Customer to a Manufacturing Plant and Excise Registers RG23A Part 1 and RG23A Part 2 need to be updated. As the material is finished goods so its material type in J1ID is RG1 in the manufacturing plant.

  • Call a ABAP Web Service externally

    Hi Experts, I have a question on ABAP Web Service: is it possible for Company A to call a ABAP Web Service from Company B externally? If yes, how would the it be done? How would the authority be controled? The calling of a Web Service externally, is

  • Is there a way to map videos in a 3D environment?

    Sorry, this is kinda hard to explain.  Is it possible to have the area in which you put clips be a 3D environment.  For example, could I put several clips around eachother in the shape of a sphere and scroll the camera around the sphere?  If this is

  • How can I install Flash Player 11.7 on my Mac?

    I've been trying to install Adobe Flash Player 11.7. on my Mac for months. Finally, today I decided to "take the bull by the horns" and have spent several hours trying to get to the bottom of the problem -- to no avail. I've followed every support di