Distinct data from different columns of a table-Single query

I have a table with different columns. Each of these columns have entries. A particular column, say, a column called name can have same entries more than one time. Likewise other columns can also have same entries more than once. My requirement is to have distinct entries from each of these columns using a single query, such that , for eg; the name column will contain the name George only once on retrieval. Place column will have the place Newyork only once...like that...but Newyork and newyork should be treated different(likewise in other columns also ie; case sensitive). I want to retrieve the above said using a single query from a table. Kindly help.
Regards,
Anees

You're asking a SQL question in a JDBC forum. Look for a SQL forum. The website of the database manfactuer may have a SQL forum/mailinglist.

Similar Messages

  • How to retreive soap xml data from clob column in a table

    Hi,
    I am trying to retrieve the XML tag value from clob column.
    Table name = xyz and column= abc (clob datatype)
    data stored in abc column is as below
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:head="http://www.abc.com/gcgi/shared/system/header" xmlns:v6="http://www.abc.com/gcgi/services/v6_0_0_0" xmlns:sys="http://www.abc.com/gcgi/shared/system/systemtypes">
    <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <RqHeader soapenv:mustUnderstand="0" xmlns="http://www.abc.com/gcgi/shared/system/header">
    <DateAndTimeStamp>2011-12-20T16:02:36.677+08:00</DateAndTimeStamp>
    <UUID>1000002932</UUID>
    <Version>6_0_0_0</Version>
    <ClientDetails>
    <Org>ABC</Org>
    <OrgUnit>ABC</OrgUnit>
    <ChannelID>HBK</ChannelID>
    <TerminalID>0000</TerminalID>
    <SrcCountryCode>SG</SrcCountryCode>
    <DestCountryCode>SG</DestCountryCode>
    <UserGroup>HBK</UserGroup>
    </ClientDetails>
    </RqHeader>
    <wsa:Action>/SvcImpl/bank/
    SOAPEndpoint/AlertsService.serviceagent/OpEndpointHTTP/AlertDeleteInq</wsa:Action></soapenv:Header>
    <soapenv:Body>
    <v6:AlertDeleteInqRq>
    <v6:Base>
    <v6:VID>20071209013112</v6:VID>
    <!--Optional:-->
    <v6:Ref>CTAA00000002644</v6:Ref>
    </v6:Base>
    </v6:AlertDeleteInqRq>
    </soapenv:Body>
    </soapenv:Envelope>
    And i want to retrieve the values of tag
    <ChannelID> and <v6:VID>
    can somebody help, i have tried with extractvalue but not able to get the values

    I have used the below two queries but not able to get the expected results. Both queries result into no values.
    select xmltype(MED_REQ_PAYLOAD).extract('//ClientDetails/Org','xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" || xmlns="http://www.abc.com/gcgi/shared/system/header"').getStringValue() from ESB_OUTPUT_TEMP where SOAPACTION = '/SvcImpl/bank/alerts/v6_0_0_0/SOAPEndpoint/AlertsService.serviceagent/OpEndpointHTTP/AlertDeleteInq'
    select EXTRACTVALUE(xmltype(MED_REQ_PAYLOAD),'/RqHeader/) from ESB_OUTPUT_TEMP where SOAPACTION = '/SvcImpl/bank/SOAPEndpoint/AlertsService.serviceagent/OpEndpointHTTP/AlertDeleteInq'
    Well, for starters, both queries are syntactically wrong :
    - non terminated string
    - incorrect namespace mapping declaration
    - unknown XMLType method "getStringValue()"
    Secondly, all those functions are deprecated now.
    Here's an up-to-date example using XMLTable. It will retrieve the two tag values you mentioned :
    SQL> select x.*
      2  from esb_output_temp t
      3     , xmltable(
      4         xmlnamespaces(
      5           'http://schemas.xmlsoap.org/soap/envelope/' as "soap"
      6         , 'http://www.abc.com/gcgi/shared/system/header' as "head"
      7         , 'http://www.abc.com/gcgi/services/v6_0_0_0' as "v6"
      8         )
      9       , '/soap:Envelope'
    10         passing xmlparse(document t.med_req_payload)
    11         columns ChannelID  varchar2(10) path 'soap:Header/head:RqHeader/head:ClientDetails/head:ChannelID'
    12               , VID        varchar2(30) path 'soap:Body/v6:AlertDeleteInqRq/v6:Base/v6:VID'
    13       ) x
    14  ;
    CHANNELID  VID
    HBK        20071209013112
    You may also want to store XML in XMLType columns for both performance and storage optimizations.

  • How can I take data from specific column in a table using VBA

    Hi
    I do not know how to take the values from the last column in a table, I know how to look over each row but I cannot take the last column values for each row I pass by.
    This is the table for example:
    | Date | Account1 | Account2 | Description | Amount |
    |12/03/2008 | 123-32 | 325-78 | None | $50 |
    |12/03/2008 | 123-32 | 325-78 | None | $20 |
    |12/03/2008 | 123-32 | 325-78 | None | $10 |
    |12/03/2008 | 123-32 | 325-78 | None | $40 |
    I am using this code as a reference that User FiveNines gave me to loop through all the rows in the table, so What I need is to take the values of the column Amount for each row I go through.
    Private Sub RSWVBAPage_afterPlay()
    Dim tbl As HTMLTable
    Dim tblRow As HTMLTableRow
    Dim tblCell As HTMLTableCell
    Dim strValue As String
    Dim rButton As HTMLInputElement
    ' ******** This would be your global variable. I put this so that values are seperated by a semicolin you can use what ever format works for you.
    strValue = "03/22/2008;03/22/2008;*************1977;*************1977;$25.25;Jan, Jun, Jul, Dec"
    ' Strip out the ; for inner text comparison
    strValue = Replace(strValue, ";", "")
    ' This will get the table but can be modifoed to be more specific
    Set tbl = RSWApp.om.FindElement(, "TABLE")
    ' This loops through all the rows in the table until a match to the strValue is found
    For Each tblRow In tbl.rows
    If tblRow.innerText = strValue Then
    RSWApp.WriteToLog "Tables", "Passed", "Row is Present", True
    End If
    Next
    End Sub

    Hi Lippix.
    This is code that will loop the rows then loop the cells and check for "$" which will return dollar values. I also attached a script.
    Private Sub RSWVBAPage_afterPlay()
    Dim tbl As HTMLTable
    Dim tblRow As HTMLTableRow
    Dim tblCell As HTMLTableCell
    Dim strValue As String
    ' This will get the table but can be modifoed to be more specific
    Set tbl = RSWApp.om.FindElement(, "TABLE")
    ' This loops through all the rows in the table until a match to the strValue is found
    For Each tblRow In tbl.rows
      For Each tblCell In tblRow.cells
      ' cycle through the cells and only report those with a dollar value by searching for $
        If InStr(1, tblCell.innerText, "$") <> 0 Then
       RSWApp.WriteToLog tblCell.innerText
       End If
      Next
    Next
    End Sub

  • Can I make a chart automatically source data from different parts of a table?

    Hi! I have a chart that shows data entered into one row across several columns of a table. I want the chart to automatically display information from the next row down once data has been entered into all fields of the first row without the chart displaying two sets of data i.e. just the second row only. I would greatly appreciate any ideas as I've hit a total roadblock with this. Thanks!

    Hi gsnwosu,
    I don't know of any way that Numbers can predict your next move! You must enter all your data and then select cells and create a chart. Here is a Table with a Header Row and two Rows of data:
    You don't say what kind of chart you want. Here is a bar chart using data from Row 2. Select Row 2 by clicking once on the grey Row number (2) and choose a chart type (bar chart here):
    Ignore the "Chart 3" label. I had three goes at this!
    Click on the chart to select it:
    then drag the Row (or Cells) selection down to Row 3 for a new chart (Oranges):
    Regards,
    Ian.
    Message was edited by: Yellowbox. then drag the Row (or Cells) selection down to Row 3 for a new chart (Oranges):

  • Extract data from xml column to other table

    Hi
    I have a table with clob column, inside have a xml, How can I to extract data inside column
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    PL/SQL Release 9.2.0.8.0 - Production
    CORE     9.2.0.8.0     Production
    TNS for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
    NLSRTL Version 9.2.0.8.0 - Production

    thank you
    I have a table
    SQL> desc xml_documents;
    Name      Type          Nullable Default Comments
    DOCNAME   VARCHAR2(200)                          
    XMLDOC    CLOB          Y                        
    TIMESTAMP DATE          Y                         inside XMLDOC column there is only a record below
    <!-- claim77804.xml -->
    <Claim>
    <ClaimId>77804</ClaimId>
    <Policy>12345</Policy>
    <Settlements>
    <Payment Approver="JCOX">1000</Payment>
    <Payment Approver="PSMITH">1850</Payment>
    </Settlements>
    <DamageReport>
    The insured's <Vehicle Make="Volks">Beetle</Vehicle>
    broke through the guard rail and plummeted into a ravine.
    The cause was determined to be <Cause>faulty brakes</Cause>.
    Amazingly there were no casualties.
    </DamageReport>
    </Claim>I tried to use example from : http://www.oracle-base.com/articles/9i/xmlsequence.php
    SELECT extract(value(d), '//POLICY/text()').getStringVal() AS empno
    FROM    xml_documents x,
           table(xmlsequence(extract(x.xmldoc, '/ROWSET/Claim'))) d;But no work, show me error
    ORA-00932: inconsistent datatypes: expected - got -

  • Need to get data from multiple database instances in a single query

    Hi,
    I need a small favour from you guys. The prob is as follows:
    I need to get name, row_id from table A from schema 1 and gbu_name, name from table B from schema 2 where a.name = b.name. I wrote the query in the following manner:
    SELECT a.name, a.row_id, b.gbu_name
    FROM Schema1.A as a, Schema2.B as b
    Where a.name = b.name
    But this query is not working and the error is like " The table does not exists".
    Please update me how to avoid the error and get the right sort of result.
    Thanks & Regards,
    Debabrata

    Ah, youre actually asking different things.
    In your topic title, you say youre running separate instances
    In your body text, you say you are under different user/schema
    So tell me, do you have more than one database or not? How many entries in your TNS file?
    I would say, for "multiple database instances"
    SELECT
      a.id, b.id
    FROM
      tableA a
      INNER JOIN
      tableB@OTHER_DATABASE_LINK_NAME b  <--NOTE!
      USING(id)And of course you will have to look up CREATE PUBLIC DATABASE LINK sql..
    Message was edited by:
    charred

  • How to combine data from different input forms outside a nested iView

    Hi,
    i try to combine data from different input forms in a single one.
    Because of space reasons in Flex compiling i already use nested iViews. Within these nested iViews its possible to use the 'combine' function to do this.
    But in the main iView I cant compose these function with other elements. I need to do this because of using these model in Guided Procedures with output parameters. These parameters I only get with a 'endPoint'. Unfortunatly its not possible to combine data from different input forms into the 'endPoint'.
    Is there any solution?
    Thanx
    Mathias

    Hi Scott,
    i tried this already and i also tried to map all parameters in the endpoint by drawing lines from the other forms and assign the 'empty parameters' by a formula.
    And when i create a collable object in GP and assign the VC iView, only the parameters of the parent-form (the form who trigger the event) are shown as output-parameters.
    Maybe any other ideas? I cant believe that such a simple thing is not possible?!?!
    In my opinion, thats a bug, that I'am not able to use the combine-operator in the main VC-iView. Whats your mind?
    greets
    mathias

  • Import data from different Excel sheets to different tables

    I have an Excel file which has different sheets(S1,S2,S3) .The columns in the sheet are different. I want to import the data from different sheets to different tables(T1,T2,T3).
    S1 ---> T1
    S2 ---> T2
    S3 ---> T3
    I want only one Excel data source in my SSIS package.

    You need to have different DFT flows for that as the metadata is different. You need to map each sheets to corresponding destination tables and then it would work fine
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How can I Move data from one column to another in my access table?

    I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
    I understand how to drop a column or add a column, how do I transfer data from one column to another.
    Here is my trial code:
    <cfquery name="qQueryChangeColumnName" datasource="#dsn#">
      ALTER TABLE leaderboard
      UPDATE leaderboard SET  points2 = points3
    </cfquery>
    Unfortunately, I get the following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
    How can I transfer my data with the alter table method?

    I looked up the Access SQL reference (which is probably a
    good place to start when having issues with Access SQL), and
    it suggests you probably need a WHERE clause in there.
    I agree the documentation is a good place to start. But you should not need a WHERE clause here.
    Too few parameters. Expected 1.
    If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message..

  • How to display multiple data from different table in one table? please help

    Hi
    I got sun java studio creator 2(the separate installation not the one in the net beans)....
    My question is about displaying data that have been taken from the database.... I know how to display data in a table(just click on the table "bind data" )... but my question is that:
    when i want to use a sql statement that taken the data from different table...
    how can i display that data in the table(that will be shown in the web) ??? when i click bind data on the table i can only select one table i can't select more than one....
    Note:
    1) i'm using the rowset for displaying the data in the table, since the sql statement is depending on a condition(i.e. select a from b where c= ? )...
    2) i mean by different table is that( i.e. select a from table1,table2 )..
    thanks in advance...

    Hi,
    937440 wrote:
    Hi every one, this is my first post in this portal. Welcome to the forum!
    Be sure to read the forum FAQ {message:id=9360002}
    I want display the details of emp table.. for that I am using this SQL statement.
    select * from emp where mgr=nvl(:mgr,mgr);
    when I give the input as 7698 it is displaying the corresponding records... and also when I won't give any input then it is displaying all the records except the mgr with null values.
    1)I want to display all the records when I won't give any input including nulls
    2)I want to display all the records who's mgr is null
    Is there any way to incorporate to include all these in a single query..It's a little unclear what you're asking.
    The following query always includes rows where mgr is NULL, and when the bind variable :mgr is NULL, it displays all rows:
    SELECT  *
    FROM     emp
    WHERE     LNNVL (mgr != :mgr)
    ;That is, when :mgr = 7698, it displays 6 rows, and when :mgr is NULL it displays 14 rows (assuming you're using the Oracle-supplied scott.emp table).
    The following query includes rows where mgr is NULL only when the bind variable :mgr is NULL, in which case it displays all rows:
    SELECT     *
    FROM     emp
    WHERE     :mgr     = mgr
    OR       :mgr       IS NULL
    ;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL it displays 14 rows.
    The following query includes rows where mgr is NULL only when the bind variab;e :mgr is NULL, in which case it displays only the rows where mgr is NULL. That is, it treats NULL as a value:
    SELECT     *
    FROM     emp
    WHERE     DECODE ( mgr
                , :mgr, 'OK'
                )     = 'OK'
    ;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL, it displays 1 row.

  • How to insert  data from different internal  table  into a data base table

    hi all,
             I want to insert a particular field in an internal table to a field in a data base table.Note that the fields in the internal table and database table are not of the same name since i need to insert data from different internal tables.can some one tell me how to do this?
    in short i want to do something like the foll:
    INSERT  INTO ZMIS_CODES-CODE VALUE '1'.
    *INSERT INTO ZMIS_CODES-COL1 VALUE DATA_MTD-AUFNR .(zmis_codes is the db table and data_mtd is the int.table)

    REPORT  ZINSERT.
    tables kna1.
    data: itab LIKE KNA1.
    data lv_kUNAG LIKE KNA1-KUNNR.
    lv_kuNAG =  '0000010223'.
    ITAB-kuNNR = lv_kuNAG.
    ITAB-name1 = 'XYZ'.
    INSERT INTO KNA1 VALUES ITAB.
    IF SY-SUBRC = 0.
    WRITE:/ 'SUCCESS'.
    ELSE.
    WRITE:/ 'FAILED'.
    ENDIF.
    Here lv_kunag is ref to kna1 kunnr passed in different name
    In internal table .
    Try and let me know if this logic dint work.

  • Retriving of data from different tables

    retriving of data from different tables depening of the primary key  this key field is there in all tables   if it is there in one v table it should continue to other tables otherwise it should get exit from that it should display information message or otherwise success  message if it is there in all tables .

    Im writing the concept, just check it.
    SELECT * from kna1 into lt_kna1.
    if sy-subrc eq 0.
       selest * from lfa1 into lt_lfa1
    for all entries in lt_kna1.
    endif.

  • Fetch data from different tables print them is assigned places

    Hi Friends,
    I have designed one SMART-Form (Receipt).
    I need to fetch data from different tables and the data must be print in assigned places. Please help me how to achieve this requirement. Thanks for your help.
    Best regards,
    Manju.
    Edited by: Alvaro Tejada Galindo on Feb 12, 2008 10:20 AM

    U're right.
    When it creates a smartform it needs to decide when the main data have to be extracted:
    - or in driver program
    - or in smartforms
    The difference can be in the performance, because the program can select the data only once, the smartforms needs to extract them everytime it's called.
    I prefer to use a complex structure for the smartform interface as so all data I need are in only one structure, the problem is the complex structure is harder to be managed.
    Max

  • Procedure to check data from different tables

    Hi
    I am trying to write a procedure to compare data from a table with another.
    Table 1
    ID Name Dept
    1 ABC Y
    2 DEF Z
    Table 2
    ID Dept
    1 Y
    2 Z
    Table 3
    Name ID
    1 ABC
    2 DEF
    I would like to compare each record data in Table 1 with data from different tables table2,table3 by matching ID,name.... Please help me with how I could start writing a procedure and also spool data that does not match from the table1 with other tables
    thanks
    Edited by: 890563 on Apr 30, 2012 10:34 AM

    Hope below helps you.
    CREATE TABLE TABLE1
    (    ID          VARCHAR2(10),
         FIRST_NAME  VARCHAR2(30),
         LAST_NAME   VARCHAR2(30),
         MIDDLE_NAME VARCHAR2(30)
    INSERT INTO TABLE1 VALUES('123456','testfirst','testlast','testmiddle');
    INSERT INTO TABLE1 VALUES('123457','testfirst1','testlast1','testmiddle1');
    CREATE TABLE TABLE1
    (    ID          VARCHAR2(10),
         FIRST_NAME  VARCHAR2(30),
         LAST_NAME   VARCHAR2(30),
         MIDDLE_NAME VARCHAR2(30)
    INSERT INTO TABLE2 VALUES('123456','testfirst','testlas','testmidd');
    INSERT INTO TABLE2 VALUES('123457','testfirst2','testlast1','testmiddle1');
    SELECT TABLE1.ID,
            -- Match First Name
         CASE WHEN TABLE1.FIRST_NAME != TABLE2.FIRST_NAME THEN TABLE1.FIRST_NAME ELSE NULL END TABLE1_FIRST_NAME,
         CASE WHEN TABLE1.FIRST_NAME != TABLE2.FIRST_NAME THEN TABLE2.FIRST_NAME ELSE NULL END TABLE2_FIRST_NAME,
            -- Match Middle Name
         CASE WHEN TABLE1.MIDDLE_NAME != TABLE2.MIDDLE_NAME THEN TABLE1.MIDDLE_NAME ELSE NULL END TABLE1_MIDDLE_NAME,
            CASE WHEN TABLE1.MIDDLE_NAME != TABLE2.MIDDLE_NAME THEN TABLE2.MIDDLE_NAME ELSE NULL END TABLE2_MIDDLE_NAME,
            -- Match Last Name
         CASE WHEN TABLE1.LAST_NAME != TABLE2.LAST_NAME THEN TABLE1.LAST_NAME ELSE NULL END TABLE1_LAST_NAME,
            CASE WHEN TABLE1.LAST_NAME != TABLE2.LAST_NAME THEN TABLE2.LAST_NAME ELSE NULL END TABLE2_LAST_NAME
    FROM  TABLE1, TABLE2
    WHERE TABLE1.ID = TABLE2.ID
    ID         TABLE1_FIRST_NAME  TABLE2_FIRST_NAME  TABLE1_MIDDLE_NAME TABLE2_MIDDLE_NAME TABLE1_LAST_NAME   TABLE2_LAST_NAME
    123456     NULL               NULL               testmiddle         testmidd           testlast        testlas
    123457     testfirst1         testfirst2         NULL               NULL               NULL            NULL
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Fetch data from different database tables

    Hi...
    How can i fetch data from different database tables and put it into a internal table and then display it??? Can provide simple short codes as i'm new to ABAP. Thanks.

    Hi,
    Check this sample code..
    TYPE-POOLS: slis.
    DATA: BEGIN OF itab OCCURS 0,
            vbeln TYPE vbeln,
            expand,
          END OF itab.
    DATA: BEGIN OF itab1 OCCURS 0,
            vbeln TYPE vbeln,
            posnr TYPE posnr,
            matnr TYPE matnr,
            netpr TYPE netpr,
          END OF itab1.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'VBELN'.
    s_fieldcatalog-outputlen = '12'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'POSNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'POSNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'MATNR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'MATNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'NETPR'.
    s_fieldcatalog-tabname   = 'ITAB1'.
    s_fieldcatalog-rollname  = 'NETPR'.
    s_fieldcatalog-do_sum    = 'X'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    DATA: s_layout TYPE slis_layout_alv.
    s_layout-subtotals_text            = 'SUBTOTAL TEXT'.
    s_layout-key_hotspot = 'X'.
    s_layout-expand_fieldname = 'EXPAND'.
    SELECT vbeln UP TO 100 ROWS
           FROM
           vbak
           INTO TABLE itab.
    IF NOT itab[] IS INITIAL.
      SELECT vbeln posnr matnr netpr
             FROM vbap
             INTO TABLE itab1
             FOR ALL ENTRIES IN itab
             WHERE vbeln = itab-vbeln.
    ENDIF.
    DATA: v_repid TYPE syrepid.
    v_repid = sy-repid.
    DATA: s_keyinfo TYPE slis_keyinfo_alv.
    s_keyinfo-header01 = 'VBELN'.
    s_keyinfo-item01   = 'VBELN'.
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
         EXPORTING
              i_callback_program = v_repid
              is_layout          = s_layout
              it_fieldcat        = t_fieldcatalog
              i_tabname_header   = 'ITAB'
              i_tabname_item     = 'ITAB1'
              is_keyinfo         = s_keyinfo
         TABLES
              t_outtab_header    = itab
              t_outtab_item      = itab1
         EXCEPTIONS
              program_error      = 1
              OTHERS             = 2.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thanks
    Naren

Maybe you are looking for