Error with Parent-Child Hierarchies in BIEE11.1.1.5

Hi ,
I am using BIEE11.1.1.5, I have created a Logical Dimensions with Parent-Child Hierarchies,
In answer,I draged the Hierarchies named 'H5 Sales Rep', then view the results,
It has error,error message as follows:
Odbc driver returned an error (SQLExecDirectW).
Error Details
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 22056] To use hierarchical functions, you need to associate a Closure Table with Logical Table Source 'LTS1 Sales Rep'. (HY000)
SQL Issued: SELECT 0 s_0, "Sample Sales"."Sales Rep"."Sales Rep Name" s_1, CASE WHEN ISLEAF("Sample Sales"."Sales Rep"."H5 Sales Rep") THEN 1 ELSE 0 END s_2, IDOF("Sample Sales"."Sales Rep"."H5 Sales Rep") s_3, PARENT("Sample Sales"."Sales Rep"."H5 Sales Rep") s_4 FROM "Sample Sales" WHERE ISROOT("Sample Sales"."Sales Rep"."H5 Sales Rep")
anyone know why???
Thank you!

Hi Leo,
Did you configure closure table? http://www.rittmanmead.com/2010/11/oracle-bi-ee-11g-parent-child-hierarchies-multiple-modeling-methods/
Also make sure to perform the hierarchy changes in offline mode.
Regards,
Dpka

