Update one row based on a row from another table

Hi,
I have two tables which are having the same field but with a different name.
CREATE TABLE FAVE_CODE2_NEW_JOIN
BANKID VARCHAR2(5 BYTE) NOT NULL,
CUSTOMERID VARCHAR2(12 BYTE) NOT NULL,
SIXID VARCHAR2(12 BYTE) NOT NULL,
FAVCODE VARCHAR2(13 BYTE),
IDX NUMBER(5),
DEFAULTT NUMBER(1)
TABLESPACE PORTFOLIO_FAVORITE
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
CREATE TABLE SUBSCRIPTION
SUBSCRIPTIONID RAW(16) NOT NULL,
APPID VARCHAR2(64 BYTE) NOT NULL,
DEVICEID VARCHAR2(64 BYTE),
SUBSCRIBERID NUMBER NOT NULL,
TIME_REGISTERED TIMESTAMP(6) DEFAULT SYSTIMESTAMP NOT NULL,
TIME_LAST_USED TIMESTAMP(6) DEFAULT SYSTIMESTAMP NOT NULL,
SUBSCRIPTION_TYPE VARCHAR2(30 BYTE) NOT NULL,
SUBSCRIPTION_INFO VARCHAR2(512 BYTE)
TABLESPACE PORTFOLIO_FAVORITE
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 64K
NEXT 1M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
BUFFER_POOL DEFAULT
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
SUBSCRIPTION_INFO in SUBSCRIPTION is equal to SIXID in FAVE_CODE2_NEW_JOIN. They have the same value
In FAVE_CODE2_NEW_JOIN table there is also a FAVCODE filed.
Now i want to find out the record from VE_CODE2_NEW_JOIN which are having the same sixid like SUBSCRIPTION_INFO in SUBSCRIPTION and then replace that SUBSCRIPTION_INFO with the value in FAVCODE
Here are some sample from both tables:
SUBSCRIPTION:
B31E5F5D3CB6     RIe9pnbe7BtA8IuQ     BB2-58CA815F9958     21     2012-01-10 19:18:39     2012-01-11 12:24:04     FT     FSB0650444
010FB3AE74AE     RIe9pnbe7BtA8IuQ     845-AD375E95ED90     21     2012-01-12 08:31:47     2012-01-24 08:53:09     FT     FSB0650444
6119E731A26F     RIe9pnbe7BtA8IuQ     76A-DAD2E359BF3F     113     2012-01-04 00:25:05     2012-01-19 16:17:21     FT     FSB0632948
FAVE_CODE2_NEW_JOIN:
08999     191111111111     FSB0650444     SWB0553263     11     0
As you see they both have the same 'FSB0650368' but i want to replace this code with the corresponding FAVCODE in FAVE_CODE2_NEW_JOIN which is 'SWB0553263'.
I hope you have got what i mean, please tell me to explain more if you have any problem to understand what i mean.
Many thanks in Advance!
/ Hesam

Hesam wrote:
hi,
I'm trying this code:
update subscription a
set a.subscription_info =
select b.favcode
         from fave_code2_new_join b
        where b.sixid = a.subscription_info
where exists
select b.favcode
         from fave_code2_new_join b
        where b.sixid = a.subscription_info
)but its taking a lot of time. Until now 10 minutes and lots of presure on the CPU!!
Can we optimize this or its just due to the number of records?
Edited by: Hesam on Mar 25, 2013 3:01 PMSo now you are getting into performance issues?
I would suggest you read {message:id=9360003} and post the necessory details so that we can see what can be improved and how.

