How to associate parent/child elements when extracting values

Hi,
The following is the query to extract data from xml.
SELECT
row_type
     , row_value
FROM (SELECT XMLTYPE('
                         <rows>
                              <row>
                              <r>
                                   <VALUE>11</VALUE>
                              </r>
                              <r>
                                   <VALUE>22</VALUE>
                              </r>
                              <t>type1</t>
                              </row>
                              <row>
                              <r>
                                   <VALUE>33</VALUE>
                              </r>
                              <r>
                                   <VALUE>44</VALUE>
                              </r>
                              <t>type2</t>
                              </row>
                         </rows>') doc FROM dual) t1,
                         XMLTABLE
                         ('/rows/row'
                         PASSING doc
                         COLUMNS
                         position FOR ORDINALITY,
                         row_type VARCHAR2(10) PATH './t'
                         ) (+) x,
                         XMLTABLE
                         ('/rows/row/r'
                         PASSING doc
                         COLUMNS
                         position2 FOR ORDINALITY,
                         row_value VARCHAR2(10) PATH '.'
                         ) (+) y;
The output is
ROW_TYPE ROW_VALUE
     type1      11
     type1      22
     type1      33
     type1      44
     type2     11
     type2      22
     type2      33
     type2      44
The correct output should be "type1" associated with value 11 and 22, "type2" associated with 33, 44 only, like the following:
ROW_TYPE ROW_VALUE
     type1      11
     type1      22
     type2      33
     type2      44
Can someone help to rewrite the query above to get the desired output?
Thanks in advance!!!

Hi,
Can someone help to rewrite the query above to get the desired output?The second XMLTable (y) must be correlated to the first (x).
That can be achieved by passing the node set of VALUEs from x to y via an XMLType projection.
WITH t1 AS (
  SELECT XMLTYPE('<rows>
      <row>
        <r>
        <VALUE>11</VALUE>
        </r>
        <r>
        <VALUE>22</VALUE>
       </r>
       <t>type1</t>
      </row>
      <row>
        <r>
        <VALUE>33</VALUE>
        </r>
        <r>
        <VALUE>44</VALUE>
       </r>
       <t>type2</t>
      </row>
      </rows>') doc
  FROM dual
SELECT row_type
     , row_value
FROM t1,
     XMLTABLE('/rows/row'
       PASSING t1.doc
       COLUMNS
         row_type    VARCHAR2(10) PATH 't'
       , row_values  XMLType      PATH 'r/VALUE'
      ) x,
      XMLTABLE('/VALUE'
       PASSING x.row_values
       COLUMNS
         row_value VARCHAR2(10) PATH '.'
      ) (+) y
;

Similar Messages

  • How can provide parent-child nodes relation ships?

    how can provide parent-child nodes relation ships?

    I was under the impression that scenegraph is like a JTree. But in JavaFX only leaf node rendering in scenegraph. This situation was confusing my mind. In JavaFX CustomNode must be extending and return a group for custom leaf. If we want to a create parent-child node hierarchy we are create CustomNode that return a group and this group contain an another group,etc. So there is maybe only a way. If you learning to JavaFX first time.This way don't look familiar.

  • How to create Parent Child relationship of Assets

    Hi All
    can any one provide the solution for the below mention requirment.
    Problem Description: How to create Parent Child relationship of Assets in below case.
    1. If asset Category of Child assets are different but both parent & child assets are already capitalized.
    2. If asset Category of Child assets are same but both parent & child assets are already capitalized.
    3. If asset Category of Child assets are same for new assets.

    Hi All
    can any one provide the solution for the below mention requirment.
    Problem Description: How to create Parent Child relationship of Assets in below case.
    1. If asset Category of Child assets are different but both parent & child assets are already capitalized.
    2. If asset Category of Child assets are same but both parent & child assets are already capitalized.
    3. If asset Category of Child assets are same for new assets.

  • How to read the child elements in single query

    Hi
    How to read the child elements under 'alternateIdentifiers' and 'matchEntityBasic' in a single query followiing xml content.xml content is of xmltype
    I/p doc
    <UPDATES>
    <matchEntity>
    <sourceUpdateId>SAMSUNG</sourceUpdateId>
    <matchEntityId>861873</matchEntityId>
    <alternateIdentifiers>
    <sourceUpdateId>SAMSUNG</sourceUpdateId>
    <schemeCode>SMG</schemeCode>
    <effectiveDate>2012-01-16</effectiveDate>
    </alternateIdentifiers>
    <alternateIdentifiers>
    <sourceUpdateId>SAMSUNG</sourceUpdateId>
    <schemeCode>TEBBGL</schemeCode>
    <effectiveDate>2012-01-16</effectiveDate>
    </alternateIdentifiers>
    <matchEntityBasic>
    <sourceUpdateId>SAMSUNG</sourceUpdateId>
    <marketExchangeCode>XASE</marketExchangeCode>
    </matchEntityBasic>
    </matchEntity>
    </UPDATES>
    o/p
    sourceUpdateId schemeCode effectiveDate marketExchangeCode
    SAMSUNG SMG 2012-01-16 XASE
    SAMSUNG TEBBGL 2012-01-16
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    i tried the query but not working
    SELECT sourceUpdateId ,schemeCode ,effectiveDate ,marketExchangeCode FROM message pl,XMLTABLE ('/UPDATES/matchEntity/alternateIdentifiers'
                   PASSING pl.messagetext
                   COLUMNS sourceUpdateId VARCHAR2 (20) PATH sourceUpdateId,
                   schemeCode VARCHAR2 (20) PATH 'schemeCode',
              effectiveDate DATE PATH 'effectiveDate',
    marketExchangeCode VARCHAR2 (20) PATH './matchEntityBasic/marketExchangeCode'
    ) x
    iam not retriving marketExchangeCode with the following query
    marketExchangeCode VARCHAR2 (20) PATH './matchEntityBasic/marketExchangeCode'
    thanks

    The problem is that "matchEntityBasic" is not a child of "alternateIdentifiers", so this :
    ./matchEntityBasic/marketExchangeCodepoints to nothing.
    To display both values in the same query, you'll need a two-level approach.
    For example :
    SQL> SELECT x2.sourceUpdateId
      2       , x2.schemeCode
      3       , x2.effectiveDate
      4       , x1.marketExchangeCode
      5  FROM message pl
      6     , XMLTable(
      7         '/UPDATES/matchEntity'
      8         passing pl.messagetext
      9         columns marketExchangeCode   VARCHAR2(20) PATH 'matchEntityBasic/marketExchangeCode'
    10               , alternateIds         XMLType      PATH 'alternateIdentifiers'
    11       ) x1
    12     , XMLTable(
    13         '/alternateIdentifiers'
    14         passing x1.alternateIds
    15         columns sourceUpdateId     VARCHAR2(20) PATH 'sourceUpdateId'
    16               , schemeCode         VARCHAR2(20) PATH 'schemeCode'
    17               , effectiveDate      DATE         PATH 'effectiveDate'
    18       ) x2
    19  ;
    SOURCEUPDATEID       SCHEMECODE           EFFECTIVEDATE MARKETEXCHANGECODE
    SAMSUNG              SMG                  16/01/2012    XASE
    SAMSUNG              TEBBGL               16/01/2012    XASE
    Or the shorter version :
    SQL> SELECT x.sourceUpdateId
      2       , x.schemeCode
      3       , x.effectiveDate
      4       , x.marketExchangeCode
      5  FROM message pl
      6     , XMLTable(
      7         'for $i in /UPDATES/matchEntity
      8          return
      9            for $j in $i/alternateIdentifiers
    10            return element r { $j/child::*, $i/matchEntityBasic/marketExchangeCode }'
    11         passing pl.messagetext
    12         columns sourceUpdateId     VARCHAR2(20) PATH 'sourceUpdateId'
    13               , schemeCode         VARCHAR2(20) PATH 'schemeCode'
    14               , effectiveDate      DATE         PATH 'effectiveDate'
    15               , marketExchangeCode VARCHAR2(20) PATH 'marketExchangeCode'
    16       ) x
    17  ;
    SOURCEUPDATEID       SCHEMECODE           EFFECTIVEDATE MARKETEXCHANGECODE
    SAMSUNG              SMG                  16/01/2012    XASE
    SAMSUNG              TEBBGL               16/01/2012    XASE

  • How to find parent wbs element from child wbs element

    Hi ,
            I have a WBS element . How to find its parent WBS element . What should be the logic and table fields should i consider ? Please help me , its urgent.

    You can use the BAPI_PROJECT_GETINFO function module to get this info.
    The function is very well documented, and it looks like the table E_WBS_HIERARCHIE_TABLE should have the WBS heirarchy in it.
    Hope this helps.
    Sudha

  • How to delete parent child relation in Toplink

    Hi All,
    I have 3 tables A,B,C.
    In Table A ,I am saving record.
    Table B & C has parent child relation.
    B-->Parent
    C-->Child
    So I want to save records in Table A.
    And delete from child(C) 1st then from parent(B).
    I m writing my code as,
    em.getTransaction().begin();
    em.persist(Table A);//save in Table A
    em.remove(em.merge(Table B));//Remove from Parent
    But how to delete records from child table then from parent table.
    Thanks
    Sandip

    If you have a @OneToOne relationship between two entities, the join column information is used to order the SQL when you remove two entities. For example, if I have:
    @Entity
    public class Employee implements Serializable {
         @OneToOne
         @JoinColumn(name="ADDR_ID")
         private Address address;
    ...Then the following code runs regardless of the order of the remove calls.
              em.getTransaction().begin();
              Employee parent = new Employee();
              Address child = new Address();
              parent.setAddress(child);
              em.persist(parent);
              em.persist(child);
              em.getTransaction().commit();
              em.getTransaction().begin();
              parent = em.merge(parent);
              child = em.merge(child);
              // order of next two statements unimportant
              em.remove(parent);
              em.remove(child);
              em.getTransaction().commit();If I don't remove the parent and just the child I get the same error you do because of the FK from Employee to Address.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to achieve parent - child record insert in forms

    Guys,
    I am new to forms. I do have a requirement where I need to create one tabular block for 10 rows (parent record) and then I need to create three tabular tabs of 5 rows for detailed records (child). That means each tab can have 5 records for 1 parent row.. Thats how this parent-child structure has ONE to MANY relationships
    To achieve this requirement I created one parent block of table type (using table XX_Parent) and then I created three detailed block for each tab (Tab_A,Tab_B,Tab_C) using child table (XX_Child). For each tab while inserting the data I took one context_value column in child table. i.e. when I insert the data using Tab_A , context_value column will be A. In the same way B and C for Tab_B for Tab_C respectively. And I wrote this logic at PRE-INSERT trigger for each tab. But when I insert the data for all the tabs, it allows me to enter successfully for Tab_A only, the moment I navigate from Tab_A to enter the data intoTab_B, it throws me error like "You are passing NULL value to set context_value". I hope I make the requirement clear to you.
    I am not sure if I am following the right approach to achieve my requirement. if its not right, please suggest me right one.. and if its right please guide me resolve the error..
    Looking forward to your reply.
    Thanks
    Sunil

    Andreas,
    I had already created relations between Matster Block -Tab_A block, Master Block -Tab_B block and Master Block - Tab_C block...
    The point is all the three tabs are created using one table XX_Child only.. I used context_value A,B and C respectively so that once I query the data for XX_Child from backend, I should be in a position to figure out what data is inserted using Tab A, B and C. why I need so .. because If take my entire form in query mode and search for a master record.. then Tab_A, tab_B and Tab_C display their respective data. I hope, I make you understand.. Can you please guide me.
    Thanks
    Sunil

  • How to filter parent & child rows from tables while export usingData export

    Hi,
    I have a requirement of export schema. Assume there is a account details table and account transactions table under schema.They have parent child relation exist. if i filter accounts from account details the corresponding transactions in account transactions table should be filterd.How to achieve this?
    Regards,
    Venkat Vadlamudi
    Mobile:9850499800

    Not sure if this is a SQL and PL/SQL question or whether it's an Oracle Apps type question or a Database General.
    Whatever, you've posted in the wrong forum (http://forums.oracle.com/forums/ann.jspa?annID=599)
    You should post in a more appropriate forum e.g.
    PL/SQL
    General Database Discussions
    etc.
    locking this thread

  • How to handle parent-child dimension in OWB?????

    i have a dimension have many levels,and the amount of levels is varing,so i cannot use the wizard to define my dimension ,seems with OWB i can only define dimension with certain amount of levels.......
    my dimension data is stored with this format:
    child parent
    Los Angles US
    US WORLD
    it is called a parent-child relation ,how can i define dimension with parent-child relation witn OWB...
    Can OWB do it ?????

    i have a dimension have many levels,and the amount of levels is varing,so i cannot use the wizard to define my dimension ,seems with OWB i can only define dimension with certain amount of levels.......
    my dimension data is stored with this format:
    child parent
    Los Angles US
    US WORLD
    it is called a parent-child relation ,how can i define dimension with parent-child relation witn OWB...
    Can OWB do it ????? You must define a dimension, define the dimension levels and the hierarchy inside the dimension (a hierarchy can have as many levels as you want, parent-child relationship is a normal hierarchy concept - no rocket science here). Then you have to map the data source for the dimension levels appropriately. Please refer to the user manual, chapter 4 ("Defining dimensianal targets") for details.
    Regards:
    Igor

  • How to achieve parent-child relationship using self join?

    my table structure is as follows
    parent child name
    -1     1     A1
    1     2     A2
    1     3     A3
    how to achieve the hierarchy model using self join. this can be easily achieved using "connect by prior". but how to achieve the same using self join?

    Hi,
    Yes, that's definitely possible. If you only need to display two levels from the hierarchy, a self-join is a good option. Make it an outer join if you need to show everyone on one level, regardless of whether they have a match on the other level or not; for example, if you want the output:
    child_name     child_id     parent_name     parent_id
    A1          1
    A2          2          A1          1
    A3          3          A1          1It's good that you posted some sample data. Now post the results you want from that data, and your query (what you think is the best attempt you've made so far). If you haven't tried anything so far, then look at some other simple self-join to get ideas.

  • How to model parent child relationship with DPL? @Transient?

    Hello All,
    I want to model a parent entity object with a collection of child entities:
    @Entity
    public class Parent{
    @PrimaryKey
    String uuid;
    List&lt;Child&gt; children;
    @Entity
    public class Child{
    @PrimaryKey
    String id;
    I know that the DPL won't support automatic persistence where it'll recursively go through my parent bean and persist my children with one call. Is there a way of applying the equivalent to JPA's @Transient annotation on "children" so I can persist the children manually and have the engine ignore the collection?
    If not and I want to return to the user a Parent with a List named "children," do I have to create a new object which is identical to Parent, but doesn't have the BDB annotations and manually assemble everything? If possible, I'd like to avoid defining redundant objects.
    Thanks in advance,
    Steven
    Harvard Children's Hospital Informatics Program
    Edited by: JavaGeek_Boston on Oct 29, 2008 2:22 PM

    Hi Steven,
    The definition of persistence is here:
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/model/Entity.html
    And includes this: "All non-transient instance fields of an entity class, as well as its superclasses and subclasses, are persistent. static and transient fields are not persistent."
    So you can use the Java transient keyword. If that isn't practical because you're using transient in a different way for Java serialization, see the JE @NotPersistent annotation.
    In general a parent-child relationship between entities is implemented almost as you've described, but with a parentId secondary key in the Child to index all children by their parent. This enables a fast lookup of children by their parent ID.
    I suggest looking at this javadoc:
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/SecondaryIndex.html
    as it describes all types of entity relationships and the trade-offs involved. The department-employee relationship in these examples is a parent-child relationship.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can I fetch the element's attribute value by AS in a mxml file?

    Sample code:
    <mx:MenuBar id="myMenuBar" labelField="@label"
    width="100%">
    <mx:XMLList>
    <menuitem label="MenuItem A">
    <menuitem label="SubMenuItem A-1" enabled="false"/>
    <menuitem label="SubMenuItem A-2"/>
    </menuitem>
    </mx:XMLList>
    </mx:MenuBar>
    How can I fetch the myMenuBar's width value by AS in a mxml
    file. I can't find any API about it!

    quote:
    Originally posted by:
    atta707
    myMenuBar.width
    assuming your AS file/class has access to this component
    under the same id, myMenuBar.
    Yes,you are right. Width is a existed property in myMenuBar
    object in AS. I ignore this case.
    But now, I want to fectch attribute "label"'s value in
    <menuitem label="MenuItem A">.
    How can I get attribute "label"'s value if "label" is
    additional attribute for the element.

  • DMEE : how to make parent node disappear when child node is empty

    Hi Friends ,
    Currently i am working on DMEE , I have a problem . When Child node is empty I donot want the parent node to appear in the tree.Here I am uisng a field via exit function module for childnode. so not a fpay* strucutre field to write a condition.
    Is there any other way for this ?
    Please help.
    Komaravolu

    I'm not sure if this can be done in DMEE tree, but there is BADI DMEE_BADI_01 that can be implemented to perform any kind of postprocessing right before the file is created. I used it, for example, to replace separators with tabs. I believe this can also be used to eliminate the unneeded nodes.

  • How to deploy parent child SSIS package to production/live server.

    Hi all I am very new to SSIS. I have got SSIS package developed by some other guy this package reads data from flat files and stores to database after mapping.
    Flow: 1) First package extract records from flat file and stores in table. 2) Then it calls child package using Execute package tasks. 3) Then child package do some calculations and update the database table.
    SSIS is using Environment variable to get database information.
    Every thing is working fine but now I want to deploy this package to my client's server.
    Ques: Do I need to copy and paste files from bin folder and paste on clients machine?
    What I Tried: I copy files from bin folder and placed on my local computer. Then I create a job in MSSQL and run the job. Package runs perfectly. But Later I changed location of my project and problem starts job stops working.
    Issue: Error says location of child package is not available(As I changed position of my project files)
    Kindly suggest what to do. 

    Hi Anuj,
    The issue occurs because the path of the child package is invalid once you change the location of the project. When configuring the child package reference for Execute Package Task, we can configure it to use Project Reference or External Reference:
    As for the Project Reference, it is used when the project is not deployed or the project to deployed to the SSISDB catalog in SSIS 2012.
    As for the SQL Server External Reference, it is used when the project or child package is deployed to the msdb database. The File System External Reference can be used no matter whether the child package is deployed or not.
    Since the SQL Server Agent job runs correctly after you copied the bin folder to the local computer, it seems that the Execute Package Task uses File System reference and reference to a mapped network driver which maps to the folder that contains the original
    IS project. Otherwise, the SQL Server Agent job should fail because of the invalid path of the child package even if you don’t change the location of the original IS project.
    In your scenario, after copying the bin folder to your local computer, it is recommended that you install the child package to the File System or msdb on your local server, and then edit the parent package in BIDS/SSDT to change the reference of the installed
    child package from the File System or SQL Server storage. After that, you can but don’t have to install the parent package.
    Regards,
    Mike Yin
    TechNet Community Support

  • How to know 'parent-child relationship' of equipments

    Hello experts,
    I am currently having a problem here. How can I know if a certain equipment has a child/subordinate equipemt under it? for example, I typed in the value 000000345534 for the 'ILOAN' field in EQUZ table to get it's EQUNR and HEQUI. Now, where can I know if it has a child equipment under it? for example:
    12610 (highest primary)
    12611
    12612 (subordinate and primary)
      12613
    Also, I have to display it in the report output like this:
    ASSET    PARENT   DESCRIPTION  LOCATION  NETBOOK VALUE

    Hi,
    I had developed  a code wherein I had a similar scenario.Please refer the same. Will give you an idea.
    FORM link.
      SKIP 2.
      ULINE.
      WRITE : / 'Link b/w Transform No and Conn. No' COLOR 6
      INTENSIFIED ON.
      ULINE.
      TABLES:
            iflo.
      INCLUDE <line>.
    **Data type declaration
      DATA: BEGIN OF h_iflo_sel OCCURS 0,
                tplnr LIKE iflo-tplnr.
      DATA: END OF h_iflo_sel.
      DATA :  i_iloa1 LIKE TABLE OF iloa WITH HEADER LINE,
              i_iloa2 LIKE TABLE OF iloa WITH HEADER LINE.
      DATA : BEGIN OF t_inet,
              kante LIKE inet-kante,
              eqnach LIKE inet-eqnach,
              END OF t_inet.
      DATA: BEGIN OF h_iflo_tab OCCURS 0.
              INCLUDE STRUCTURE iflo.
      DATA: END OF h_iflo_tab.
    *For Final Display.
      DATA : BEGIN OF i_final OCCURS 0,
                data(30) TYPE c,
                desc(40) TYPE c,
              END OF i_final.
      DATA : BEGIN OF i_finalitab OCCURS 0,
                eqvon LIKE inet-eqvon,
                eqnach LIKE inet-eqnach,
                eqtyp LIKE equi-eqtyp,
                eqktx LIKE eqkt-eqktx,
                tplnr LIKE iflo-tplnr,
                pltxt LIKE iflo-pltxt,
                kunum LIKE zconnection-kunum,
                END OF i_finalitab.
      DATA : BEGIN OF i_eqkt OCCURS 0.
              INCLUDE STRUCTURE eqkt.
      DATA : END OF i_eqkt.
      DATA : i_iflo LIKE TABLE OF iflo WITH HEADER LINE,
             i_zconn LIKE TABLE OF zconnection WITH HEADER LINE,
             i_kna1 LIKE TABLE OF kna1 WITH HEADER LINE,
             i_equi LIKE TABLE OF equi WITH HEADER LINE,
             i_inet LIKE TABLE OF inet WITH HEADER LINE.
      DATA : var TYPE i VALUE 2,
             count TYPE i VALUE 0,
             tempcount TYPE i VALUE 0,
             lv_index LIKE sy-tabix,
             flag(5) TYPE c VALUE 'ODD' .
      DATA :  kante LIKE inet-kante,
                eqvon LIKE inet-eqvon,
                eqnach LIKE inet-eqnach.
      DATA: equnr LIKE zconnection-equnr.
    *Fetching the transformer no and the Connection no
      SELECT a~kante a~eqvon a~eqnach
              INTO CORRESPONDING FIELDS OF TABLE i_inet
              FROM ( inet AS a
              INNER JOIN zconnection AS b ON a~eqnach = b~equnr )
              WHERE a~eqvon = dy_equnr.
      LOOP AT i_inet.
        MOVE i_inet-eqvon TO i_finalitab-eqvon.
        MOVE i_inet-eqnach TO i_finalitab-eqnach.
        APPEND i_finalitab.
      ENDLOOP.
      LOOP AT i_finalitab.
    *Fetching the Functional Location for Connection number
        CALL FUNCTION 'EQUIPMENT_READ'
             EXPORTING
                  equi_no = i_finalitab-eqnach
             IMPORTING
                  eqkt    = i_eqkt
                  iloa    = i_iloa1.
        MOVE i_iloa1-tplnr TO i_finalitab-tplnr.
        MOVE i_eqkt-eqktx TO i_finalitab-eqktx.
        MODIFY i_finalitab.
      ENDLOOP.
    * Fetching desc of func location of conn no
      SELECT * FROM iflo
                      INTO TABLE i_iflo
                      FOR ALL ENTRIES IN i_finalitab
                      WHERE tplnr = i_finalitab-tplnr.
      LOOP AT i_finalitab.
        READ TABLE i_iflo WITH KEY tplnr = i_finalitab-tplnr.
        IF sy-subrc = 0 .
          MOVE i_iflo-pltxt TO i_finalitab-pltxt.
          MODIFY i_finalitab.
        ENDIF.
      ENDLOOP.
    * Fetching the customer no's for each connection no in Z table
      SELECT   * FROM zconnection
                    INTO TABLE i_zconn
                    FOR ALL ENTRIES IN i_finalitab
                    WHERE equnr = i_finalitab-eqnach.
      LOOP AT i_finalitab.
        lv_index = lv_index + 1.
        READ TABLE i_zconn WITH KEY equnr = i_finalitab-eqnach.
        IF sy-subrc = 0.
          MOVE i_zconn-kunum TO i_finalitab-kunum.
          MODIFY i_finalitab.
        ENDIF.
      ENDLOOP.
    *Fetching the equipment category for each conn no
      SELECT * FROM equi
               INTO TABLE i_equi
               FOR ALL ENTRIES IN i_finalitab
               WHERE equnr = i_finalitab-eqnach.
      LOOP AT i_finalitab.
        READ TABLE i_equi WITH KEY equnr = i_finalitab-eqnach.
        IF sy-subrc = 0.
          MOVE i_equi-eqtyp TO i_finalitab-eqtyp.
          MODIFY i_finalitab.
        ENDIF.
      ENDLOOP.
    *Fetching the Functional Location for Transformer number
      CALL FUNCTION 'EQUIPMENT_READ'
           EXPORTING
                equi_no = dy_equnr
           IMPORTING
                eqkt    = i_eqkt
                iloa    = i_iloa2.
    *For Fetching the description of the func loc. of Transformer Number
      REFRESH i_iflo.
      SELECT SINGLE * FROM iflo
                      INTO i_iflo
                      WHERE tplnr = i_iloa2-tplnr.
    *Moving into the final internal table .
      MOVE dy_equnr TO i_final-data.
      MOVE i_eqkt-eqktx TO i_final-desc.
      APPEND i_final.
      MOVE i_iloa2-tplnr TO i_final-data.
      MOVE i_iflo-pltxt TO i_final-desc.
      APPEND i_final.
    *For finding the superior functional location.
      REFRESH h_iflo_sel.
      MOVE i_iloa2-tplnr TO h_iflo_sel-tplnr.
      APPEND h_iflo_sel.
    *Finding the Superior Func. Location until it reaches the top.
      h_iflo_tab-tplma = '1'.
      DO 100 TIMES.
        IF h_iflo_tab-tplma <> ' '.
          REFRESH h_iflo_tab.
          CALL FUNCTION 'FUNC_LOCATION_ARRAY'
               EXPORTING
                    selfield     = 'TPLNR'
                    spras        = sy-langu
                    tabstructure = 'IFLO'
               TABLES
                    iflo_sel     = h_iflo_sel
                    iflo_tab     = h_iflo_tab.
          IF h_iflo_tab-tplma <> ' '.
    *To find the above func .location
            REFRESH h_iflo_sel.
            MOVE h_iflo_tab-tplma TO h_iflo_sel-tplnr.
            APPEND h_iflo_sel.
    *For Fetching the description of the func loc. of Transformer Number
            REFRESH i_iflo.
            SELECT SINGLE * FROM iflo
                            INTO i_iflo
                            WHERE tplnr =  h_iflo_tab-tplma.
    *Moving the values into the final internal table
            MOVE h_iflo_tab-tplma TO i_final-data.
            MOVE i_iflo-pltxt TO i_final-desc.
            APPEND i_final.
          ENDIF.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
    *Displaying in a tree structure
      IF NOT i_final[] IS INITIAL.
        DESCRIBE TABLE i_final LINES count.
        tempcount = count.
        DO tempcount TIMES.
          READ TABLE i_final INDEX count.
          count = count - 1.
          WRITE: i_final-data COLOR 4 INTENSIFIED ON.
          WRITE: i_final-desc.
          IF count <> 0.
            WRITE:/var sy-vline NO-GAP.
            ULINE :/var(8).
            var = var + 9.
          ENDIF.
        ENDDO.
      ENDIF.
      SKIP.
    * Displaying the Customer no's.
      WRITE : /'Transformer no'COLOR 7 INTENSIFIED ON,18(18)
            'Connection no'COLOR 7 INTENSIFIED ON,37(3)'Cat'COLOR 7
            INTENSIFIED ON,41(40)'Connection desc'COLOR 7 INTENSIFIED ON,
            81(42) 'Connection Object'COLOR 7 INTENSIFIED ON,123(40)
           'Conn Obj Desc'COLOR 7 INTENSIFIED ON,
            163(10)'Customer'COLOR 7 INTENSIFIED ON.
      IF NOT i_finalitab[]  IS INITIAL.
        DESCRIBE TABLE i_finalitab LINES count.
        tempcount = count.
        DO tempcount TIMES.
          READ TABLE i_finalitab INDEX count.
          count = count - 1.
          SKIP.
      WRITE: / i_finalitab-eqvon COLOR 4 INTENSIFIED ON, i_finalitab-eqnach
               COLOR 5 INTENSIFIED ON,i_finalitab-eqtyp COLOR 4 INTENSIFIED
                         ON, i_finalitab-eqktx, i_finalitab-tplnr
        ,i_finalitab-pltxt
        ,i_finalitab-kunum.
        ENDDO.
      ENDIF.
    ENDFORM.
    Regards,
    Gayathri

Maybe you are looking for

  • Problem with connector for ABAP Webdynpro

    Hello, I have a problem with a new Business Package : Portal Runtime Error An exception occurred while processing a request for : iView : pcd:portal_content/com.sap.pct/specialist/com.sap.pct.erp.instructor.bp_folder/com.sap.pct.erp.instructor.roles/

  • Posting with reference to pur. order only possible for integrated whse Message no. L9510

    Hi, I´m trying to setup a reversal for movement type 102 trough our Decentralized warehouse but without any luck. I have check some of the entries in customizing from the path down below, and also check some of links here on the community but still n

  • How to build the Logical cube and physical cube

    Hi All, I have to build the logical cube and physical cube ,i dont have idea about this ,that means i think for that we have to do the partition for the cube may i correct , correct me if i wrong ,plz help me on this Thanks

  • Wrong path when zip a file

    When I try to Zip a file(backup.zip) everything is good except one thing. When I use WinZip to unzip the file, the path for the file contains all subdirectories eg. c:\mycatalog\backup\db\data.data I would like the path to be like: backup\db\data.dat

  • Photoshop CS6 files into Word 2011?

    When I import a photo file from CS6 for MAC, 1x2" at 300 ppi, into Word 2011 for MAC on my new MacBook Pro, the file is importing to fill the page width. When I import a similar file from my old CS2 on the same new computer, the file imports at the c