Parent-Child in XML Publisher

Hi,
I am working on a report which requires a parent child relationship.
There are two tables STG1 and STG2
STG1 STG2
30012 1
2
30040 1
For each value in STG1 there might be more than one value in STG2.
After printing the 1st valuesin STG1(30012), the report should print 1 & 2 in STG2(for 30012) and then should go to STG1 (30040) and then print the value 1(for 30040) under it.
Instead after printing 1st values in STG1(30012). the report is printing all the values in STG2 and then going to 30040 and it is not pringint the 1 for 30040.
Could some one help , how to resolve the issue.
Thanks and Regards,
BALU

Can you show the XML from the data source?
I am missing something in what you wrote:
There are two tables STG1 and STG2
STG1 STG2
30012 1
2
30040 1

Similar Messages

  • XML parent child records

    Hello
    I am trying to mimic the FOR XML EXPLICIT behavior of SQL Server code in Oracle 11g.
    The XML EXPILICT mode transforms the rowset that results from the query execution into an XML document and it preserves the parent child relationship in the XML output. For example
    SELECT customer.id,customer.name,order.id,order.date,orderdetail.id,orderdetail.pid
    FROM CUSTOMER,ORDER,ORDERDETAIL
    WHERE CUSTOMER.ORDERID=ORDER.ORDERID
    AND
    ORDER.ORDERID=ORDERDETAIL.ORDERID
    <Customer ID="C1" name="Ann">
    <Order id="O1" date="1/20/2008">
    <OrderDetail id="OD1" pid="P1"/>
    <OrderDetail id="OD2" pid="P2"/>
    </Order>
    <Order id="O2" date="3/29/1997">
    </Customer>
    <Customer ID="C2" name="Jack">
    <Order id="O1" date="1/20/2009">
    <OrderDetail id="OF1" pid="P1"/>
    <OrderDetail id="OF2" pid="P2"/>
    </Order>
    <Order id="O2" date="3/29/1997">
    <OrderDetail id="OX1" pid="D1"/>
    <OrderDetail id="OX2" pid="D2"/>
    </Order>
    </Customer>
    Appreciate if you can help me to write an Oracle equivalent of this code.
    Thanks & Regards

    You can use xmlelement and xmlagg functions this way:
    SQL> with customer as (
      2  select 'C1' id, 'Ann' name from dual union
      3  select 'C2' id, 'Jack' name from dual),
      4  Orders as (
      5  Select 'O1' id, '1/20/2008' odate, 'C1' custid from dual union
      6  Select 'O2' id, '3/29/1997' odate, 'C1' custid from dual union
      7  Select 'O3' id, '1/20/2008' odate, 'C2' custid from dual union
      8  Select 'O4' id, '3/29/1997' odate, 'C2' custid from dual),
      9  orderdetail as (
    10  select 'OD1' id, 'P1' pid, 'O1' orderid from dual union
    11  select 'OD2' id, 'P2' pid, 'O1' orderid from dual union
    12  select 'OF1' id, 'P1' pid, 'O3' orderid from dual union
    13  select 'OF2' id, 'P2' pid, 'O3' orderid from dual union
    14  select 'OX1' id, 'D1' pid, 'O4' orderid from dual union
    15  select 'OX2' id, 'D2' pid, 'O4' orderid from dual
    16  )
    17  -- End of test data, actual query follows
    18  SELECT xmlagg(
    19           xmlelement("Customer",
    20                      xmlattributes(id, name),
    21                      (select xmlagg(
    22                                xmlelement("Order",
    23                                           xmlattributes(o.id, o.odate as "date"),
    24                                           (select xmlagg(
    25                                                     xmlelement("OrderDetail",
    26                                                                xmlattributes(id,pid),
    27                                                                null
    28                                                                )
    29                                                          )
    30                                              from orderdetail d
    31                                             where d.orderid = o.id
    32                                            )
    33                                           )
    34                                     )
    35                         from orders o
    36                        where CUSTOMER.ID=O.CUSTID
    37                       )
    38                      )
    39                 ).extract('/*') xml
    40    from customer;
    XML
    <Customer ID="C1" NAME="Ann">
      <Order ID="O1" date="1/20/2008">
        <OrderDetail ID="OD1" PID="P1"/>
        <OrderDetail ID="OD2" PID="P2"/>
      </Order>
      <Order ID="O2" date="3/29/1997"/>
    </Customer>
    <Customer ID="C2" NAME="Jack">
      <Order ID="O3" date="1/20/2008">
        <OrderDetail ID="OF1" PID="P1"/>
        <OrderDetail ID="OF2" PID="P2"/>
      </Order>
      <Order ID="O4" date="3/29/1997">
        <OrderDetail ID="OX1" PID="D1"/>
        <OrderDetail ID="OX2" PID="D2"/>
      </Order>
    </Customer>Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/02/07/aggiornare-una-tabella-con-listruzione-merge/]

  • Siebel BI Publisher Reports - Parent Child Combine

    Hi,
    As per my clients requirement, I need to develop reports in BI Publsiher which are similar to Combined Datastream Reports in Actuate. Its like I need to combine the Parent and Child records into a single record set and show the output. The siebel bookshelf 8.1 has not given any information about this. Is there anyway I can achieve this kind of reports ?
    Thanks in advance,
    Jagdish

    So your XML has the parent-child right?
    <ListOf_ssServiceRequest>
         <ssServiceRequest>
              <ssAccount>Geltzer Contract Furniture</ssAccount>
              <ssClosedDate/>
              <ssCustomerRefNumber>wdxwdxws</ssCustomerRefNumber>
              <ssDescription/>
              <ssOwner>BMASON</ssOwner>
              <ssPriority>Low</ssPriority>
              <ssSrNumber>1-2Z0T</ssSrNumber>
              <ssSeverity>Low</ssSeverity>
              <ssStatus>Open</ssStatus>
              <ssId>1-2Z0T</ssId>
              <ssCreated>08/06/1999 07:25:56</ssCreated>
              <ssUpdated>05/28/2004 05:02:58</ssUpdated>
              <ssCreatedBy>0-1</ssCreatedBy>
              <ssUpdatedBy>1-1ZW</ssUpdatedBy>
              <ListOf_ssAction>
                   <ssAction>
                        <ssComment/>
                        <ssContactFirstName>David</ssContactFirstName>
                        <ssContactLastName>Geltzer</ssContactLastName>
                        <ssCreatedByName>HTADMIN</ssCreatedByName>
                        <ssDescription>Call customer for post-service satisfaction and confirmation of sucessful resolution</ssDescription>
                        <ssDone/>
                        <ssOwnedBy>DCOLLINS</ssOwnedBy>
                        <ssPrivate>N</ssPrivate>
                        <ssStarted/>
                        <ssStatus>Not Started</ssStatus>
                        <ssType>Call - Outbound</ssType>
                        <ssId>3SIA-2RNIE</ssId>
                        <ssCreated>03/15/2005 09:08:55</ssCreated>
                        <ssUpdated>03/15/2005 09:08:55</ssUpdated>
                        <ssCreatedBy>3SIA-2LX2K</ssCreatedBy>
                        <ssUpdatedBy>3SIA-2LX2K</ssUpdatedBy>
                   </ssAction>
                   <ssAction>
                        <ssComment/>
                        <ssContactFirstName>David</ssContactFirstName>
                        <ssContactLastName>Geltzer</ssContactLastName>
                        <ssCreatedByName>HTADMIN</ssCreatedByName>
                        <ssDescription>Repair the equipment with the new parts</ssDescription>
                        <ssDone/>
                        <ssOwnedBy>HTADMIN</ssOwnedBy>
                        <ssPrivate>N</ssPrivate>
                        <ssStarted/>
                        <ssStatus>Unscheduled</ssStatus>
                        <ssType>Field Repair</ssType>
                        <ssId>3SIA-2RNI9</ssId>
                        <ssCreated>03/15/2005 09:08:55</ssCreated>
                        <ssUpdated>04/26/2005 09:49:20</ssUpdated>
                        <ssCreatedBy>3SIA-2LX2K</ssCreatedBy>
                        <ssUpdatedBy>3SIA-2LX2K</ssUpdatedBy>
                   </ssAction>
              </ListOf_ssAction>
         </ssServiceRequest>
    </ListOf_ssServiceRequest>
    So you can create a template to follow the tree
    <?for-each:ssServiceRequest?>
    Account: <?ssAccount?>
    <?for-each:ssAction?>
    Name: <?ssContactFirstName?> <?ssContactLastName?>
    <?end for-each?>
    <?end for-each?>
    Hope this helps
    regards
    Tim

  • XML Publisher --Data Template-Help

    Hi
    we are using XML Publisher attached to R12 , we are using data template ( .XML file) in data definition .
    we have a requirement for master details report. for that we have parent query and child query .the data coming to parent query should be the parameter to child query
    Exp-- Parent Query-- select empno from emp
    Child Query --select  * from dept where empno=:p_empno (p_empno =empno from Parent query ) 
    For this requirement we are creating a data template (.XML file) . we are successfully to write for the parent query, but we fails when come to child query. Please help us how it can be wrote in data template . You can send any example related to this issue.

    This forum is noway related to XML Publisher. I had redirected you to the actual BI Publisher already once. You should post it there.

  • PeopleSoft Connected Query in XML Publisher Report - Error

    Hello - I'm getting this weird error when trying to run an XML Publisher report off a PeopleSoft Connected Query. The Connected Query runs fine to an XML File. Any ideas? The parent/child queries in the connected query don't use any prompts.
    PCodeWTL(1/3): Prompt Field Name is invalid because it exceeds the maximum allowed size of %1 (50,493)

    We encounter the same problem. Did you get the answer for this issue? Thanks in advance.

  • Defining Report LayOut for a parent child report

    I have a parent child report. I want to print this report in PDF using BI Publisher. Now I wanted to define a layout for that report using BI template builder. My stratagey for defining Report layuout is
    1. Write a query containing all fields that I need
    2. Convert that query data to XML, one way or the other
    3. Load that XML into template builder.
    4. Define the layout.
    Now the problem is that I need some fields for parent and some from child. If I do not use group buy clause in the query I will not be able to use the tabular format in template builder (taht I wanted to use).
    IF I use a group By caluse then I am unable to select the child fields as they are not the part of group by clause.
    Plz help

    You have 2 repeating frames: R_contracts and R_ads. Create a frame M_disclaimer after R_ads, within R_contracts to hold the disclaimer page. This page will print after all the ad records have been printed, and before the new contract starts.
    You can set Page Break Before on M_disclaimer to print this frame on a new page.

  • XML Publisher Report Bursting Program Randomly failing

    Hi,
    In our environment "XML Publisher Report Bursting Program" fails randomly and failures are very very few and random, and can not be reproduced.
    The error message is
    +++++++++++++++++++++++++++++++++++++++++++
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    XDOBURSTREP module: XML Publisher Report Bursting Program
    Current system time is 16-APR-2013 14:00:42
    Exception in thread "main" java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:394)
    at oracle.apps.xdo.oa.cp.CPUtil.getSessionProperties(CPUtil.java:42)
    at oracle.apps.xdo.oa.cp.JCP4XDOBurstingEngine.runProgram(JCP4XDOBurstingEngine.java:84)
    at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    oracle.apps.xdo.oa.cp.JCP4XDOBurstingEngine
    Program exited with status 1
    Executing request completion options...
    ++++++++++++++++++++++++++++++++++++++++++++++
    Had been trying to find out any pattern, but no fix time or particular parent request.
    Only common point in failure with above error are below columns in fnd_concurrent_request
    Description - blank
    LFILE_SIZE - 1476
    & interim_status_code - Blank
    Any suggestions will be helpful

    Hi;
    Similar issue mention at below notes, Please review:
    NPE Error While Bursting Using XDOBURSTREP in EBS R12 [ID 754790.1]
    Bursting Engine Ends With Java.Lang.Nullpointerexception[Article ID 559443.1]
    XDOBURSTREP - XML Publisher Report Bursting Program Fails with InvalidPropertyValueException[Article ID 603424.1]
    If its not help I suggest rise SR
    Regard
    Helios

  • Query Help with Parent, Child, Child's Child

    Hi all,
    Need some help with a query.  I'm trying to create a stored procedure that is sort of like a Customer, Order, Order, Details.  In my situation the tables are different but nevertheless, I want to grab all the fields from the  Parent, Child,
    and Childs' Child, where the Parent.ParentID = @Parameter.  I tried this:
    CREATE PROCEDURE [dbo].[spGetCompleteProjectXML]
    @ProjectID int = 0
    AS
    SELECT *,
    (SELECT *,
    (SELECT *
    FROM PageControls
    WHERE (PageControls.ProjectPageID = ProjectPages.ProjectPageID))
    FROM ProjectPages
    WHERE (ProjectPages.ProjectID = @ProjectID))
    FROM Projects
    WHERE (ProjectID = @ProjectID)
    FOR XML AUTO, ELEMENTS
    RETURN 0
    I think I'm close, but it was my best effort.  Could someone help?
    thanks in advance

    Hi TPolo,
    Regarding your description, are you looking for a sample like below?
    CREATE TABLE customer(customerID INT, name VARCHAR(99))
    INSERT INTO customer VALUES(1,'Eric')
    INSERT INTO customer VALUES(2,'Nelson')
    CREATE TABLE orders(orderID INT,customerID INT)
    INSERT INTO orders VALUES(1,1);
    INSERT INTO orders VALUES(2,1)
    INSERT INTO orders VALUES(3,2)
    INSERT INTO orders VALUES(4,2)
    CREATE TABLE orderDetails(orderID INT,item VARCHAR(99))
    INSERT INTO orderDetails VALUES(1,'APPLE1')
    INSERT INTO orderDetails VALUES(1,'BANANA1')
    INSERT INTO orderDetails VALUES(2,'APPLE2')
    INSERT INTO orderDetails VALUES(2,'BANANA2')
    INSERT INTO orderDetails VALUES(3,'APPLE3')
    INSERT INTO orderDetails VALUES(3,'BANANA3')
    INSERT INTO orderDetails VALUES(4,'APPLE4')
    INSERT INTO orderDetails VALUES(4,'BANANA5')
    SELECT customer.customerID,customer.name,
    (SELECT orderId,
    SELECT item FROM orderDetails WHERE orderID=orders.orderID FOR XML AUTO,TYPE,ELEMENTS
    FROM orders Where customerID=customer.customerID FOR XML AUTO,TYPE,ELEMENTS)
    FROM customer WHERE customerID=1
    FOR XML AUTO,ELEMENTS
    DROP TABLE customer,orderDetails,orders
    If you have any feedback on our support, please click
    here.
    Eric Zhang
    TechNet Community Support

  • Problem with XML Publisher report when there are no detail records.

    I am working on an Oracle XML Publisher procurement report (Oracle E-Business Suite R12) that starts with a budget amount that is imported from our financial system, then lists all requisitions and orders that are in process (not approved). The amounts of all those unapproved requisitions/orders are totaled using a Sum form field, to be followed by a field where the unapproved requisition/order total is subtracted from the budget amount (amount available). I am running into a problem when there are no unapproved requisitions. When I run the report for such instances, it completes with a warning -- here is what it states in the OPP log:
    oracle.xdo.parser.v2.XPathException: Extension function error: Method not found 'sum'
    I have altered my sum field on the RTF template to include an if statement in case of a null value...
    <?sum (EXTENDED_COST)?> <?xdofx:if sum (EXTENDED_COST) = " then 0 end if?>
    ...but this does not work.

    Hi,
    You are on right track. Simply put summary field in header group and remember to set reset at property to Header Group Not Child and now you can use this field in format trigger.
    Format trigger must be written on header frame.
    Cheers !
    Adinath Kamode

  • EBS: Email XML publisher output, from After Report Trigger in Data Template

    Here is what I'm trying to do:
    -- In EBS (11.5.10 CU2), I'm using XML publisher (5.6.2) data template and layout template to generate Output files (PDF, EXCEL etc)
    --In the Data Template's AfterReport Trigger, I'm using the Concurrent Request Id to locate the Output file name and trying to Email that output file.
    Problem:
    -- When the AfterReport trigger code is executed, the code is NOT seeing the output file and hence the file is NOT emailed.
    Observations/Questions:
    -- From what I observe, the Output Post Processor ( that generates the Excel / PDF files) is running AFTER the code in AfterReport trigger... and hence the AfterReport trigger is Not quite seeing / able to access the output file.
    So, the sequence of execution seems to be:
    -- Before Report Trigger
    -- Data Query (SQL statement)
    -- After Report Trigger
    -- Output Post Processor
    Because the AfterReport Trigger is running before the Output Post Processor, it is Not able to see the output file. Is that a True statement?
    If Yes, how else can the DataTemplate access the Output file?
    If No, what could cause the AfterReport trigger to not see the output file?

    Because the AfterReport Trigger is running before the Output Post Processor, it is Not able to see the output file. Is that a True statement?
    I believe so, as the OPP works on the output of the Report after the Report has completed execution.
    You could use the same approach as we do for bursting the report to different users. Write a Java Concurrent program based on "oracle.apps.xdo.oa.cp. XMLPReportBurst" with delivery channel Email to send the email output. You would need to add code to launch the Concurrent child request in your AfterReport Trigger:
    function AfterReport return boolean is
    jreq_id number;
    begin
    srw.message (100, 'DEBUG: AfterReport_Trigger +');
    jreq_id:= FND_REQUEST.SUBMIT_REQUEST ('XDO','XDOBURST','','',FALSE,:P_CONC_REQUEST_ID,'Y',chr(0),
    If (jreq_id=0)
    then
    srw.message (100,'Request id is zero');
    end if;

  • Showing the XML publisher report in an iframe..

    Hi all..
    Please help me with this question.
    Before: We had a "http page" and we are showing a XML Publisher report which is also in "http" ,in an iframe of the parent page. Previously it was working fine, as both are http.
    *** Basically we are generating a URL of the report and showing it in a iframe of the web application****
    Now: Recently we configured ssl to the parent page (https), and the report sever is still in "http". Because of this difference, whenever we are calling that report,it is showing a security alert and redirecting to totally wrong page.
    Is there any configurations that i can do in the ""report server" to rectify this issue.Please help me with this issue.
    Thank u

    Hi Ravi ,
    can i do it only with the xml Publisher , because when i tried it in the past and get all the staff like Template / DD / CP up and running and started the CR i get an error from the system that he is missing a report directly in the file system... so he searched for the report himself on system like a standard 6i Report. But the template and the dd is stored in the db. So my question again, can I use the XML Puplisher without a Standard Report or can i use a dummy file only for checking and after that he use my template / dd.
    regards
    Kay

  • How to Merge multiple XML  files in one file ( Env: XML Publisher 5.6.2)

    All,
    I have recently started working on XML publisher and have developed 3 reports in last 2 days using XML Publisher and integrating them with Concurrent programs.
    This is a great tool.
    I have got another requirement, where i need to use xml file generated by multiple run of same report with various parameters and then merge all xml file to a single report. Developing the whole custom process will take very long time and sure will have bugs in it. Instead i was thinking to use xml file generated by Oracle report itself.
    Report "US Gross to net summary" generates xml output in standard output directory and then show output in PDF file. I have 7 such file generated for each payroll. I want to merge output of xml into a single xml so that i can create single report having data from all 7 xml files showing me All payroll output in a single report.
    Can someone please guide me , how can i read xml file data from the output directory of a seeded concurrent program and how to manipulate data in it.
    Thanks
    Ankur

    Hi Tim,
    Thanks for replying. I have looked for "PDFBookBinder class" in xml publisher user guide for ver 5.6.2. I didn't get any reference of this text. Can you please guide me to a tutorial/link where i can get more information about this class.
    Also, i originally thought of similar to your second logic, as my design basis. Oracle process generates the xml file in output directory which i can get. What i didn't get is how do i "pick them up and merge" using publisher. Also, is there way to do this merging process using pl/sql ? Can you please give little more information on your second approach.
    My original plan of action is that i will create a report set in which i will call oracle seeded report for all 7 payrolls in a sequential manner. Then using the child requests of the report set i will get to 7 xml files generated by seeded oracle process. Then the piece i am not sure of , i will use those 7 files to generate a single xml file having payroll name as tree top for each output. Once single xml is ready, i can easily design a template and register the process to generate output as Excel.This process will not require me to actually change any data or do any calculation. It will only reformatting the feilds we see and abiity to see all 7 payroll at one time rather then entering these numbers manually into an excel to do analysis.
    Please provide your feedback, if you think above plan is not feasible or need corrections.
    Best Regards,
    Ankur

  • Parent-Child Unbound Transformation from Linear Structure

    Hi ,
    We need to convert the linear people structure into Parent-Child relation with unbounded depth using XQuery. To give in detail, we have the XML schema as
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/ParentChild" xmlns:tns="http://www.example.org/ParentChild" elementFormDefault="qualified">
    <complexType name="People">
    <sequence>
    <element name="id" type="string" />
    <element name="name" type="string" />
    <element name="age" type="string" />
    <element name="parentId" type="string" minOccurs="0" />
    </sequence>
    </complexType>
    <complexType name="Peoples">
    <sequence>
    <element name="people" type="tns:People" maxOccurs="unbounded"></element>
    </sequence>
    </complexType>
    <element name="Peoples" type="tns:Peoples"></element>
    <element name="People" type="tns:People"></element>
    <complexType name="Parent">
    <sequence>
    <element name="id" type="string" />
    <element name="name" type="string" />
    <element name="age" type="string" />
    <element name="child" type="tns:Parent" minOccurs="0" maxOccurs="unbounded" />
    </sequence>
    </complexType>
    <complexType name="Parents">
    <sequence>
    <element name="Parent" type="tns:Parent" maxOccurs="unbounded" ></element>
    </sequence>
    </complexType>
    <element name="Parents" type="tns:Parents"></element>
    <element name="Parent" type="tns:Parent"></element>
    </schema>
    The input structure can appear as
    <?xml version="1.0"?>
    <ns0:Peoples xmlns:ns0="http://www.example.org/ParentChild">
    <ns0:people>
    <ns0:id>1</ns0:id>
    <ns0:name>x</ns0:name>
    <ns0:age>11</ns0:age>
    <ns0:parentId>2</ns0:parentId>
    </ns0:people>
    <ns0:people>
    <ns0:id>2</ns0:id>
    <ns0:name>y</ns0:name>
    <ns0:age>11</ns0:age>
    <ns0:parentId>3</ns0:parentId>
    </ns0:people>
    <ns0:people>
    <ns0:id>3</ns0:id>
    <ns0:name>z</ns0:name>
    <ns0:age>11</ns0:age>
    </ns0:people>
    <ns0:people>
    <ns0:id>5</ns0:id>
    <ns0:name>a</ns0:name>
    <ns0:age>11</ns0:age>
    </ns0:people>
    </ns0:Peoples>
    The response should be like below
    <?xml version="1.0"?>
    <ns0:Parents xmlns:ns0="http://www.example.org/ParentChild">
    <ns0:Parent>
    <ns0:id>3</ns0:id>
    <ns0:name>z</ns0:name>
    <ns0:age>11</ns0:age>
    <ns0:child>
    <ns0:id>2</ns0:id>
    <ns0:name>y</ns0:name>
    <ns0:age>11</ns0:age>
    <ns0:child>
    <ns0:id>1</ns0:id>
    <ns0:name>x</ns0:name>
    <ns0:age>11</ns0:age>
    </ns0:child>
    </ns0:child>
    </ns0:Parent>
    <ns0:Parent>
    <ns0:id>5</ns0:id>
    <ns0:name>a</ns0:name>
    <ns0:age>11</ns0:age>
    </ns0:Parent>
    </ns0:Parents>
    We tried with below XQuery, but it is not resulting as expected.
    (:: pragma bea:global-element-parameter parameter="$peoples" element="ns0:Peoples" location="ParentChild.xsd" ::)
    (:: pragma bea:global-element-return element="ns0:Parents" location="ParentChild.xsd" ::)
    declare namespace ns0 = "http://www.example.org/ParentChild";
    declare namespace xf = "http://tempuri.org/RecursiveParentChild/ParentChild/";
    declare function xf:ParentChild($peoples as element(ns0:Peoples))
    as element(ns0:Parents) {
    <ns0:Parents>
    let $results := <a>{
         for $people1 in $peoples/ns0:people where (not (exists ($people1/*:parentId)))
         return
         <ns0:Parent>
                                  <ns0:id>{ data($people1/ns0:id) }</ns0:id>
                        <ns0:name>{ data($people1/ns0:name) }</ns0:name>
                        <ns0:age>{ data($people1/ns0:age) }</ns0:age>
                             </ns0:Parent>
                   </a>
                   let $result1 :=
                   for $people1 in $peoples/ns0:people where (exists ($people1/*:parentId))
                   return
                        if (data($people1/ns0:parentId) = data($results/ns0:id)) then
                             <ns0:child>
                                  $people1/*
                             </ns0:child>
                        else()
                   return $result1      
    </ns0:Parents>
    declare variable $peoples as element(ns0:Peoples) external;
    xf:ParentChild($peoples)
    Anyone tried similar kind of XQuery?. THere is a possibility that the child node can appear before the parent node, how we can handle that as well?
    Any help on this is appreciated
    Regards
    Venkata Madhu

    You need a recursive function in this situation :
    declare namespace ns0 = "http://www.example.org/ParentChild";
    declare namespace xf = "http://tempuri.org/RecursiveParentChild/ParentChild/";
    declare variable $peoples as element(ns0:Peoples) external;
    declare function xf:getChildren($p as element(ns0:people)) as element(ns0:child)*
      for $c in $peoples/ns0:people[ns0:parentId=$p/ns0:id]
      return <ns0:child>
            <ns0:id>{ data($p/ns0:id) }</ns0:id>
            <ns0:name>{ data($c/ns0:name) }</ns0:name>
            <ns0:age>{ data($p/ns0:age) }</ns0:age>
            { xf:getChildren($c) }
             </ns0:child>
    <ns0:Parents>
      for $p in $peoples/ns0:people[not(ns0:parentId)]
      return <ns0:Parent>
            <ns0:id>{ data($p/ns0:id) }</ns0:id>
            <ns0:name>{ data($p/ns0:name) }</ns0:name>
            <ns0:age>{ data($p/ns0:age) }</ns0:age>
            { xf:getChildren($p) }
             </ns0:Parent>
    </ns0:Parents>

  • Multi-Org Parent-Child LOV

    Issue Description:
    in Action BC (Table: S_EVT_ACT) we are trying to implement the following organization based parent child picklists/LOVs for Status->Status Reason
    [Status] - Activity Status field (col: EVT_STAT_CD)
    *Picklist: LOV Type = 'EVENT_STATUS', picklist BC: 'List Of Values Dynamic (REL)'
    [LN Status Reason] - customised field/column (Col: X_STATUS_REASON)
    *Picklist: LOV Type = 'LN_MISSED_ACTIVITY_REASON', picklist BC: 'PickList Hierarchical'
    *Pick Map: [LN Status Reason] = [Value], [Status] = [Parent] (Constraint = Y)
    in the Admin-Data LOVs:
    Type = EVENT_STATUS, Display Value/LIC = "Not Achieved", Organization = "Org 1"
    Type = LN_MISSED_ACTIVITY_REASON
    Display Value/LIC = "Reason 1", Parent LIC = "Not Achieved", Organization = "Org 1"
    Display Value/LIC = "Reason 2", Parent LIC = "Not Achieved", Organization = "Org 1"                                                                                          
    On UI, create new record in Account - Activities, selecting Status = "Not Achieved".
    Now when i try to select the Status Reason value, the drop down does not give me any value.
    If I set the Organization to blank on "Reason 1", then the "Reason 1" value shows up in the Status Reason drop down under Account - Activities.
    In SQL of the log file, for the Status Reason drop down, it always hard code a T1.BU_ID is null in the WHERE clause, this would explain why its blank in the dropdown
    Also as a test, If i remove all the pick map constraints for the [LN Status Reason] field (ie the only record in the pick map is [LN Status Reason] = [Value]), then the drop down works correctly (ie displaying both the values with Organization = "Org 1"), and in the SQL of the log file, instead of BU_ID is null, it has BU_ID = ? with variable binding.
    Is there a reason why it would hard code the BU_ID is null in the WHERE clause in the SQL, and how to overcome this to achieve my requirement.
    Just a further update due to character limit of the original description,
    The "Owner Organization Specifier" property on the table S_EVT_ACT is blank (not sure if its related to anything though)
    The user i'm using belongs to "Org 1" for both the employee's Organization and its Position's Organization
    Thanks

    This is exactly what I'm looking for...I just can't make it work. I have 2 tables (database and schema). They are related via a database_id column. My code is below if you are willing to help.
    HTML Header
    <script>
    function get_select_list_xml1(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=CASCADING_SCHEMA',0);
    get.add('P7_DATABASE',pThis.value);
    gReturn = get.get('XML');
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    function appendToSelect(pSelect, pValue, pContent) {
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    </script>
    Application Process
    BEGIN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<select>');
    HTP.prn ('<option value="' || 0 || '">' || '- All Schemas -'
    || '</option>'
    FOR c IN (SELECT schema, schema_id
    FROM (SELECT schema, schema_id, database_id
    FROM schema_lookup
    WHERE database_id = :cascading_selectlist_item_1)
    LOOP
    HTP.prn ('<option value="' || c.schema_id || '">' || c.schema || '</option>');
    END LOOP;
    HTP.prn ('</select>');
    END;
    P7_DATABASE_ID Form Element Attribute
    onchange="get_select_list_xml1(this,'P7_SCHEMA_ID');
    P7_SCHEMA_ID LOV
    select SCHEMA d, SCHEMA_ID v from SCHEMA_LOOKUP
    where DATABASE_ID = :P7_DATABASE_ID
    order by 1

  • Xcelsius Parent/Child SWF Loader with BICS Connections

    We have several Xcelsius Dashboards that use BICS connections to retrieve data from BW queries that we'd like to combine into one Parent/Child tabbed dashboard. I can't seem to find solid information on if this is possible using a SWF Loader component due to the BICS requirement of being published through BW Portal and not InfoView. Does anyone have any ideas (short of combining them into one huge dashboard due to the volume of data)? Thanks!

    Hi Chris,
    I have been working with SWF loader on the SAP portal using the BICS connection type. It was not supported last time I asked about a year ago. However, it can work if you specify the URL in the SWF loader in this way:
    http://sapwebdisp.vestas.net:8103/bicsremotebex?SWF=XXX&TIMESTMP=1318867468000
    XXX is the name you publish your child dashboard under. Data can be exchanged between the parent and child dashboard by using the custom component "Data sharer" from Inovista which can be downloaded for free:
    http://www.inovista.com
    Besides the fact that this setup is unsupported there are some limitations so from my point of view it should only be applied under the following conditions:
    1. It is not possible to build eveything into a single dashboard.
    2. A solution having several independent dashboards does not make sense.
    An alternative might be the setup described in note 1526291. The way I understand it, it binds the dashboards together in a similar way as on a BO server with flash variables.
    Regards,
    Michael

Maybe you are looking for

  • Authorization to Create the Alert Rules?

    Hello All, I created the Alert category in ALRTCATDEF transaction, now when i want to create the Alert rules in RWB. Add Rule and Change Rule is in disable mode. my user have SAP_XI_ADMINISTRATOR authorization, please tell me any other authorization

  • I can't activate my i phone, what is the solution

    i can't activate my 3GS phone, any solution

  • On Demand Business Intelligence/Self Service BI tools

    Hello,  I wanted to first understand if "On Demand Business Intelligence" and "Self Service BI" mean the same. If not, what is the difference between the two.  In addition, i would like to know the tools that i could use addressing the above two need

  • This remux keeps freezing my WD Streaming Player

    Hi all I recently remuxed one of my blurays but playback freezes every 10 minutes or so. The remote control becomes unresponsive & I have to power cycle the player to get it working again. I play my movies via a powered usb enclosure. I have no issue

  • Join query in a dynamic list of values query

    I have a join query in a dynamic list of values query. The value does not return a text value, but rather the id value. Is it possible to use a join query in a dynamic list of values query? For example...in the below query, I expect to see ename in t