Parent to child like query..

Hi all,
I wrote a query like below..
select NO_CONTROL,NO_PO, min(NO_MEND) from
T20_SETT group by NO_CONTROL,NO_PO;
and out put is:
NO_Contorl NO_PUR  MIN(No_amend)
1059           726803    06
0440           734386    01
0213           732374    01
0217           732400    01
0321           733510    01
0462           734299    00Can some suggest changes to query to so that it should list out no_amend by rank (higest to lowest)
Here each Control number have multiple PO numbers and inturn each Po can have multiple Amend numbers.
required output like:
No_control   Po_No     AmendNo
1059           726803    01 (This being min amend no for this PO : 726803)
                  726803    02
1059           726804    01
                  726804    02
                  726804    03
1060           726805    00
                  726805    01 Please dont treat this as duplicate post..as i am struggling to get a solution for this.. any help would be highly appreciated..
sorry if you feel any formatting erros in this post.
Best Regards
Prasanth

You can do the basic output with a simple order by like this:
SQL > WITH t AS (
  2     SELECT 1059 no_control, 726803 no_pur, '01' no_amend FROM dual UNION ALL
  3     SELECT 1059, 726803, '02' FROM dual UNION ALL
  4     SELECT 1059, 726804, '01' FROM dual UNION ALL
  5     SELECT 1059, 726804, '02' FROM dual UNION ALL
  6     SELECT 1059, 726804, '03' FROM dual UNION ALL
  7     SELECT 1060, 726805, '00' FROM dual UNION ALL
  8     SELECT 1060, 726805, '01' FROM dual)
  9  SELECT no_control, no_pur, no_amend
10  FROM t
11  ORDER BY 1, 2, 3;
NO_CONTROL     NO_PUR NO
      1059     726803 01
      1059     726803 02
      1059     726804 01
      1059     726804 02
      1059     726804 03
      1060     726805 00
      1060     726805 01If the formatting you show is important, and cannot be achieved by whatever tool you are runnign the select in, then perhaps something along the lines of:
SQL > WITH t AS (
  2     SELECT 1059 no_control, 726803 no_pur, '01' no_amend FROM dual UNION ALL
  3     SELECT 1059, 726803, '02' FROM dual UNION ALL
  4     SELECT 1059, 726804, '01' FROM dual UNION ALL
  5     SELECT 1059, 726804, '02' FROM dual UNION ALL
  6     SELECT 1059, 726804, '03' FROM dual UNION ALL
  7     SELECT 1060, 726805, '00' FROM dual UNION ALL
  8     SELECT 1060, 726805, '01' FROM dual)
  9  SELECT CASE WHEN rnk = 1 THEN no_control END no_control,
10         CASE WHEN rnk = 1 THEN TO_CHAR(no_pur) ELSE '  '||TO_CHAR(no_pur) END no_pur,
11         no_amend
12  FROM (SELECT no_control, no_pur, no_amend,
13               ROW_NUMBER() OVER(PARTITION BY no_control, no_pur
14                                 ORDER BY no_amend) rnk
15        FROM t) t
16  ORDER BY t.no_control, t.no_pur, t.no_amend;
NO_CONTROL NO_PUR                                     NO
      1059 726803                                     01
             726803                                   02
      1059 726804                                     01
             726804                                   02
             726804                                   03
      1060 726805                                     00
             726805                                   01Note that the alias on the columns in the outer ORDER BY is important to ensure that iOracle uses the "real" columns for the sorting instead of the aliases in the outer query.
John