Similar Messages

  • How to update one lov based on value selected from another lov.

    Hi ,
    I have a form in which I created the 2 LOVs for my event_date field and event_name field each which is stored in one table.
    t I want to update the event_date LOV everytime event_name is selected.
    How can I achieve this.
    Thanks.
    Neeti.

    Hi,
    You can do this using dynamic LOVs. Here are the steps for populating a employee LOV on selecting a department.
    1) Create a dynamic lov say emloyee_lov with a bind variable like this
    select empno,ename from scott.emp
    where deptno = :dept
    2) Create a form on scott.emp.
    3) In the empno field which should be a LOV type of field, associate it with
    the above employee LOV.
    4) Then set the binding(s) for the bind variable(s) defined in the lov by
    selecting the deptno column.
    This would help.
    Thanks,
    Sharmila

  • Breakout table (fill table with matching data from another table)

    Hi
    I've been trying to study old discussions about breakout tables. I feel I'm close, but still no cigar :-)
    In plain english, I'm trying to autocreate rows with data on a table, based on matching values from another table. E.g. have a table to display all rows where type = AssetX
    I have attached a screenshot of my "master table" called Assets:
    I'm looking to prefill Asset name, Total from this table and populate a new table called e.g. Greenhouse
    Where I'd be adding more data (date, income, expense).
    Any help whould be greatly appreciated.
    Thanks!

    Hi,
    Here is a Sample Query.
    Update Emp A
    Set Sal = (Select Sal from emp b where
    a.empno = b.empno)
    where empno in (select empno from emp);
    Regards,
    Ganesh R
    null

  • How to populate a table based on a row selection from another table.

    Hi, i just started to use ADF BC and Faces. Could some one help me or point me a solution on the following scenario .
    By using a search component , a table is being displayed as a search result. If i select any row in the resulted table , i need to populate an another table at the bottom of the same page from another view. These two tables are related by primary key . May i know how to populate a table based on a row selection from another table. Thanks
    ganesh

    I understand your requirement and the tutorial doesn't talk about Association between the views so that you can create a Master-Detail or in DB parlance, a Parent-Child relationship.
    I will assume that we are dealing with two entities here: Department and Employees where a particular Department has many Employees and hence a Parent-Child relationship.
    Firstly, you need to create an Association between the two Entities - Department and Employees. You can do that by right clicking on the model's entity and then associating the two entities with the appropriate key say, DepartmentId.
    Once you have done that, you need to link the two entities in the View section with this Association that you created. Then go to AppModule and make sure that in the Available View Objects: 'EmployeesView' appears under 'DepartmentView' as "EmployeesView via <link you created>". Shuttle the 'DepartmentView' to the right, Data Model and then shuttle
    "EmployeesView via <link you created>" to the right, Data Model under 'DepartmentView'.
    This will then be reflected in your Data Controls. After that, you simply would have to drag this View into your page as a Master-Detail form...and then when you run this page, any row selected in the Master table, would display the data in the Detail table.
    Also, refer to this link: [Master-Detail|http://baigsorcl.blogspot.com/2010/03/creating-master-detail-form-in-adf.html]
    Hope this helps.

  • Add rows from another table

    Hi ,
    I have a table with 20 records and 10 columns.I want to add columns from another table with out cross join.

    As others have said, you need to have some sort of join condition otherwise it is a cross join.
    SQL> ed
    Wrote file afiedt.buf
      1  with T1 as (select 'e' as c1, 2 as c2 from dual union all
      2              select 'd', 3 from dual)
      3      ,T2 as (select 'x' as c3, 5 as c4 from dual union all
      4              select 'y', 6 from dual union all
      5              select 'z', 2 from dual)
      6  --
      7  select T2.c3, T2.c4, T1.c1, T1.c2
      8  FROM (select c1, c2, row_number() over (order by c1) as rn from T1) T1
      9       FULL OUTER JOIN
    10       (select c3, c4, row_number() over (order by c3) as rn from T2) T2
    11*      ON (T1.rn = T2.rn)
    SQL> /
    C         C4 C         C2
    x          5 d          3
    y          6 e          2
    z          2
    SQL>This example assigns a row number to each row within each table and then joins using that row number.
    (I've assumed the row number should be generated based on the order of the first column of each table, but you can change that as required).
    What is the point of your requirement?

  • Insert missing rows from another table

    Hi
    I need to insert rows from another table if there is gaps in my transaction table. For each ärendenr there should be 5 Id status rows (1-5). Except for the fact that the inserted rows never should have higher IdStatus number then the highest value from
    the transaction for each Ärendenr. See my example below that illustrates my transaction table, Stages master and the desired result.
    Is there some t sql code that could handle this problem?
    Best regards
    Arne
    So far i have tried to solve this with the code below but it doesnt work.
    I have copied the transaction file information to the TempLogTransTimes
    and then insert into LogTransTimes
    IF OBJECT_ID('dbo.TempLogTransTimes', 'U') IS NOT NULL --Här raderas den tillfälliga tabellen
    DROP TABLE dbo.TempLogTransTimes;
    SELECT *
    INTO TempLogTransTimes
    FROM LogTransTimes
    DECLARE @TopÄrende INT
    WHILE EXISTS(SELECT * FROM TempLogTransTimes)
    BEGIN
    SET @TopÄrende = (SELECT TOP(1) Ärendenr FROM TempLogTransTimes ORDER BY Ärendenr)
    INSERT INTO LogTransTimes(Ärendenr, IdStatus, StatusNamn, SourceId)
    SELECT @TopÄrende, SM.IdStatus, SM.StatusNamn, 'Beräkning'
    FROM Statusmall SM
    FULL JOIN TempLogTransTimes LT ON SM.IdStatus = LT.IdStatus
    WHERE LT.IdStatus IS NULL
    DELETE TempLogTransTimes WHERE Ärendenr = @TopÄrende
    END
    Arne Olsson

    Hi Arne Olsson, try this..
    DECLARE @Transactions TABLE
    Id1 INT,
    IdStatus INT,
    StatusName VARCHAR(10)
    DECLARE @Stages TABLE
    IdStatus INT,
    StatusName VARCHAR(10)
    INSERT INTO @Transactions VALUES(1,1,'AA'), (1,3,'CC'), (1,5,'EE'), (2,1,'AA'), (2,3,'CC')
    INSERT INTO @Stages VALUES (1,'AA'), (2,'BB'), (3,'CC'), (4,'DD'), (5,'EE')
    ;WITH CTE AS(SELECT DISTINCT Id1 FROM @Transactions)
    SELECT Id1, IdStatus, StatusName FROM CTE, @Stages
    EXCEPT
    SELECT Id1, IdStatus, StatusName FROM @Transactions
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • Updating a table from another table

    I have a target table a.
    SQL> select * from a;
    FUND TERM
    1
    2
    3
    4
    5
    6
    7
    8
    8 rows selected.
    And, I have another table 'b' where I have the values for 'term' backed up for 4 funds.
    SQL> select * from b;
    FUND TERM
    1 07-JUL-08
    2 08-JUL-08
    3 09-JUL-08
    4 10-JUL-08
    4 rows selected.
    I could use the below merge sql statement to update the target table 'a' with term dates from table b.
    SQL> merge into a
    using b
    on (a.fund = b.fund)
    when matched then
    update set a.term = b.term;
    Merge successfully completed.
    SQL> select * from a;
    FUND TERM
    1 07-JUL-08
    2 08-JUL-08
    3 09-JUL-08
    4 10-JUL-08
    5
    6
    7
    8
    8 rows selected.
    But, my question is, how could this update be done without using 'merge' in sql (not pl/sql). I think I've done it in the past, but just cannot recall how I did it.
    Thanks in advance for any tips you may provide.

    A few ways:
    update a
    set    a.term = (select b.term
                     from   b
                     where  b.fund = a.fund)
    where  exists   (select b.term
                     from   b
                     where  b.fund = a.fund)
    or
    update
       select a.term a_term
             ,b.term b_term
       from   a,b
       where  a.fund = b.fund
    set a_term = b_term;The second one only works if you have a "key preserved table".

  • OBIEE Report - filter based on the result from another analysis

    Hi,
    I am using OBIEE 11g,
    I am trying to use a filter which is based on the result from another analysis. I have an analysis A which is as table 1, and I want to filter the respective columns of analysis B (Table B) based on analysis A to remove the duplicates for march 01, 02, and 07 , but it is not working properly. I took a max of start and end time when I created analysis A. Please let me know if I did anything wrong. thanks.
    Table 1
    Employee Number
    Date
    IN
    Out
    Start Time
    End Time
    xxxxxxx
    2015-02-26
    9:00
    13:00
    00:00:00
    00:00:00
    2015-02-27
    12:00
    18:00
    00:00:00
    00:00:00
    2015-02-28
    8:00
    14:00
    00:00:00
    00:00:00
    2015-03-01
    14:00
    20:00
    14:00:00
    20:00:00
    2015-03-02
    16:00
    20:00
    16:00:00
    20:00:00
    2015-03-07
    14:06
    20:02
    14:00:00
    20:00:00
    2015-03-11
    16:00
    20:00
    16:00:00
    20:00:00
    2015-03-14
    8:00
    14:00
    00:00:00
    00:00:00
    2015-03-25
    14:00
    20:00
    16:00:00
    20:00:00
    Table 2
    Employee Number
    Date
    IN
    Out
    Start Time
    End Time
    Hours
    xxxxxxx
    2015-02-26
    9:00
    13:00
    00:00:00
    00:00:00
    -3
    2015-02-27
    12:00
    18:00
    00:00:00
    00:00:00
    6
    2015-02-28
    8:00
    14:00
    00:00:00
    00:00:00
    6
    2015-03-01
    14:00
    20:00
    00:00:00
    00:00:00
    6
    14:00:00
    20:00:00
    6
    2015-03-02
    16:00
    20:00
    00:00:00
    00:00:00
    4
    16:00:00
    20:00:00
    4
    2015-03-07
    14:06
    20:02
    00:00:00
    00:00:00
    6
    14:00:00
    20:00:00
    6
    2015-03-11
    16:00
    20:00
    16:00:00
    20:00:00
    4
    2015-03-14
    8:00
    14:00
    00:00:00
    00:00:00
    6
    2015-03-25
    14:00
    20:00
    16:00:00
    20:00:00
    4

    Why avg here?
    What columns you want to show in the report?
    for a employee for given date if he have 2 rows then you may sum up hours right?
    Employee Number
    Date
    IN
    Out
    Start Time
    End Time
    Hours

  • UPDATE SQL string substitution from another table

    Hi - I've come across a tricky situation where I would want to update a column in all the relevant rows of a table with values obtained from another table WITHIN the same column update using string concatenation. im not getting any clean way of doing this.
    The goal is to achieve something like this:
    UPDATE table1 set col1 =
    'LANG_ID=(%s),'||
    '_CHALLENGE_RESPONSE_=(%s),'||
    'CRDN_NAM=(%s),'||
    'CLNT_MODE=(%s),'||
    'PTY_ID=(%s),'||
    'CRDN_VAL=(%s),' ||
    'USER_TZ_COD=(%s),' ||
    'GTS_USER_ID=(%s),'||
    'SP_ID=(%s),' ||
    'SP_ALIAS=(%s),' ||
    'ORIG_CLNT_ID=(%s)'
    where table1.col1 is null
    and to substitute the (%s) with data from another table2*. An example is:
    update table1 set col1=
    'LANG_ID=(select LANG_ID from table2* where USER_ID = (select USER_ID from table1))' ||
    '_CHALLENGE_RESPONSE_=((select CHALLENGERESPONSE_ from table2* where USER_id = (select USER_ID from table1)),' ||
    etc for the rest of the values

    I tried this -although the database shows that the affected rows are updated! but querying the table doesn't show the values in the column!
    select col1 from table1 where col1 is null
    shows back the original content (DESPITE it showing me xxx rows updated!)
    UPDATE table1 t1
    SET col1 = (SELECT 'LANG_ID=('||lang_id||')_CHALLENGE_RESPONSE_=('||
    CHALLENGERESPONSE_|| ...*
    FROM table2 t2
    WHERE t1.user_id = t2.user_id)
    WHERE t1.col1 is null;

  • Data from another table, to be displayed on table based screen

    I have a block that is based on one table, if I found the record(s) on that table I will display it on the forms, No Problemo. But, if record(s) was not in the said table, I have to get the data on another table and then display it on the same forms. Is there someone who can show me how I can get the data from another table and display it on screen that is based on another table?

    suppose you have 2 table emp_n and emp with same table structure
    first check data from emp_n if not found then go to emp
    try it:-
    you will change block name at run time(query data source)
    by
    emp_n is old
    emp is new
    set_block_property('emp_n',QUERY_DATA_SOURCE_NAME,'emp');
    if no data found in emp_n table then
    change the block query name by
    set_block_property('emp_n',QUERY_DATA_SOURCE_NAME,'emp');
    in next try it will go to emp table for fetching record
    kuljeet pal singh

  • UPDATING A TABLE WITH SAME INFO FROM ANOTHER TABLE ON THE SAME DB

    0down votefavorite
    I am trying to update a table with info from another table on the same db with same table name. I just want the info to be the same , no primary key or constraint involve just a straight replacement of records and I keep getting errors WITH THE TABLE not
    being recignize. below is my query:
    UPDATE
    VNDFIL
    SET EOBTYP
    =  VNDFIL.EOBTYP, 
    EDI_X12_835_VERSION =  VNDFIL.EDI_X12_835_VERSION
    FROM
    AGERECOVERY
    WHERE
    VNDFIL.EOBTYP
    = VNDFIL.EOBTYP
    AND
    VNDFIL
    .EDI_X12_835_VERSION
    = VNDFIL.EDI_X12_835_VERSION

    Hi rotary,
    If those two same named tables are in the same database then they have to be in different schemas. If you mean they are in the same server instance, then they may be in different databases, besides the "table not being recognized" error,
    anyway you should use the fully qualified table names, that is database.Schema.Table(If across instances, ServerName should be prefixed) to avoid the table unrecognized error.
    Using Identifiers As Object Names
    With the fully qualified names, your update statement can be like below.
    UPDATE
    db1.schema1.VNDFIL
    SET EOBTYP = srcTbl.EOBTYP, EDI_X12_835_VERSION = srcTbl.EDI_X12_835_VERSION
    FROM
    db1.schema2.VNDFIL srcTbl
    WHERE
    db1.schema1.VNDFIL.EOBTYP = srcTbl.VNDFIL.EOBTYP AND
    db1.schema1.VNDFIL.EDI_X12_835_VERSION = srcTbl.VNDFIL.EDI_X12_835_VERSION
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • FETCHING VALUES IN MULTI RECORD BLOCK FROM ANOTHER TABLE USING SELECT STATEMENT.

    Hi,
    I have one multi record block in which i want to fetch values
    (more then one record) from another table using select statement
    IN KEY NEXT ITEM.I am getting following error.
    ORA-01422: exact fetch returns more than requested number of rows
    Thanks in advance.

    In your case I see no reason to use non-database block and to try to populate it from a trigger with a query, instead of using the default forms functionality where you can associate the block and the fields with table, create where clause using bind variables and simply use execute_query() build-in to populate the block. The power of the forms is to use their build-in functionality to interact with the database.
    Also, you can base your block on a query, not on a table and you dynamically change this query using set_block_property() build-in. You can use any dynamic queries (based on different data sources) and you simply need to control the column's data type, the number of the columns and their aliases. Something like creating inline views as a block data source.
    However, you can replace the explicit cursor with implicit one like
    go_block('non_db_block_name');
    first_record();
    FOR v_tab IN (SELECT *
    FROM tab
    WHERE col_name = :variable)
    LOOP
    :non_db_block_name.field1 := v_tab.col1;
    :non_db_block_name.field2 := v_tab.col2;
    next_record();
    END LOOP;

  • Looping delete statement where table name is coming from another table

    Hi All,
    We have to write code to delete records from active tables of WDSO.We have 5 DSO  so inspite of writing delete statement for each table we want to put all table names into one table and then loop through it .but we are getting error when we are refering that table field which has active table name.error is :
    "dictionary structure or table is either not active or does not exist "
    As per my understanding in a delete /select /insert /update statement we need to put table name (whose field we are refering ) it can't be replaced by a variable .
    ex: v_table = 'EMPLOYEE' .
    DELETE FROMv_table WHERE EMP_NAME = 'ABDC' .
    is wrong and it must be like
    ex : DELETE FROM EMPLOYEE WHERE EMP_NAME = 'ABDC' .
    but we want to make our code dynamic .
    Can you please suggest a way so that we can read the table names from another table and delete data based on some selection fom those tables .
    I tried variants ,perform etc and even searched FM for the same but not found a solution .Your help will be greatly appreciated .
    Thanks in advance .
    Regards,
    Jaya

    Hi,
    You can change your statement as follows:
    DELETE FROM (v_table) WHERE EMP_NAME = 'ABDC' .
    However, I would not recommend this. There is a standard function module RSAN_ODS_DATA_DELETE which allows selective deletion - that should be a safer way to do this. You can

  • Column names from another table

    Hi All,
    I have a scenario where i need to get names of a column from another table
    for eg,
    Table EMP
    EmpNo EmpName EmpContact EmpPhone
    1 xyz [email protected] 345     
    2 abc [email protected] 897
    3 ttp [email protected] 345
    The column names of this table can be configurable from some other place and its value is stored in another table like
    Table Config (2 Columns)
    Column_Name Value
    EmpName First name
    EmpContact Email
    EmpPhone Mobile
    Now i want to fetch the values from Emp table but with column headers that are changed and have a value in Config table.
    If a column name is not there in config table then the original column name should come.
    As shown below
    EmpNo First name Email Mobile
    1 xyz [email protected] 345
    2 abc     [email protected] 897
    3 ttp [email protected] 345
    Another eg, If EmpName is not changed and entered in second table , then i want to have the same name as the original EMP table has as shown below.
    EmpNo EmpName Email Mobile
    1 xyz [email protected] 345
    2 abc     [email protected] 897
    3 ttp [email protected] 345
    In other words something like this,
    select empno,
    EmpName as (select value from config where column_name=EmpName),
                   EmpContact as (select value from config where column_name=Empcontact),
                   EmpPhone as (select value from config where column_name=EmpPhone)
         From EMP
    Can some one please help me in providing a solution for this.
    Edited by: 941386 on May 30, 2013 6:20 AM

    Unfortunately, I think this is a job for dynamic sql ...
    Build your "query" first:
    (note this won't work "as is", fix the syntax - but you get the idea.)
    lv_str := 'select empno,
    EmpName as ' || (select value from config where column_name=EmpName) || ',
    EmpContact as ' || (select value from config where column_name=Empcontact) || ',
    EmpPhone as ' || (select value from config where column_name=EmpPhone) || '
    From EMP;';
    execute immediate lv_str;Not sure if there's a better way or not.
    Only other way I can think of is to leverage the way UNION [ALL] works.
    So the following query:
    select a, b, c from dual
    union all
    select d, e, f from dual
    /returns data in columns "named" : "a, b, c"
    Effectively renaming columns d, e, f. You just need to turn your data on edge in that first query, then throw out the rows (I don't know how to get it to work, but perhaps somebody else does?)
    [edit]
    another thought is create a view over top of the table, query that view, then drop the view :P
    that would work nicely - avoid the dynamic SQL. shrug
    [edit]
    Edited by: Greg.Spall on May 30, 2013 9:37 AM

  • INSERTING INTO A TABLE FROM ANOTHER TABLE

    Hi,
    I am having a table called emp in which 5 columns are there, I want to insert some rows from another table called employees, only into three columns of emp table through a sub query.
    Is this scenario is possible, I tried so many queries but it is not working out.
    Can any body help me out.
    The columns in emp table is
    empno, ename, doj, designation, salary, deptno, mgrid
    The columns in employees table is
    empno, name, hiredate, post, salary, commission, deptno, mgr
    I want to insert into empno, ename, doj, designation columns of emp table from the employees table empno, name, hiredate, post columns.
    Ramesh.

    It looks like your EMP table has 7 columns, not 5, and you want to insert into 4 columns, not 3.
    insert into emp
      (empno, ename, doj, designation)
      select empno, name, hiredate, post
        from employees;

  • Getting description of product from another table

    Hi,
    I am getting the level from the user, and based on that creating an internal table.  I am getting product code (PRODH) and level (STUFE) from one table (T179), and getting product description (VTEXT) from another table (T179T).  I need to create a single internal table (PVS) with all three fields.
    How do I do that?  This may seem like a very simple question, but I have only been teaching myslef ABAP for about one week.
    Once I can prepare this table, I will use a function to display it.
    Regards,
    Al Lal
    Code:
    REPORT  YABHINAV16.
    program to display products at chosen level *
    Tables: T179, T179t.
    types:  begin of hierarchy,
            prodh type t179-prodh,
            vtext type t179t-vtext,
            stufe type t179-stufe,
            end of hierarchy.
    data: pvs type standard table of hierarchy initial size 0.
    select-options level for t179-stufe no intervals.
    Select prodh stufe from T179 into corresponding fields of table pvs where stufe in level.
    select vtext from t179t into corresponding fields of table pvs where prodh = pvs-prodh.
    sort pvs by prodh.

    Hi Just change the code accordingly...
    Tables: T179, T179t.
    types: begin of hierarchy,
    prodh type t179-prodh,
    vtext type t179t-vtext,
    stufe type t179-stufe,
    end of hierarchy.
    types: begin of text,
             prodh type t179t-prodh,
             vtext type  t179t-vtext,
             end fo text.
    data: pvs type standard table of hierarchy initial size 0.
    data: it_text type standard table of text,
            wa_text type text.
    select-options level for t179-stufe no intervals.
    start-of-selection.
    Select prodh stufe from T179 into corresponding fields of table pvs where stufe in level.
    select prodh vtext from t179t into corresponding fields of table text for all entries in pvs where prodh = pvs-prodh.
    end-of-selection.
    sort pvs by prodh.
    sort it_text by prodh.
    loop at pvs.
    read table it_text into wa_text with key prodh = pvs-prodh.
    if sy-subrc eq 0.
    pvs-vtext = wa_text-text.
    endif.
    modify pvs.
    endloop.
    Award Points If useful

Maybe you are looking for

  • How do you reset the Apple ID to a new one for the automatic updates download tool?  It defaults to my old Apple ID, even though I have changed the Apple ID to the new one everywhere I can find.

    I have an original Apple ID from my personal iPhone and iPad.  I bought a MacBook Pro for business and the Apple Store clerk told me to use the old Apple ID to make setup faster and that I could change to a new one later.   So... I did all that and c

  • Exceptional material ecise rate

    hi, I have maintain exceptional material ecise rate at J1ID, however rate is not coming to J1IEX trasaaction (only po rate is coming). Can any one share how to populate exceptinoal excise rate? reg mrs

  • Opened files are obscured by palettes

    When I open any existing file it fills the screen – all the way to the   right, behind the palettes. I then have to hide the palettes, pull the  resizing handle of the window to the left, shrink the window, restore the palettes, and finally resize th

  • Error compiling QxOrm

    hi to everybody I'm trying to compiling the QxOrm library which is an ORM library. During the compiling process I had the following error and I don't what I have to do: /usr/bin/ld: cannot find -lboost_serialization-mt collect2: error: ld returned 1

  • 7935 doesn't respond

    I have a 7935 IP conference station that doesn't respond. When powered on it will go through its usual boot sequence, obtaining an IP, and then it will say it cannot contact the TFTP server. Pressing menu has no effect or any other buttons for that m