Similar Messages

  • Insert Record with Parent/Child Tables doesn't work with Oracle - unlike AC

    Hi,
    I just Migrated a MS Access 2010 Database to an Oracle 11g Backend with the SQL Developer Tool.
    The Migration went fine, all the Tables and Views are migrated.
    I'm working with MS Access as Frontend.
    The application has some Datasheets with Subdatasheets with Parent/Child Relationship. (1-n Relationship)
    After changing to Oracle, it's not possible, to Insert a new Record in a Subdatasheet I always get the following Error Message:
    "The Microsoft Access database engine cannot find a record in the table 'xxxx' with key matching field(s) 'zzzzz'"
    It used to work perfect with the MS Access Backend, do I need a trigger which first adds the child Record ?
    Or what should I do?
    Thank you

    Hi Klaus,
    Thanks for your answer. I still haven't solved my problem. The only way would be to use a singel 1:n Relationship, but in fact I need a n:m Relationship.
    I tried the same scenario with a new Access Application, same result.
    To clearify my problem.
    Goal: Parent Form with Parent Records, Linked Child Form with Child Records in a Datasheet View => Insert of a NEW Child Record.
    I have 3 Tables (table1 = Parent tabel, table2 = Child Table, table12 = n:m Tabel with PK and two FK)
    The Recordsource of the Parent Form is Tabel1
    The Recordsource of the Child Form is Table2 joined with Table12.
    In my Old Access Project, Access Triggered the Insert and filled Table12 with the NEW PK of Table2.
    It seems like Access can't do that anymore....
    I'm pretty desperate and I'm sure it is just a litte thing to fix.....

  • Parent Child Hierarchies

    Hi All,
    I am setting up Parent Child Hierarchies in EBS.  Currently, we have all of our base-level child accounts under one parent 'ALL'.  I am trying to expand this having a level of parents underneath 'ALL' such as 'Cash', 'AR', 'Inventory', etc.  My thought was to have 'ALL' set up as the parent of these new parents with 'Parent Values Only' selected rather than 'Child Values Only'.  Then I would make all my new parents have the base level child accounts underneath them by selecting 'Child Values Only'.  Is this the correct way to set up ALL as the top level parent, Cash / AR / Inventory as the next parent down and then finally all of my base level child accounts?
    Specifically, when you have multiple levels of parents, do you have to select 'Parent Values Only' to show the proper hierarchy structure?
    Can someone please confirm.
    Thx,
    Mike

    Hi Leo,
    Did you configure closure table? http://www.rittmanmead.com/2010/11/oracle-bi-ee-11g-parent-child-hierarchies-multiple-modeling-methods/
    Also make sure to perform the hierarchy changes in offline mode.
    Regards,
    Dpka

  • Dimension with Parent-Child Hierarchy - not working

    hi,
    i tried making "Dimension with Parent-Child Hierarchy" as described in your tutorials.
    i finished with the admin tool and database changes and with no errors.
    when trying to create a new answer, by only puting the hierarchy column in the answer.
    the result show "no result" exist.
    i am not sure what i am doing wrong. maybe you can point me to the problem?
    thanks
    Mirit.

    956850 wrote:
    hi,
    i tried making "Dimension with Parent-Child Hierarchy" as described in your tutorials.
    i finished with the admin tool and database changes and with no errors.
    when trying to create a new answer, by only puting the hierarchy column in the answer.
    the result show "no result" exist.
    i am not sure what i am doing wrong. maybe you can point me to the problem?
    thanks
    Mirit.Hi Mirit,
    What is the table that you created hierarchy on?
    Which column in the hierarchy you pulled into your reports to see the No Result message?
    Please query the table and see if has data.
    Thanks,
    G. SK

  • Update column with parent child relationships

    Hi,
    i need to update a column with parent child relationship.
    Please provide the possible queries..
    Gobi..

    Hi,
    Depending of the objective and the size of the tables, personally, for maintenance purposes, I preferred duplicate the parent with the new column value and duplicate the child records with this same new value. Other alternative is disable the foreign key temporarily.
    You can take a look on this link below too:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5773459616034
    Cheers

  • Issue with Parent child dashboards using SWFLoader component

    Hello Gurus,
    I am using Parent-child dashboards approach in our project.
    I have multiple child files embedded in Parent dashboard using the SWFLoader (directly passing the URL as SWFLoader value) to load child dashboards. All the child, parent swf's are saved in the same intranet folders.
    When I open the parent SWF, everything loads fine in the intranet.
    But for some users, when they open from the intranet, the child dashboard doesnt load up properly or size of the dashboard gets reduced to a small version. (Iam sure that it has nothing to do with the access/privileges)
    Any thoughts/ideas what could be causing an issue with child dashboard/resizing of the child dashboard.
    Please help!
    regards,
    S R

    Check whether the machine has compatible flash version in error specific machine and your machine.

  • 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

  • Regarding Sales order creation using Material with Parent-child

    hey guys
    i cannot create sales order for parent child material using Below bapi(BAPI_....ORDERDAT2).
    Could you please tell me if any special parameter should be set with this bapi
    to create the order for PARENT MATERIAL AND child materials.
    i am able to create parent-child material order using VA01. but cant using BAPI
    just for information I am passing Parent materail alone to the BAPI.
    can somebody give suggestion.
    ambichan

    Hi AMBI ,
    SAP will explode the Sales BOM while creating the Sales Order.
    useful Tcodes : CS03.
    Bom Usage : 5.(sales Bom)
    Regards
    prabhu

  • Creating View for a table with parent child relation in table

    I need help creating a view. It is on a base table which is a metadata table.It is usinf parent child relationship. There are four types of objects, Job, Workflow, Dataflow and ABAP dataflow. Job would be the root parent everytime. I have saved all the jobs
    of the project in another table TABLE_JOB with column name JOB_NAME. Query should iteratively start from the job and search all the child nodes and then display all child with the job name. Attached are the images of base table data and expected view data
    and also the excel sheet with data.Picture 1 is the sample data in base table. Picture 2 is data in the view.
    Base Table
    PARENT_OBJ
    PAREBT_OBJ_TYPE
    DESCEN_OBJ
    DESCEN_OBJ_TYPE
    JOB_A
    JOB
    WF_1
    WORKFLOW
    JOB_A
    JOB
    DF_1
    DATAFLOW
    WF_1
    WORKFLOW
    DF_2
    DATAFLOW
    DF_1
    DATAFLOW
    ADF_1
    ADF
    JOB_B
    JOB
    WF_2
    WORKFLOW
    JOB_B
    JOB
    WF_3
    WORKFLOW
    WF_2
    WORKFLOW
    DF_3
    DATAFLOW
    WF_3
    WORKFLOW
    DF_4
    DATAFLOW
    DF_4
    DATAFLOW
    ADF_2
    ADF
    View
    Job_Name
    Flow_Name
    Flow_Type
    Job_A
    WF_1
    WORKFLOW
    Job_A
    DF_1
    DATAFLOW
    Job_A
    DF_2
    DATAFLOW
    Job_A
    ADF_1
    ADF
    Job_B
    WF_2
    WORKFLOW
    Job_B
    WF_3
    WORKFLOW
    Job_B
    DF_3
    DATAFLOW
    Job_B
    DF_4
    DATAFLOW
    Job_B
    ADF_2
    ADF
    I implemented the same in oracle using CONNECT_BY_ROOT and START WITH.
    Regards,
    Megha

    I think what you need is recursive CTE
    Consider your table below
    create table basetable
    (PARENT_OBJ varchar(10),
    PAREBT_OBJ_TYPE varchar(10),
    DESCEN_OBJ varchar(10),DESCEN_OBJ_TYPE varchar(10))
    INSERT basetable(PARENT_OBJ,PAREBT_OBJ_TYPE,DESCEN_OBJ,DESCEN_OBJ_TYPE)
    VALUES('JOB_A','JOB','WF_1','WORKFLOW'),
    ('JOB_A','JOB','DF_1','DATAFLOW'),
    ('WF_1','WORKFLOW','DF_2','DATAFLOW'),
    ('DF_1','DATAFLOW','ADF_1','ADF'),
    ('JOB_B','JOB','WF_2','WORKFLOW'),
    ('JOB_B','JOB','WF_3','WORKFLOW'),
    ('WF_2','WORKFLOW','DF_3','DATAFLOW'),
    ('WF_3','WORKFLOW','DF_4','DATAFLOW'),
    ('DF_4','DATAFLOW','ADF_2','ADF')
    ie first create a UDF like below to get hierarchy recursively
    CREATE FUNCTION GetHierarchy
    @Object varchar(10)
    RETURNS @RESULTS table
    PARENT_OBJ varchar(10),
    DESCEN_OBJ varchar(10),
    DESCEN_OBJ_TYPE varchar(10)
    AS
    BEGIN
    ;With CTE
    AS
    SELECT PARENT_OBJ,DESCEN_OBJ,DESCEN_OBJ_TYPE
    FROM basetable
    WHERE PARENT_OBJ = @Object
    UNION ALL
    SELECT b.PARENT_OBJ,b.DESCEN_OBJ,b.DESCEN_OBJ_TYPE
    FROM CTE c
    JOIN basetable b
    ON b.PARENT_OBJ = c.DESCEN_OBJ
    INSERT @RESULTS
    SELECT @Object,DESCEN_OBJ,DESCEN_OBJ_TYPE
    FROM CTE
    OPTION (MAXRECURSION 0)
    RETURN
    END
    Then you can invoke it as below
    SELECT * FROM dbo.GetHierarchy('JOB_A')
    Now you need to use this for every parent obj (start obj) in view 
    for that create view as below
    CREATE VIEW vw_Table
    AS
    SELECT f.*
    FROM (SELECT DISTINCT PARENT_OBJ FROM basetable r
    WHERE NOT EXISTS (SELECT 1
    FROM basetable WHERE DESCEN_OBJ = r.PARENT_OBJ)
    )b
    CROSS APPLY dbo.GetHierarchy(b.PARENT_OBJ) f
    GO
    This will make sure it will give full hieraracy for each start object
    Now just call view as below and see the output
    SELECT * FROM vw_table
    Output
    PARENT_OBJ DESCEN_OBJ DESCEN_OBJ_TYPE
    JOB_A WF_1 WORKFLOW
    JOB_A DF_1 DATAFLOW
    JOB_A ADF_1 ADF
    JOB_A DF_2 DATAFLOW
    JOB_B WF_2 WORKFLOW
    JOB_B WF_3 WORKFLOW
    JOB_B DF_4 DATAFLOW
    JOB_B ADF_2 ADF
    JOB_B DF_3 DATAFLOW
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Except function with parent child hierarchy using mdx query

    HI,
    I need to remove some items using mdx query in parent child hierarchy.
    I tried with below query,it is not removeing ,could you please help me.
    SELECT
    {[Measures].[Amount]} ON
    COLUMNS
     NonEmpty([Account].[Accounts].[Account Level 01],[Measures].[Amount])
    ON ROWS
    FROM (SELECT
    -Descendants({[Account].[Accounts].&[47]},,Leaves)
    } ON COLUMNS
    FROM [Adventure Works])
    indu

    Hi Indu,
    Why do you remove some itmes using
    Descendants function? Generally, we use FILTER function to achieve the requirement.
    WITH SET [CustomAccounts] AS
    FILTER ([Account].[Accounts].[Account Level 01].Members , [Account].[Accounts].CurrentMember.Name<>'Net Income')
    SELECT {[Measures].[Internet Sales Amount]} ON 0
    [CustomAccounts] ON 1
    FROM [Adventure Works]
    WITH SET [CustomAccounts] AS
    FILTER ([Account].[Accounts].[Account Level 01].Members , [Account].[Accounts].CurrentMember.Name='Net Income')
    SET [RemainingAccount] AS
    [Account].[Accounts].[Account Level 01]- [CustomAccounts]
    SELECT {[Measures].[Reseller Sales Amount]} ON 0
    [RemainingAccount] ON 1
    FROM [Adventure Works]
    Results.
    References.
    http://www.databasejournal.com/features/mssql/article.php/3306101/MDX-Essentials-Basic-Set-Functions-The-Filter-Function.htm
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/c0149678-97f2-4066-903f-7f9e9ff09b56/filtering-out-dimension-members-with-mdx?forum=sqlanalysisservices
    Regards,
    Charlie Liao
    If you have any feedback on our support,
    please click here.
    Charlie Liao
    TechNet Community Support

  • Union on tables with parent-child records and Sorting

    Hi,
    I have an application that has an existing query which returns org units (parent and child) from organization table with a sort on createddate +  org_id combination
    WITH Org_TREE AS (
    SELECT *, null as 'IS_DELETED', convert (varchar(4000), convert(varchar(30),CREATED_DT,126) + Org_Id) theorderby
    FROM Organization WHERE PARENT_Org_ID IS NULL and case_ID='43333'
    UNION ALL
    SELECT a1.*, null as 'IS_DELETED', convert (varchar(4000), a2.theorderby + convert(varchar(30),a1.CREATED_DT,126) + a1.Org_Id)
    FROM Organization a1 INNER JOIN Org_TREE a2 ON a1.PARENT_Org_ID = a2.Org_Id and case_ID='43333'
    SELECT * FROM Org_TREE order by theorderby
    I have created a new log table for organization 'Organization_Log' with exact columns as Organization table with an additional 'IS_DELETED' bool column.
    Questions:
    I need to modiy the query,
    1. To display the parent and child records both from the organization table and organization_log table.
    2. the sort on the result should be based on 'Organization Name' column asc. First with parent org and the child org underneath it. For eg.
    aaa
    ==>fff
    ==>ggg
    bbb
    ==> aaa
    ==> hhh
    Any help on how the query should be constructed?
    Thanks
    gkol

    @Visakh16,
    I am getting...
    All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.
    The problem is that you will have different number of columns in both log and Organization and Organizationlog tables. UNION/UNION ALL expect the same number of columns.
    Try the below:
    WITH Org_Log_TREE AS (
    SELECT Organization_name,Org_id,Parent_Org_id, IS_DELETED, CAST(Organization_Name AS varchar(max)) AS theorderby,1 AS level
    FROM Organization_Log WHERE PARENT_Org_ID IS NULL and case_ID='43333'
    UNION ALL
    SELECT a1.Organization_name,a1.Org_id,a1.Parent_Org_id, a1.IS_DELETED, CAST(a2.theorderby +'/' + CAST(a1.Organization_Name AS varchar(1000)) AS varchar(max)),a2.Level + 1
    FROM Organization_Log a1 INNER JOIN Org_Log_TREE a2 ON a1.PARENT_Org_ID = a2.Org_Id and case_ID='43333'
    ) ,Org_TREE AS (
    SELECT Organization_name,Org_id,Parent_Org_id, NULL AS IS_DELETED, CAST(Organization_Name AS varchar(max)) AS theorderby,1 AS level
    FROM Organization WHERE PARENT_Org_ID IS NULL and case_ID='43333'
    UNION ALL
    SELECT a1.Organization_name,a1.Org_id,a1.Parent_Org_id,NULL AS IS_DELETED, CAST(a2.theorderby +'/' + CAST(a1.Organization_Name AS varchar(1000)) AS varchar(max)),a2.Level + 1
    FROM Organization a1 INNER JOIN Org_TREE a2 ON a1.PARENT_Org_ID = a2.Org_Id and case_ID='43333'
    SELECT * FROM Org_Log_TREE
    UNION ALL
    SELECT * FROM Org_TREE
    ORDER BY LEFT(theorderby,CHARINDEX('/',theorderby + '/')-1),Level

  • Material with Parent Child Relationship

    Hi,
    Need some advise.
    We have this scenario, use purchased materials (.e.g Computer bundle with mouse, monitor and keyboard). We need to track these components separetely at different cost and update inventory with serial no.
    Upon creating Sales Order for the above materials, how to we ensure that the full set of materials is picked and delivered. As each components has it own material code.
    Is there possible to link up these materials with some sort of parent child relationship? And how to handle it in SAP MM and SD moduld.
    Thank you.

    Peck,
    Unless I am missing something, this is not a Materials Management issue, it is a Sales/Distribution issue.
    I think the easiest way is to check the 'complete dlv.' (Complete Delivery) checkbox on the Sales order (VA02>Sales Tab).
    When this flag is set, none of the items in the sales order can be confirmed unless all of them are confirmed.  All confirmations must be for the same day.  No delivery can be created unless all items are deliverable.
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/dd/560602545a11d1a7020000e829fd11/frameset.htm
    Rgds,
    DB49

  • Multiple regions with parent child info.

    I have the need to display parent-child-details on the same page - but more intuitively in 3 regions of a page.
    As an example, i want the first region to display a list of departments, the second adjacent region to display employess in a department chosen in the first region, and the third should have employee details for a chosen employee in the 2nd region.
    The master details approach may not necessarily fit as an elegant solution.
    Any ideas/suggestions/past apps built that would be similar ?
    Regards,
    Atul

    Docster wrote:
    Hi,
    Do you happen to still have this application? I'd love to see it.You are totally wasting your time. There is no point in posting follow-ups to threads this old in the expectation that the original participants will respond&mdash;watches on threads that will generate email notifications of thread updates last for only a period of a few weeks.
    "Sofie87" is not listening. Gone. An ex-poster. Look at their profile: not posted in *4+ years*.
    Posting follow-ups to ancient threads/departed users is NOT an effective way of getting help:
    <li>Other users may ignore the thread if it is closed.
    <li>Your assumption that the questions are related may be incorrect, leading to confusion about the nature of the problem and potential solutions.
    <li>Watches on the thread will have expired, so the original participants are totally unaware of the new post. They may no longer be active on the forum.
    <li>You have no ability to mark posts as helpful or correct.
    Post your requirements as a new thread, including at least the following information:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Links to related posts and threads (using the methods in the FAQ)

  • Unable to resolve stale data error in parent-child page structure.

    Hi Experts!
    I've got a master-detail page which consists of two VOs(EO based), Lets say
    1. MasterTableVO
    2. DetailTableVO
    This page contains two page buttons "Cancel" and "Apply" till here it works all fine & perfect[by that i mean creating, retrieving, querying etc etc.]
    But now i've created another page which is actually a child page of the above mentioned one.
    Here the user'll enter to view some default configured financial info or may also update the default settings manually.
    In this page, I've got only an advancedTable based on a VO(EO based), lets say
    3. PaymentsTableVO
    This page has only one page button "Ok" and which returns back to the parent page retaining the AM.
    All the three VOs are in the same AM. Functionally untill here also it looks fine, but when i finally apply the data it throws an error on getTransaction().commit();
    Error stack:
    OAF Error Unable to perform transaction on the record.
    Cause: The record contains stale data. The record has been modified by another user.
    Action: Cancel the transaction and re-query the record to get the new data.
    Plz reply ASAP.
    Regards
    Ari

    Hi Sushant,
    Yepp !! I've done this in the AM. After invoking the method from the PGCO.
    Here's the code of the PGCO:
    /*===========================================================================+
    | Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA |
    | All rights reserved. |
    +===========================================================================+
    | HISTORY |
    +===========================================================================*/
    package AmritTransportation.oracle.apps.po.Transportations.webui;
    import java.io.Serializable;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    * Controller for ...
    public class CostAllocationsPGCO extends OAControllerImpl
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    if (!pageContext.isBackNavigationFired(false)) {
    TransactionUnitHelper.startTransactionUnit(pageContext,"CreateTxnCosts");
    if (!pageContext.isFormSubmission()) {
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAMessageTextInputBean Amount = (OAMessageTextInputBean)webBean.findIndexedChildRecursive("Amount");
    String TransportationNum = (String)pageContext.getParameter("pTransportationNum")
    ,TransportationId = (String)pageContext.getParameter("pTransportationId")
    ,LockedFlag = (String)pageContext.getParameter("pLockedFlag")
    ,OrgId = (String)pageContext.getProfile("ORG_ID");
    Serializable[] param = {OrgId,TransportationId};
    if (LockedFlag.equals("N")) {
    am.invokeMethod("DefineDefaultCosts",param);
    else {
    am.invokeMethod("executeCosts",param);
    Amount.setReadOnly(true);
    else {
    if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext,"CreateTxnCosts",true)) {
    OADialogPage dialogPage = new OADialogPage(NAVIGATION_ERROR);
    pageContext.redirectToDialogPage(dialogPage);
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if (pageContext.getParameter("Ok") != null) {
    TransactionUnitHelper.endTransactionUnit(pageContext,"CreateTxnCosts");
    pageContext.forwardImmediately("OA.jsp?page=/AmritTransportation/oracle/apps/po/Transportations/webui/CreateTransportationPG&isChildPage=1"
    ,null
    ,OAWebBeanConstants.KEEP_MENU_CONTEXT
    ,null
    ,null
    ,true
    ,OAWebBeanConstants.ADD_BREAD_CRUMB_YES);
    ===============================================================
    Here's the AM method DefineDefaultCosts:
    ===============================================================
    /**Custom public method to define default cost
    * allocation based on the pre-defined formula
    * for cost allocation keeping parity with the
    * corresponding delivery freight details
    public void DefineDefaultCosts(String StrOrgId,String StrTransportationId) {
    OAViewObject vo = (OAViewObject)getAmritTransportationCreateVO1()
    ,vo1 = (OAViewObject)getAmritTransportationPaymentsVO1()
    ,vo2 = (OAViewObject)getAmritTransportDeliveryLinesVO1();
    OADBTransaction txn = getOADBTransaction();
    ArrayList debugMessage = new ArrayList();
    HashMap PartySet = new HashMap();
    Boolean PartyEntryValid = null;
    String TransportationNum = (String)vo.getCurrentRow().getAttribute("TransportationNum")
    ,CurrencyCode = (String)vo.getCurrentRow().getAttribute("CurrencyCode")
    ,EventType = "TRNSP DELIVERED",PeriodName = null;
    Date AccountingDate = (Date)vo.getCurrentRow().getAttribute("DateDelivered");
    Number Amount = (Number)vo.getCurrentRow().getAttribute("Amount")
    ,Rate = (Number)vo.getCurrentRow().getAttribute("Rate")
    ,TripId = (Number)vo.getCurrentRow().getAttribute("TripId")
    ,OrgId = null,TransportationId = null,CodeCombinationId = new Number(576773);
    int DlvryRowCount = vo2.getRowCount(),CostDistRowCount = vo1.getRowCount();
    if (CostDistRowCount == 0) {
    try {
    OrgId = new Number(StrOrgId);
    TransportationId = new Number(StrTransportationId);
    }catch (Exception e) {}
    //debugMessage.add(new OAException("Inherited Values: "+TransportationId+" "+TransportationNum+" "+CurrencyCode+" "+EventType+" "+AccountingDate+" "+Amount+" "+Rate+" "+OrgId));
    try {
    Connection Conn = txn.getJdbcConnection();
    String v$Script = "Select gp.period_name period\n" +
    "From gl_periods gp\n" +
    "Where upper(gp.period_set_name) = 'AMRIT_CALENDAR'\n" +
    "And gp.adjustment_period_flag = 'N'\n" +
    "And trunc(:1) between nvl(gp.start_date,trunc(sysdate))\n" +
    " and nvl(gp.end_date,trunc(sysdate))\n";
    PreparedStatement PreExecuteQuery = Conn.prepareStatement(v$Script);
    PreExecuteQuery.setDate(1,new java.sql.Date(AccountingDate.dateValue().getTime()));
    for (ResultSet QryOutputRS = PreExecuteQuery.executeQuery();QryOutputRS.next();) {
    PeriodName = QryOutputRS.getString("period");
    v$Script = "Select attl.vendor_id vendorid\n" +
    " ,asp.vendor_name vendor \n" +
    "From apps.amrit_transport_trips att\n" +
    " ,apps.amrit_transport_trip_lines attl\n" +
    " ,ap.ap_suppliers asp\n" +
    "Where att.org_id = :1\n" +
    "And att.trip_id = :2\n" +
    "And att.enabled_flag = 'Y'\n" +
    "And trunc(sysdate) between nvl(att.start_date_active,trunc(sysdate))\n" +
    " and nvl(att.end_date_active,trunc(sysdate))\n" +
    "And attl.org_id = att.org_id\n" +
    "And attl.trip_id = att.trip_id\n" +
    "And attl.enabled_flag = 'Y'\n" +
    "And trunc(sysdate) between nvl(attl.start_date_active,trunc(sysdate))\n" +
    " and nvl(attl.end_date_active,trunc(sysdate))\n" +
    "And attl.location_type = 'HZ'\n" +
    "And asp.enabled_flag = 'Y'\n" +
    "And asp.vendor_id = attl.vendor_id\n" +
    "And trunc(sysdate) between nvl(asp.start_date_active,trunc(sysdate))\n" +
    " and nvl(asp.end_date_active,trunc(sysdate))\n";
    PreExecuteQuery = Conn.prepareStatement(v$Script);
    PreExecuteQuery.setInt(1,Integer.parseInt(OrgId.toString()));
    PreExecuteQuery.setInt(2,Integer.parseInt(TripId.toString()));
    for (ResultSet QryOutputRS = PreExecuteQuery.executeQuery();QryOutputRS.next();) {
    PartySet.put(QryOutputRS.getString("vendorid"),QryOutputRS.getString("vendor"));
    }catch (Exception e) {}
    /* vo2.first();
    for (int i = 1;i <= DlvryRowCount;i++) {
    if (vo2.getCurrentRow().getAttribute("CancelFlag").equals("N")) {
    PartyEntryValid = PartySet.add((Number)vo2.getCurrentRow().getAttribute("VendorId"));
    //debugMessage.add(new OAException("Set VendorId: "+vo2.getCurrentRow().getAttribute("VendorId")));
    vo2.next();
    //debugMessage.add(new OAException("PartySet: "+PartySet.entrySet()));
    for (Iterator iter = PartySet.entrySet().iterator();iter.hasNext();) {
    Map.Entry entry = (Map.Entry)iter.next();
    String VendorName = (String)entry.getValue();
    Number Cost = null;
    int PartyId = Integer.parseInt(entry.getKey().toString());
    float Qty = 0;
    try {
    vo2.first();
    for (int i = 1;i <= DlvryRowCount;i++) {
    //debugMessage.add(new OAException("VO VendorId: "+vo2.getCurrentRow().getAttribute("VendorId")+" Cancelled: "+vo2.getCurrentRow().getAttribute("CancelFlag")));
    if (vo2.getCurrentRow().getAttribute("CancelFlag").equals("N")) {
    int VendorId = Integer.parseInt(vo2.getCurrentRow().getAttribute("VendorId").toString());
    float Quantity = Integer.parseInt(vo2.getCurrentRow().getAttribute("Quantity").toString());
    if (PartyId == VendorId) {
    Qty+= Quantity;
    //debugMessage.add(new OAException("Quantities: "+Quantity+" "+Qty));
    vo2.next();
    Qty*= Float.parseFloat(Rate.toString());
    Float totalQty = new Float(Qty);
    Cost = new Number(totalQty);
    }catch (Exception e) {}
    //debugMessage.add(new OAException("PartyId: "+PartyId+" VendorName: "+VendorName+" Cost: "+Cost+" EntryKey: "+entry.getKey()+" EntryValue: "+entry.getValue()));
    Row row = vo1.createRow();
    row.setAttribute("OrgId",OrgId);
    row.setAttribute("TransportationId",TransportationId);
    row.setAttribute("TransportationNum",TransportationNum);
    row.setAttribute("EventType",EventType);
    row.setAttribute("AccountingDate",AccountingDate);
    row.setAttribute("PeriodName",PeriodName);
    row.setAttribute("CodeCombinationId",CodeCombinationId);
    row.setAttribute("PartyId",PartyId);
    row.setAttribute("VendorName",VendorName);
    row.setAttribute("CurrencyCode",CurrencyCode);
    row.setAttribute("Amount",Cost);
    row.setAttribute("TransportationAmount",Amount);
    vo1.last();
    vo1.next();
    vo1.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    vo1.first();
    vo2.first();
    OAException.raiseBundledOAException(debugMessage);
    ===============================================================
    Here's the AM method executeCosts:
    ===============================================================
    /**Custom public method to execute the corresponding
    * transportation transactional cost allocations
    * and the distributive charges on the vendor accounts
    public void executeCosts(String StrOrgId,String StrTransportationId) {
    OAViewObject vo = (OAViewObject)getAmritTransportationPaymentsVO1();
    Number TransportationId = null;
    try { TransportationId = new Number(StrTransportationId); }catch (Exception e) {}
    if (!vo.isPreparedForExecution()) {
    if (TransportationId != null) {
    vo.setNamedWhereClauseParam("ReferredTransportationId",TransportationId);
    vo.executeQuery();
    ===============================================================
    Plz mention if something else is also required.
    Regards
    Ari :)

  • Sorting a list with parent/child object relations

    Hi,
    I have an ArrayList of Genre objects that I want to sort:
    class Genre{
    int CategoryID;
    int ParentCategoryID;
    String name;
    String level;
    Example objects:
    Pop (CategoryID=10, ParentCategoryID=root, "popular music", 1);
    Jazz (CategoryID=11, ParentCategoryID=root, "jazz music", 1);
    Indie pop (CategoryID=12, ParentCategoryID=10, "indie pop", 2);
    American Indie pop (CategoryID=13, ParentCategoryID=12, "american indie pop", 3);
    Soul (CategoryID=15, ParentCategoryID=root, "soul music", 1);
    Commercial pop (CategoryID=14, ParentCategoryID=10, "commercial pop", 2);
    I hope that you see the point:
    I want that the order will be like this in my arraylist:
    jazz music
    popular music
    commercial pop
    indie pop music
    american indie pop
    soul music
    I'll implement the comparator-class in Genre and then add the compareTo-method in my genre-class.
    But my brain is too tired to figure out what to write in the compareTo-method?
    Have somebody done a similar method??
    Best regards,
    Thomas

    Unfortunately is this solution not plausible since I
    don't can have the parent genre in the genre class.
    ... Hashmap?Hashmap works. Here you go, using your structure, minus the level, I'm sure you can work around that though. Don't use -1 as a category id, it's reserved for your root. This code is not thread safe, I leave that to you. Don't forget that as implemented, parent Genres must be constructed prior to any of their children. You could get around this with a two pass initialization process.
    // Not thread safe.
    import java.util.*;
    public class Genre implements Comparable {
         private static Map<Integer, Genre> genreForId = new HashMap<Integer, Genre>();
         private int id;
         private int level;
         private int parentId;
         private String name;
         public Genre(int id, int parentId, String name) {
              this.id = id;
              this.parentId = parentId;
              this.name = name;
              this.level = level(this);
              Genre.genreForId.put(id, this);
         private static int level(Genre genre) {
              int i = 0;
              while (genre != null) {
                   genre = genre.getParent();
                   i++;
              return i;
         public static void main(String[] args) {
              Genre pop = new Genre(10, -1, "popular music");
              Genre jazz = new Genre(11, -1, "jazz music");
              Genre indiePop = new Genre(12, 10, "indie pop");
              Genre americanIndiePop = new Genre(13, 12, "american indie pop");
              Genre soul = new Genre(15, -1, "soul music");
              Genre commercialPop = new Genre(14, 10, "commercial pop");
              Genre[] genres = { pop, jazz, indiePop, americanIndiePop, soul,
                        commercialPop };
              Arrays.sort(genres);
              System.out.println(Arrays.toString(genres));
         public int compareTo(Object o) {
              Genre lhs = this;
              Genre rhs = (Genre) o;
              switch (Integer.signum(lhs.getLevel() - rhs.getLevel())) {
              case -1:
                   rhs = rhs.getParent();
                   if (lhs == rhs)
                        return -1;
                   break;
              case 0:
                   if (lhs == rhs)
                        return 0;
                   else {
                        if (lhs.getParent() == rhs.getParent())
                             return lhs.getName().compareTo(rhs.getName());
                        else {
                             lhs = lhs.getParent();
                             rhs = rhs.getParent();
                   break;
              case 1:
                   lhs = lhs.getParent();
                   if (lhs == rhs)
                        return 1;
              return lhs.compareTo(rhs);
         public int getLevel() {
              return level;
         public String getName() {
              return name;
         public Genre getParent() {
              return Genre.genreForId.get(getParentId());
         public int getParentId() {
              return parentId;
         public String toString() {
              return name;
    }-S

Maybe you are looking for

  • HT4759 how do i install ios 7 on my ipad?

    I purchased a first generation Ipad and have IOS 5.1 and am trying to install IOS 7.0.1 but it keeps saying my Ipad is updated with the IOS 5.1, how do I install the IOS 7.0.1

  • Process Aborted in RAU

    Almost immediately after starting the installation of a Repository Instance using the Repository Administration Utility (RAU, I get a ckrau61 error box showing 'CDR-21244: This process has been aborted' The action advises me to check the log for erro

  • Need info about HDD support for Satellite 2800

    Hi! What max HDD can I use in Satellite 2800-200 Thanks .

  • Client not modifiable message while executing t-code ops7 and ops6

    Hi Guru's, I am getting "Client not modifiable message while executing t-code ops7 and ops6" in Unit test and Quality client. Pleae help me to resolve the error. Regards Sasikanth Reddy

  • Download with CS 5.5

    I have 250 licenses for each of Windows and Macs with software of Creative Suite 5.5 - Master Collection. I only have two discs of CS 5.5 for each Windows and Macs. However, I believe those discs are going to worn out and I tried to make a copy from