Similar Messages

  • No parent without child (hierarchical query)

    Dear Gurus,
    I have a problem with Hierarchical query. That is, I want show only those PARENTS who have child.
    Table structure:
    Business Unit
    BU_NO     BU_NAME BU_NO_PARENT
    1 Marketing
    2 Research 1
    3 Planning 1
    4 Strategic 3
    5 Admin
    6 Human Resources 5
    7 Accounts 5
    Employee
    EMP_NO     ENAME BU_NO
    7369 SMITH 2
    7499 ALLEN 6
    7521 WARD 1
    7566 CLARK 5
    7654 MARTIN 7
    7698 BLAKE 2
    7788 SCOTT 7
    7839 KING 5
    I have to show the list of employees with BU. But exclude those BU which have no employee. My output should be like this:
    NAME
    Marketing
    -----WARD
    -----Research
    ----------SMITH
    Admin
    -----CLARK
    -----KING
    -----Human Resources
    ----------ALLEN
    -----Accounts
    ----------MARTIN
    ----------SCOTT
    For this I've written a query but it shows all BUs (with employee and without employee)
    Query is:
    SELECT LPAD(obj_name, LENGTH(obj_name)+(LEVEL-1)*5, '-') obj_name
    FROM
    (SELECT 'B'||bu_no obj_no, bu_name obj_name, 'B'||bu_no_parent parent_obj_no FROM hr_bu
    UNION ALL
    SELECT TO_CHAR(emp_no), ename, 'B'||bu_no FROM hr_emp)
    START WITH parent_obj_no = 'B'
    CONNECT BY PRIOR obj_no = parent_obj_no;
    Can you please help me in writing query to eliminate BU from output where no employee is working.
    Thanks.

    Hi,
    To exclude certain nodes without excluding their descendants, simply use a WHERE-Clause, like this:
    SELECT     LPAD     ( obj_name
              , LENGTH (obj_name) + (LEVEL-1) * 5
              ) obj_name
    FROM     (
         SELECT     'B' || bu_no          obj_no
         ,     bu_name           obj_name
         ,     'B' || bu_no_parent     parent_obj_no
         FROM     hr_bu
         UNION ALL
         SELECT     TO_CHAR (emp_no)
         ,     ename
         ,     'B' || bu_no
         FROM     hr_emp
         ) u
    WHERE     obj_no     NOT LIKE 'B%'
    OR     EXISTS     (     -- Begin correalated sub-query to find emps in this bu
              SELECT     0
              FROM     hr_emp
              WHERE     'B' || bu_no     = u.obj_no
              )     -- End correalated sub-query to find emps in this bu
    START WITH     parent_obj_no     = 'B'
    CONNECT BY     PRIOR obj_no     = parent_obj_no;Output:
    OBJ_NAME
    Marketing
    -----Research
    ----------SMITH
    ----------BLAKE
    -----WARD
    Admin
    -----Human Resources
    ----------ALLEN
    -----Accounts
    ----------MARTIN
    ----------SCOTT
    -----CLARK
    -----KINGThe results above include employee Blake, who was not included in your sample output, but I assume he was left off by mistake.
    The solution above may produce misleading output. For example, if you remove employee Ward from your sample data, then the Marketing unit will not appear, but the Research unit will still appear (as you want), but Reasearch will be at LEVEL=2, so you may get the output below, which seems to indicate that Research is a child of Admin:
    OBJ_NAME
    Admin
    -----Human Resources
    ----------ALLEN
    -----Accounts
    ----------MARTIN
    ----------SCOTT
    -----CLARK
    -----KING
    -----Research
    ----------SMITH
    ----------BLAKETo avoid this kind of confusion, I would display SYS_CONNECT_BY_PATH (obj_name) rather than obj_name, or I would include all Business Units that were ancestors of Business units that have employees.

  • Need query linking parent and child discrete jobs created through ascp planning

    Could you help me create a query that will show both the parent and child discrete jobs created through ascp run? I do not need entire query. I need to know the names of tables and understand the links or joins between tables. Then, I shall be able to write the sql on my own.
    Thanks

    Just use a format like this:
    http://<Server Name>:<port Number>/OpenDocument/opendoc/openDocument.jsp?sDocName=reportB&sType=wid&sRefresh=Y
    &lsMObjectName=[test1],[test2]
    Here in lsM[ObjectName] parameter [ObjectName] = the object name which you want to send data to ReportB
    I can give you a idea of creating hyperlink for jumping another report (Here ReportB)
    Just use  a formula like that in any cell:
    ="<a href=http://<Server Name>:<port Number>/OpenDocument/opendoc/openDocument.jsp?sDocName=reportB&sType=wid&sRefresh=Y&lsMObjectName=[test1],[test2]&sWIndow=New> Click here to view </a>
    Now from the property select Read cell content as "Hyperlink"...
    thats it......
    For more information please see the
    "OpenDocument" artile
    Hope you can  get help from this
    Edited by: Arif Arifuzzaman on Aug 20, 2009 7:24 AM

  • Query to delete both parent and child record....

    hai.........
    I tried to delete a record from the table.... but i get a error saying 'child record' exist cannot delete record'.... can u plz tell me the query to delete both parent and child record....
    plz help me.....
    anoo...

    Hello,
    Is already answered in {thread:id=824593}. Please mark the question as answered.
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.logica.com/

  • Need query to link parent and child discrete job planned through ascp

    Could you help me create a query that will show both the parent and child discrete jobs created through ascp run? I do not need entire query. I need to know the names of tables and understand the links or joins between tables. Then, I shall be able to write the sql on my own.
    Thanks

    Hi;
    Please check below thread which could be helpful for your issue:
    http://forums.oracle.com/forums/thread.jspa?messageID=9155702
    Regard
    Helios

  • "CONNECT BY"-like query using XPath

    Greetings!
    The problem is as follows:
    I have a XML document whose main part contains a set of many subelements names "rasterFile". Each of this elements has an attribute "rasterRefId" which refers to another rasterFile element (to its id attribute). These references form a tree-like structure of parent and child rasters.
    What we need is to be able to effectively extract a subset of this structure, e.g. for rasterFile with id="4" we need to get this element, its referenced elements, and the elements referenced by the previously referenced elements (but we may request event four or five levels).
    Using a relation database, we should use the CONNECT BY statement, but the document is stored in a XMLType table containing only one row (we use only one large document). So I need to do this sort of query in XPath. How? Or is there any other way to do that?
    Thanks in advance.
    Petr
    The sample document (shortened, the original has about ten thousand rasterFile elements):
    <ber:backdropData xmlns:ber="http://www.berit.com/ber">
    <ber:name>bdemx</ber:name>
    <ber:description/>
    <ber:backdropLayer backdropRefId="bt_5002826" structure="hierarchical"
    format="jpeg">
    <ber:rasterFile id="ti_bt_5002826_jpeg_0_0x0" name="0-0x0.jpeg" decreaseRatio="2">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>1.2996519899999999 1.2996519899999999</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_1_1x1" name="1-1x1.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_0_0x0">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.6498259949999999 0.6498259949999999</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_1_1x0" name="1-1x0.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_0_0x0">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.6498259949999999 0.6498259949999999</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_1_0x1" name="1-0x1.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_0_0x0">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.6498259949999999 0.6498259949999999</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_1_0x0" name="1-0x0.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_0_0x0">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.6498259949999999 0.6498259949999999</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_3x3" name="2-3x3.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_1x1">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_3x2" name="2-3x2.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_1x1">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_3x1" name="2-3x1.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_1x0">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_2x3" name="2-2x3.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_1x1">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_2x2" name="2-2x2.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_1x1">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_2x1" name="2-2x1.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_1x0">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    <ber:shear>0.0 0.0</ber:shear>
    <ber:translate>633142.205995 239189.641789</ber:translate>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_1x3" name="2-1x3.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_0x1">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_1x2" name="2-1x2.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_0x1">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_1x1" name="2-1x1.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_0x0">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_1x0" name="2-1x0.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_0x0">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_0x3" name="2-0x3.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_0x1">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_0x2" name="2-0x2.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_0x1">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_0x1" name="2-0x1.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_0x0">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    <ber:rasterFile id="ti_bt_5002826_jpeg_2_0x0" name="2-0x0.jpeg" decreaseRatio="2" rasterRefId="ti_bt_5002826_jpeg_1_0x0">
    <ber:size>1000 1000</ber:size>
    <ber:trMatrixCoord>
    <ber:scale>0.32491299749999997 0.32491299749999997</ber:scale>
    </ber:trMatrixCoord>
    </ber:rasterFile>
    </ber:backdropLayer>
    </ber:backdropData>

    Thanks for reply.
    Well, the view doesn't seem to help me. We have only one xml document stored and therefore there is only one row in the XMLType table. Using the "SELECT extract()" statement returns one row containing whole result (in CLOB or whatever) and the view has the same problem.
    What would solve this problem is the query for a collection of elements that would return each resulting element in a single row. But I haven't been able to find out how to do such a thing.
    Petr

  • ...where like ('% query returning mul rows %') - how?

    Hi
    I have a situation where in my main query's where clause I have to use like ('% <value returned from query2>%'). However, my query2 can return multiple rows.
    It is something like this:
    Select .....
    from table1 t1
    where path like ('%<query2>%').
    Path can have multiple values - it is just representing a parent child relationship like 1/2/3. 1 is a parent of 2. 2 is a parnt of 3 and so on. What I get from query2 could be either of these. So I have to use like and not in. How may I achieve this?

    select lvl,
           Path
      from (select distinct level as lvl,
                   sys_connect_by_path(parent,'/') Path
              from table1 t1
            connect by prior child = parent)
    where instr(path,((select parent                                                                   --+
                          from (select parent, sm, rank() over (order by sm desc) r                       |
                                  from (SELECT parent, SUM(CT1) as sm                                     |
                                          FROM ((select parent,count(child) ct1                           |
                                                   from table1 t1                                         |
                                                  where group by parent                                   |
                                        -- end level 1)                                                   |
                                        UNION ALL                                                         |
                                        (select parent, count(child) ct2                                  | try to move this sub-query
                                           from table1 t1                                                 | at the FROM clause
                                          where child in --first level                                    |
                                                (select parent                                            |
                                                   from (select distinct parent,count(child) ct1          |
                                                           from table1 t1                                 |
                                                          where group by parent) q1)-- end level 1        |
                                                 group by parent))--MAIN SEL                              |
                         GROUP BY parent))                                                                |
                        where r =1))) > 0--end instr                                                    --+
       and lvl = 1
    you may try to move sub-queries in your WHERE clause to the FROM clause.
    Message was edited by:
    Warren Tolentino
    justin has the same idea :D

  • Check for same parent and child combination

    hi all i am using oracle 10g. can you please help me in this issue.
    how do i know if the same combination of parent and child present in the table
    key value and value are the values given by user.
    if the user try to create a same profile with same set of key_value and value then that should be avoided
    so how to achieve that.
    example profile already in the table
    -- PROFILE_ID,DETAIL_ID,PARENT_DETAIL_ID,KEY_VALUE, VALUE, LAST_IND
    100,               1,               NULL,                      1,              CDE,     N
    100,               2,              1,                            2,              XXX,     N
    100,               3,              1,                            2,              YYY,    N
    100,               4,              1,                            4,              NEW,    Ynew profile by user -- it should throw an error saying that same profile already present
    -- PROFILE_ID,DETAIL_ID,PARENT_DETAIL_ID,KEY_VALUE,VALUE,LAST_IND
    101,               5,               NULL,                      1,              CDE,    N
    101,               6,              5,                            2,              XXX,    N
    101,               7,              5,                            2,              YYY,    N
    101,               8,              5,                            4,              NEW,    YEdited by: DeepakDevarapalli on Dec 9, 2009 9:48 AM
    Edited by: DeepakDevarapalli on Dec 9, 2009 9:59 AM

    sir i have used your logic, each query works fine and displays the correct results below are the results.
    SELECT   SUBSTR (t.ptxt, 2, LENGTH (ptxt)) profile_values
        FROM (SELECT     SYS_CONNECT_BY_PATH (rtxt, ',') AS ptxt
                    FROM (SELECT key_value || '/' || VALUE AS rtxt,
                                 ROW_NUMBER () OVER (PARTITION BY profile_id ORDER BY key_value,
                                  VALUE) AS rnum
                            FROM sp_profile_detail
                           WHERE profile_id IN (100, 101))
                   WHERE CONNECT_BY_ISLEAF = 1
              START WITH rnum = 1
              CONNECT BY rnum = PRIOR rnum + 1) t
    GROUP BY ptxtresults from query 1
    profile_values
    1/CDE,2/XXX,2/YYY,4/111
    1/CDE,2/XXX,2/YYY,4/222
    SELECT   SUBSTR (s.ptxt, 2, LENGTH (ptxt)) profile_values
        FROM (SELECT     SYS_CONNECT_BY_PATH (rtxt, ',') AS ptxt
                    FROM (SELECT key_value || '/' || VALUE AS rtxt,
                                 ROW_NUMBER () OVER (ORDER BY key_value,
                                  VALUE) AS rnum
                            FROM sp_profile_detail1)
                   WHERE CONNECT_BY_ISLEAF = 1
              START WITH rnum = 1
              CONNECT BY rnum = PRIOR rnum + 1) s
    GROUP BY ptxtresults from query 2
    profile_values
    1/CDE,2/XXX,2/YYY,4/111
    but when i tried to combine both and do a minus it throws me an error .
    ORA-00600: internal error code, arguments: [expcmo_strdef1], [27], [27], [], [], [], [], []
    -- target
    SELECT   SUBSTR (t.ptxt, 2, LENGTH (ptxt)) profile_values
        FROM (SELECT     SYS_CONNECT_BY_PATH (rtxt, ',') AS ptxt
                    FROM (SELECT key_value || '/' || VALUE AS rtxt,
                                 ROW_NUMBER () OVER (PARTITION BY profile_id ORDER BY key_value,
                                  VALUE) AS rnum
                            FROM sp_profile_detail
                           WHERE profile_id IN (100, 101))
                   WHERE CONNECT_BY_ISLEAF = 1
              START WITH rnum = 1
              CONNECT BY rnum = PRIOR rnum + 1) t
    GROUP BY ptxt
    MINUS
    -- staging
    SELECT   SUBSTR (s.ptxt, 2, LENGTH (ptxt)) profile_values
        FROM (SELECT     SYS_CONNECT_BY_PATH (rtxt, ',') AS ptxt
                    FROM (SELECT key_value || '/' || VALUE AS rtxt,
                                 ROW_NUMBER () OVER (ORDER BY key_value,
                                  VALUE) AS rnum
                            FROM sp_profile_detail1)
                   WHERE CONNECT_BY_ISLEAF = 1
              START WITH rnum = 1
              CONNECT BY rnum = PRIOR rnum + 1) s
    GROUP BY ptxt

  • Re: Procurement of Parent item & Child item

    Dear Friends,
    I have a scenario, for Parent item & child item
    client is procuring a parent  material as Set, this comprises of child materials
    we have maintained material codes for Parent material and Child material
    For ex:
         Parent Material : XYZ
    Child MateriaL 1    : X
    Child MateriaL 2    : Y
    Child MateriaL 3    : Z
    maintained MAP in parent material as well as child material as below
    Child MateriaL 1    : X   100 Rs
    Child MateriaL 2    : Y   150 Rs
    Child MateriaL 3    : Z    200 Rs
    Total                              450
    Parent Material : XYZ = 450 ( the total of child materials is equal to Parent material)
    here is my query
    I raise PO for main material and GRN will done for material, and deplete the stock of main material through 201 and update the child materil through 202 mov type. so that stock will update accordingly
    but  when i Procures for main material for market price 600 Rs, it has to distribute apportionately to the child components but here the child material value updates based on the Old map but not updated MAP,
    Please guide how can i achieve this functionality in MM
    thanks in advance

    Hi,
    In your case of doing 201 to deplete the parent material and then doing the 202 to increase the stock of child materials, there is no linking between the two. So there will not be any change in the MAP of child material. It will always take the MAP while increasing the stock.
    The business requirement need come redefining. Do your client buy the Parent material as a set and dismantle it to individual child items?
    If that is the case, the best method to achieve this is through a production BOM. You have to create a BOM and routing and create a production order with negative qty for child items and once you confirm this order, the parent item will be consumed and child item will be increased in stock.
    Search the forum for more details about this.

  • How to link parent and child relation in Metapedia

    How to link parent and child relation in Metapedia

    Vamsi,
    Did you every determine how to do what you were asking about? Where you thinking of how to link a parent term to a child term (i.e. like a related term) or was this about linking a term to a different metadata object (e.g. table or report) ?

  • Session expiration issue with parent and child window

    Hi,
    We have two applications (App1 - Implemented using JSF, Spring and Hibernate and App2 -Implemented using Spring MVC, Spring JDBC).
    I have implemented 'Test Access Content' functionality in App1.
    First admin user (Role- Manager) needs to login to App1
    As part of 'Test Access Content' functionality, he enters URL with encrypted key and click 'Test Access' button.
    It opens new window (implemented using java script - window.open) and hits spring controller of App2.
    In spring controller of App2, I am decrypting the key to get user details. After that i am setting user details in session, constructing final URL to display actual content.
    Problem is parent window maintains session till child window renders response. Once child window renders response, parent window loosing session.
    So, if i click any button in parent window after child window renders response, it displays login page as there is no session for parent window.
    Please note that App1 and App2 are sharing same domain. only context paths are different for both apps (app1 and app2).
    Any suggestions on this issue are much appreciated. Please let us know if you have any questions.

    Hi,
    When you open a child window from parent window then you can access child data in the parent window through javascript.
    We have a main web page. There are quite many links on it from which >user can open new web pages but the data is saved when the submit >button on the main page is clicked. Also data that user entered on the >other sub pages is not displayed in the main window.
    1 is this a case of parent and child window.case 1 When you are submitting the main page you need to run javascript function and get data from child windows and save that to database or session. next time when you are displaying the main window you need to query session or database to display the child window data in the main window.
    Case 2> closing child window and you need data in the parent. This can be done in two ways.
    1> When you are closing the child window populate some variables of the main window using javasript.
    2> Save the values in the database or session and refresh the main window and extract data from database or session
    Where should the data be saved that user enetered on the sub pages as the data is not shown in the main page - should it be stored in the session?It is design decision. You can store data in either session or database when you are closing the child window. But ifyou are saving the data on the main page then you can populate main page with child windows data using javascript. Save the data t database when main window data is saved. Depends on business requirements.
    In short if you are saving child windows data in session or database then you need to refresh main screen to pull that data otherwise populate main screen using javascript.
    I hope i answered your questions :) best of luck

  • Programmatic, using bean add Parent and child nodes in af:tree dynamically

    Hi All,
    i have to add parent and child nodes dynamically in tree .
    Example :
    i have created a tree like below.On click of button i will get value A ,from pl/sql function i will A1 and A 2 values.which i have to show in pop as tree.
    A
    |-----A1
    |-----A2
    If user clicks on A2.I have to catch A2 value and pass to pl/sql function which gives A2.01 and A2.02 values.
    A
    |-----A1
    |-----A2
    |------A2.01
    |------A2.02.
    A, A1 ,A2,A2.01 ...........values comes from pl/sql funchtion .
    thanks in advance ......... any suggestion will greatly helps

    no use ......................

  • How to differentiate between Parent and Child in IBASE?

    Hi. I am working on enhancing a BAPI :BAPI_GOODSMVT_CREATE by calling the following function module IBPP_CREATE_IBASE at its exit.
    The BAPI is being called from an SAP ME system and will be passing MATNR and Serial Number of Parent and Child materials to create the IBASE in ECC system. I am confused as to how to differentiate between whether a object is Parent or a Child when the BAPI: BAPI_GOODSMVT_CREATE is called.

    if you have NULL valued fields. If
    you do a compare and one or both are NULL, then the result is always NULL,
    never true or false. Even comparing two fields which are both NULL will
    give NULL as result, not true! Or if you have something like "select
    sum(field) from ..." and one or more are NULL, then the result will be
    NULL. Use always "if field is NULL ..." for NULL checking and for safety
    maybe something like "select sum( IsNull(field,0) ) from ...". Check the
    function ISNULL() in the manual.

  • Create Individual Idocs Based on Parent and Child Segment type

    Hi Experts,
    I have a scenario IDOC to FILE ,  Split Single IDOC into Multiple IDOC's based on parent and child Segment Type
    For example If 3 child segments are same and 1 segment is different under parent segment then 3 same child segments are clubbed and create single idoc under parent segments and 1 different child should create in individual idoc under parent segment.
    Note : Same logic should work for N number of Parent Segments and Child Segments.
    Outbound:
    ZIdocName
    Control Record
    Data Record
    Parent Segment A
       Child Segment 1
       Child Segment 1
       Child Segment 1
       Child Segment 2
    Parent segment  B
       Child Segment 3
    Status Record
    I should get output like below
    Inbound:
    ZIdocName
    Control Record
    Data Record
    Parent segment A
      Child Segment 1
      Child Segment 1
      Child Segment 1
    Status Record
    ZIdocName
    Control Record
    Data Record
    Parent segment A
      Child Segment 2
    Status Record
    ZIdocName
    Control Record
    Data Record
    Parent Segment B
      Child Segment 3
    Status Record
    Please suggest me step by step process to achieve this task.
    Thanks.
    Ram

    Hello,
    Segment won't hold any value, so filter criteria should be there on some field wich exist in Parent node and chile node?
    Paste ur XML?
    Try this(Assuming u have some fields in parent/child segment on which u want to define filter criteria):
    Parent Field--UseOneAsMany----RC----
                                      ------------------Concat ----splitbyvalue(value change)--collapse context --- ZIdoc
    Child field-- RC----------
    Child field--RC--splitbyvalue(valuechange)--CC -Splitbyvalue(each value) -- ParentSegment
    Child field--RC--splitbyvalue(valuechange)--- ChildSegment
    RC -> Remove Context
    CC - Collapse Context
    Note - i haven't tested ur mapping, so make sure to adjust context in mapping
    Thanks
    Amit Srivastava
    Message was edited by: Amit Srivastava

  • Line graph parent table child

    i have a page where i have a line graph as parent and a table as its child. i want to have a master detail relationship through a view link of cardinality 1 to many.
    when user selects appropriate points of line graph, the child table should refresh accordingly.
    child table shows only children of firts record of line graph.
    is there a problem with line graph being a parent. i could find examples which used bar / pie graph but not line graph. although i had checked the checkbox while creating graph.
    i am using bind variables for both parent and child VO.
    do i need to execute child VO query again to be able to display corresponding children for a parent on a line graph.
    jdev 11 1 1 5

    Hi,
    when you create a line graph by dragging a collection (View Object) from the Data Controls panel to the page then, in the second dialog of the wizard, there is a check box "Set current row for master-detail". Check this check box and then create the table from the dependent view object. No bind variables required
    Frank

Maybe you are looking for

  • How to de-activate Qty and Price fields for Service purchase requisition

    Dear all, We have a request to de-activate (leave it as "Display") the fields of quantity and gross price when changing a service purchase requisition of a specific document type. In example: We want that purchase requisition type NB, allows in chang

  • Problems after upgrading to IO6

    Have the new ipad and tried to upgrade iphoto app and message was to check for software upgrade. Checked and i0S6 had to be downloaded. Did that and now have Siri on ipad. After one day Siri ceased to work as well as anything using the microphone. I

  • Priority to sales order over reservation

    Hi All, I have a query. I created a manual reservation for materail Say A to move it from storage loc 1000 to 2000 of 2 Ea. Storage loc 2000 is plaaned separately. We dont have a stock in storage location 1000 now so we cant move stock against reserv

  • File-IDoc scnario : Error in call adapter

    Hi Experts, I have developed File to IDoc scenario. And getting the following error in "Call Adapter" pipeline step. I have mapped the control record values in IDoc like Sender Partner, no, port and same for receiver. Have created: In XI: RFC destina

  • UITableViewController initWithStyle tableView is nil afterwards?

    Hi, I had a problem with the UITableViewController when initialized using the initWithStyle - Method. I derived my own UITableViewController from the standard version: *@interface PrefTableViewController : UITableViewController* I've overwritten the