How to share data in "User_*" tables with another schema

I would like to share the data in the USER_SEGMENTS table with another schema. If I create a view and grant select on the view, when the other schema queries the view the data is identical to themselves querying the SYS.user_segments table directly.
create view sys_user_segments as select * from sys.user_segments;
grant select on sys_user_segments to A;My guess is that the SYS.user_segments table is a view based on the current user.
Is there a way to share this data without creating a copy of the table?
Oracle: 10g
Thanks

Hi,
All the data dictionary "tables" whose names start with user_ (or all_ or dba_) are actually views, and what results they bring back depend on what schema you logged in to. I don't think there's any way to allow user A to directly see what's in user B's version of user_segments.
Why do you need this? Can you use the all_ views instead, by giving A some privileges on B's objects?
Failing that, you can replicate the data into a regular table. Inside a AUTHID DEFINER stored procedure, the data dictionary views (such as user_segments) are the versions of the procedure owner, so B can write a stored procedure (let's call it populate_my_segments) that populates a regular table (let's call it my_segements), and then grant EXECUTE privilges on populat_my_segments and SELECT privileges on my_segements to user A. A can then refresh the table and look at it whenever he wants to.
If A only needs to see a little information, e.g. the total number of bytes, from B's user_segments, then B can write a function just to return that information.

Similar Messages

  • How to input data into a table with columns?

    I am trying to input data into a table.  My table have 5 columns and an unlimited amount of rows.  I created a program in LabView that enters the data into the table but it enters all of the data in one row.  I would like to enter the first set of information into the first column, the second set of info into the second  column and so on.  I am including a copy of the program that I am working with.  I would like the number of runs to be put into the first column (it should count down like number 5 in first row, number 4 in second row, number 3 in third row, and so on).  I would like the applied voltage to be placed in the second column, and so on.  Any help or information will be greatly appreciated.  I am working with LabView Version 6.1 and 8.0.  I am submitting the vi from 6.1. 
    Attachments:
    FJ-PROGRAM.vi ‏68 KB

    Pondered,
    I looked at your code and I think you might be making things too complicated. I've included a very simple example that demonstrates how to write a 2D array of integers to a table. Hope you find this helpful. It is in LV 7.1.
    Chris C
    Chris Cilino
    National Instruments
    LabVIEW Product Marketing Manager
    Certified LabVIEW Architect
    Attachments:
    rows - columns.vi ‏17 KB

  • How to copy data from one table to another (in other database)

    Hi. I would like to copy all rows from one table to another (and not use BC4J). Tables can be in various databases. I have already 2 connections and I am able to browse source table using
    ResultSet rset = stmt.executeQuery("select ...");
    But I would not like to create special insert statement for every row . There will be problems with date formats etc and it will be slow. Can I use retrieved ResultSet somehow ? Maybe with method insertRow, but how, if ResultSet is based on select statement and want to insert into target table? Please point me in the right direction. Thanks.

    No tools please, it must be common solution. We suceeded in converting our BC4J aplication to PostgreSQL, the MSSQL will be next. So we want to write simple aplication, which could transfer data from our tables between these 3 servers.

  • How give a data from one table to another table

    Oracle forms6i
    Hai All
    I had two table in table data base and from one table the data has to move to another table using forms
    The two tables are
    First table name temp_att from this the data has to move and the data are
    BARCODE BARDATE BARTIME Row_number
    0000000009949296 08-NOV-09 0800 1
    0000000009949296 08-NOV-09 1230 2
    0000000009949296 08-NOV-09 1245 3
    0000000009949296 08-NOV-09 1645 4
    0000000009949297 08-NOV-09 0815 1
    0000000009949297 08-NOV-09 1230 2
    0000000009949297 08-NOV-09 1300 3
    0000000009949297 08-NOV-09 1650 4
    Another table dail_att and the fields are
    barcode,bardate,intime(mintime),outtime(maxtime),intrin(nextmintime)intr,(nextmaxtime)
    Pls give some solutions to solve this problem.
    Thanks & Regards
    Srikkanth.M

    Hai
    Could pls explain me little bit clear
    I have explained my problem clearly in the last Post
    This is the requirement
    I had two table in table data base and from one table the data has to move to another table using forms
    The two tables are
    First table name temp_att from this the data has to move and the data are
    BARCODE BARDATE BARTIME Row_number
    0000000009949296 08-NOV-09 0800 1
    0000000009949296 08-NOV-09 1230 2
    0000000009949296 08-NOV-09 1245 3
    0000000009949296 08-NOV-09 1645 4
    0000000009949297 08-NOV-09 0815 1
    0000000009949297 08-NOV-09 1230 2
    0000000009949297 08-NOV-09 1300 3
    0000000009949297 08-NOV-09 1650 4
    Another table dail_att and the fields are
    barcode,bardate,intime(mintime),outtime(maxtime),intrin(nextmintime)intr,(nextmaxtime)
    Pls give some solutions to solve this problem.
    Thanks & Regards
    Srikkanth.M

  • How to copy data in a table to another table with different structure

    Hi,
    I am having a table Employee with fields EID, ENAME and Age
    i want to insert the values into another table Employee1 with fields
    EID,ENAME,AGE and address. (Address can be null)
    Can anyone provide the sql query to do this.

    I would say, just copy the orignal table and add a column to Employee1.
    To copy the table:
    CREATE TABLE Employee1
    AS (SELECT EID, ENAME, Age
    FROM Employee);
    Then add the column address:
    ALTER TABLE Employee1 ADD address varchar2(50);
    I am just started working with Oracle DB and sql so their maybe a better solution when the alter table is not needed.

  • How to update date in a table from another database

    Hello,
    I am trying to code a way to Update my Testing database from another database. In the coding below the database that has the updated data ends in Restore.
    Use ClientDB_MASTER_Restore
    Truncate Table ClientDB_MASTER_Testing.dbo.Activity_Tracking_AZ
    GO
    SELECT * INTO ClientDB_Master_Testing.dbo.Activity_Tracking_AZ
    FROM Activity_Tracking_AZ
    Go
    I know with this Technique the table must be truncated if not deleted first.  There is probably a better way to do this which I'm very open to.  I'm also looking for coding that will roll back any changes made should an error occur.
      As always, any help is greatly appreciated.
    David92595

    USE ClientDB_MASTER_Testing
    go
    SET XACT_ABORT ON
    BEGIN TRANSACTION
    Truncate Table dbo.Activity_Tracking_AZ
    -- SET IDENTITY_INSERT dbo.Activity_Tracking_AZ ON
    INSERT dbo.Activity_Tracking_AZ (col1, col2, ...)
    SELECT col1, col2,
    FROM ClientDB_MASTER_Restore.dbo.Activity_Tracking_AZ
    -- SET IDENTITY_INSERT dbo.Activity_Tracking_AZ OFF
    COMMIT TRANSACTION
    If you find it boring to type the column lists, just find the table in Object Explorer, and drag the columns node to where you want the column list.
    You need the SET IDENTITY_INSERT command if the table has an IDENTITY column.
    By wrapping the code in a transaction, you are not left with an empty table if the INSERT fails. The command SET XACT_ABORT ON makes sure that the batch is aborted and rolled back in case of an error.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to transfer data from one table to another without duplicates

    This is what I use to quote bathroom remodels. The first thing I do is completely fill in the Master Item List with every Product or Service we can think of to do the project. The Type column has a pop-up menu which includes Combo because some Contractors don't separate the Product from Labor. The Category Totals Table is useful but since some Contractors provide Product and Service at the same time on one invoice I don't get accurate breakdowns for generating my invoices.
    What I would like is to transfer all Vendor names included in the project to the Vendor Totals Table but without any duplicates. Some Contractors might perform services in several categories. I've read many listings in the forum and am just not seeing the answer.
    I have a sample file ready to send. I don't see a way to send it with this message. First Post! Sorry!
    Thank You
    Jeff

    jwoods007 wrote:
    What I would like is to transfer all Vendor names included in the project to the Vendor Totals Table but without any duplicates.
    Hi Jeff,
    Welcome to Apple Discussions and the Numbers '09 forum.
    If your Vendor names (including duplicates) are all in the same column of the source table, it shouldn't be difficult to transfer them to a second table using the technique described below.
    For the example, the source table is named Main and has one header row, the Vendors are listed in column C (starting at C2), and column B is used as an index column. Note that to use VLOOKUP, the index column must be to the left of the Vendor column.
    The index is generated using the following formula in B2, and filled down to the end of the column:
    =IF(COUNTIF(C$1:C2,C)=1,MAX($B$1:B1)+1,"")
    On the second table, Vendor List, the following formula is used in Column A (starting at A2) to collect the indexed vendors from the Main table"
    =IFERROR(VLOOKUP(ROW()-1,Main :: B:C,2,FALSE),"")
    IFERROR is used to trap the "couldn't find" error in the 'empty' rows of Vendor List.
    'FALSE' displays as "exact-match" in the formula, and prevents the rpeated listing of the last vendor that would be created by 'close-match'.
    Regards,
    Barry

  • How do you delete records from table with data in a select option

    how do you delete records from table with relevant to data in a select option..how to write coding

    Hi,
    Try
    if not s_select_option [ ] is initial.
    delete * from table
    where field in s_select_option.
    endif.
    commit work.
    Be careful though. If select option is emty, you will delete the entire table.
    Regards,
    Arek

  • How to insert data into two tables linke with foreign key..

    I have two tables
    1)EMP(emp_ID,username,emp_type_code)
    emp_ID is primary key, emp_type_code is a foreign key references emptype table.
    2)emptype(emp_type_code,emp_type_descripton)
    emp_type_code is primary key
    Could anyone help me ..how to insert data into EMP table. How to insert data into two tables linke with foreign key..

    CREATE TABLE "CATDB"."DWDIMUSER"
    "USER_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_ID" NUMBER(10,0),
    "FULLNAME" VARCHAR2(20 BYTE),
    "FNAME" VARCHAR2(20 BYTE),
    "LNAME" VARCHAR2(20 BYTE),
    "USER_SUBTYPE" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMUSER_PK" PRIMARY KEY ("USER_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE,
    CONSTRAINT "DIMUSER_DIMSPECIALTY_FK" FOREIGN KEY ("SPECIALTY_ID") REFERENCES "CATDB"."DWDIMSPECIALTY" ("SPECIALTY_ID") DISABLE
    CREATE TABLE "CATDB"."DIMSPECIALTY"
    "SPECIALTY_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_NAME" VARCHAR2(100 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("SPECIALTY_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
    INSERT INTO DIMUSER (FullName, FNAME, LNAME, USER_TYPE, USER_SUBTYPE)
    SELECT DISTINCT
    Engineer AS FullName,
    regexp_substr(Engineer , '[^,| ]+', 1, 1) as FName,
    regexp_substr(Engineer , '[^,| ]+', 1, 2) as LName ,
    'Engineer'
    FROM EMPLOYEELOOKUP;
    INSERT INTO DIMSPECIALTY (SPECIALTY_NAME)
    SELECT DISTINCT SPECIALITY
    FROM EMPLOYEELOOKUP;
    COMMIT;
    CREATE TABLE employeelookup ...IS A TABLE THAT HAS ALL THE DATA NEDED TO BE FILLED IN BOTHE TABLES...
    CREATE TABLE "CATDB"."EMPLOYEELOOKUP"
    "EMPLOYEELOOKUP_ID" NUMBER(10,0) NOT NULL ENABLE,
    "ENGINEER" VARCHAR2(25 BYTE),
    "SPECIALTY" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("EMPLOYEELOOKUP_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
    DATA IN EMPLOYEELOOKUP
    Engineer, Specialty,
    John, Dow, Electronis,
    Dow, Jons, Technician
    Stan Smithers Sales
    Mark, Richards Marketing
    Jenny, Lane Marketing
    John, Lee Sales
    I NEED TO LOAD THE FOREIGN KEY IN DIMUSER FROM THE DIMSPECIALTY TABLE?
    BY USING THE LOOKUP TABLE TO MARCH THE NAMES UNDER THE Engineer COLUMN, SPECIALTY COLUMNE DISTICTIVLY BY JOINING THE DIMSPECILTY TO RISTIVE THE PRIMARY KEY AND FILL IT IN THE DIMUSER TABLE AS A FOREIGNE KEY.

  • How to select data from a table using a date field in the where condition?

    How to select data from a table using a date field in the where condition?
    For eg:
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
                                                      and bdatu = '31129999'.
    thanks.

    Hi Ramesh,
    Specify the date format as YYYYMMDD in where condition.
    Dates are internally stored in SAP as YYYYMMDD only.
    Change your date format in WHERE condition as follows.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and bdatu = <b>'99991231'.</b>
    I doubt check your data base table EQUK on this date for the existince of data.
    Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and <b> bdatu <= '99991231'.</b>
    Thanks,
    Vinay
    Thanks,
    Vinay

  • Work with data from a table of another SAP R/3 system

    Hi,
    I want to work with data from a table of another system. I know there's a function called 'RFC_READ_TABLE' but I don't know really how it works. What I want to do is to get data from that system and pass it to the one where I'm working in order I can continue working with this data in the report.
    Besides, I'd like to select only the records that have some conditions.
    I'd appreciate if someone could tell how to do it, whether with FM 'RFC_READ_TABLE' or in another way.
    Thanks in advance,
    Gerard
    P.S: The systems are already connected in SM59

    Yes, you can use RFC_read_table .You can pass the number of columns but I recommend you to  bring all results in your internal table after that you can filter the records. Most of the time I have notice when you make RFC call with this FM to another system it works but it may also happen that other system controlling authorization and then it might give you nothing. As I face this problem on my last Project.
    Hope this’ll give you idea!!
    <b>P.S award the points.</b>
    Good luck
    Thanks
    Saquib Khan
    "Some are wise and some are otherwise"

  • Reading Data from a Table With an Expert

    Hi all - I'm trying to write an Expert in OWB that would read data from a table and create a new table based on that information. I have the table creation part down, but how can I read data from a table with an Expert? From what I've read, Experts only deal with metadata, and there is no mechanism in Experts to actually read data in the tables. Does OraTcl work in Experts? Has anyone ever came across this problem, and if so, how did you solve it? Thanks in advance for your time! - Don

    Hi Don
    Can also use Java and JDBC from within Tcl, see the routines in this file below, take modify or whatever;
    http://blogs.oracle.com/warehousebuilder/ombora.tcl
    source <dir>\ombora.tcl
    set g_user scott
    set g_upwd zzzzzz
    set g_hostname localhost
    set g_port 1521
    set g_srvname ora111
    oraconnect $g_user $g_upwd $g_hostname:$g_port:$g_srvname
    oraselect "select * from emp" ""
    As well as dumping the results to stdout (you probably want to comment that part out and change any other part you don't like), g_res is a ResultSet object you can use to do whatever.
    Cheers
    David

  • How to encrypt column of some table with the single method ?

    How to encrypt column of some table with the single method ?

    How to encrypt column of some table with the single
    method ?How to encrypt column of some table with the single
    method ?
    using dbms_crypto package
    Assumption: TE is a user in oracle 10g
    we have a table need encrypt a column, this column SYSDBA can not look at, it's credit card number.
    tha table is
    SQL> desc TE.temp_sales
    Name Null? Type
    CUST_CREDIT_ID NOT NULL NUMBER
    CARD_TYPE VARCHAR2(10)
    CARD_NUMBER NUMBER
    EXPIRY_DATE DATE
    CUST_ID NUMBER
    1. grant execute on dbms_crypto to te;
    2. Create a table with a encrypted columns
    SQL> CREATE TABLE te.customer_credit_info(
    2 cust_credit_id number
    3      CONSTRAINT pk_te_cust_cred PRIMARY KEY
    4      USING INDEX TABLESPACE indx
    5      enable validate,
    6 card_type varchar2(10)
    7      constraint te_cust_cred_type_chk check ( upper(card_type) in ('DINERS','AMEX','VISA','MC') ),
    8 card_number blob,
    9 expiry_date date,
    10 cust_id number
    11      constraint fk_te_cust_credit_to_cust references te.customer(cust_id) deferrable
    12 )
    13 storage (initial 50k next 50k pctincrease 0 minextents 1 maxextents 50)
    14 tablespace userdata_Lm;
    Table created.
    SQL> CREATE SEQUENCE te.customers_cred_info_id
    2 START WITH 1
    3 INCREMENT BY 1
    4 NOCACHE
    5 NOCYCLE;
    Sequence created.
    Note: Credit card number is blob data type. It will be encrypted.
    3. Loading data encrypt the credit card number
    truncate table TE.customer_credit_info;
    DECLARE
    input_string VARCHAR2(16) := '';
    raw_input RAW(128) := UTL_RAW.CAST_TO_RAW(CONVERT(input_string,'AL32UTF8','US7ASCII'));
    key_string VARCHAR2(8) := 'AsDf!2#4';
    raw_key RAW(128) := UTL_RAW.CAST_TO_RAW(CONVERT(key_string,'AL32UTF8','US7ASCII'));
    encrypted_raw RAW(2048);
    encrypted_string VARCHAR2(2048);
    BEGIN
    for cred_record in (select upper(CREDIT_CARD) as CREDIT_CARD,
    CREDIT_CARD_EXP_DATE,
    to_char(CREDIT_CARD_NUMBER) as CREDIT_CARD_NUMBER,
    CUST_ID
    from TE.temp_sales) loop
    dbms_output.put_line('type:' || cred_record.credit_card || 'exp_date:' || cred_record.CREDIT_CARD_EXP_DATE);
    dbms_output.put_line('number:' || cred_record.CREDIT_CARD_NUMBER);
    input_string := cred_record.CREDIT_CARD_NUMBER;
    raw_input := UTL_RAW.CAST_TO_RAW(CONVERT(input_string,'AL32UTF8','US7ASCII'));
    dbms_output.put_line('> Input String: ' || CONVERT(UTL_RAW.CAST_TO_VARCHAR2(raw_input),'US7ASCII','AL32UTF8'));
    encrypted_raw := dbms_crypto.Encrypt(
    src => raw_input,
    typ => DBMS_CRYPTO.DES_CBC_PKCS5,
    key => raw_key);
    encrypted_string := rawtohex(UTL_RAW.CAST_TO_RAW(encrypted_raw)) ;
    dbms_output.put_line('> Encrypted hex value : ' || encrypted_string );
    insert into TE.customer_credit_info values
    (TE.customers_cred_info_id.nextval,
    cred_record.credit_card,
    encrypted_raw,
    cred_record.CREDIT_CARD_EXP_DATE,
    cred_record.CUST_ID);
    end loop;
    commit;
    end;
    4. Check credit card number script
    DECLARE
    input_string VARCHAR2(16) := '';
    raw_input RAW(128) := UTL_RAW.CAST_TO_RAW(CONVERT(input_string,'AL32UTF8','US7ASCII'));
    key_string VARCHAR2(8) := 'AsDf!2#4';
    raw_key RAW(128) := UTL_RAW.CAST_TO_RAW(CONVERT(key_string,'AL32UTF8','US7ASCII'));
    encrypted_raw RAW(2048);
    encrypted_string VARCHAR2(2048);
    decrypted_raw RAW(2048);
    decrypted_string VARCHAR2(2048);
    cursor cursor_cust_cred is select CUST_CREDIT_ID, CARD_TYPE, CARD_NUMBER, EXPIRY_DATE, CUST_ID
    from TE.customer_credit_info order by CUST_CREDIT_ID;
    v_id customer_credit_info.CUST_CREDIT_ID%type;
    v_type customer_credit_info.CARD_TYPE%type;
    v_EXPIRY_DATE customer_credit_info.EXPIRY_DATE%type;
    v_CUST_ID customer_credit_info.CUST_ID%type;
    BEGIN
    dbms_output.put_line('ID Type Number Expiry_date cust_id');
    dbms_output.put_line('-----------------------------------------------------');
    open cursor_cust_cred;
    loop
         fetch cursor_cust_cred into v_id, v_type, encrypted_raw, v_expiry_date, v_cust_id;
    exit when cursor_cust_cred%notfound;
    decrypted_raw := dbms_crypto.Decrypt(
    src => encrypted_raw,
    typ => DBMS_CRYPTO.DES_CBC_PKCS5,
    key => raw_key);
    decrypted_string := CONVERT(UTL_RAW.CAST_TO_VARCHAR2(decrypted_raw),'US7ASCII','AL32UTF8');
    dbms_output.put_line(V_ID ||' ' ||
    V_TYPE ||' ' ||
    decrypted_string || ' ' ||
    v_EXPIRY_DATE || ' ' ||
    v_CUST_ID);
    end loop;
    close cursor_cust_cred;
    commit;
    end;
    /

  • Its very urgent:how to insert data into database tables

    Hi All,
    I am very new to oaf.
    I have one requirement data insert into database tables.
    here createPG having data that data insert into one custom table.
    but i dont know how to insert data into database tables.
    i wrote the code in am,co as follows.
    in am i wrote the code:
    public void NewoperationManagerLogic()
    ManagerCustomTableVOImpl vo1=getManagerCustomTableVO1();
    OADBTransaction oadbt=getOADBTransaction();
    if(!vo1.isPreparedForExecution())
    vo1.executeQuery();
    Row row=vo1.createRow();
    vo1.insertRow(row);
    in createPG processrequest co:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.NewoperationManagerLogic();
    process form request:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(pageContext.getParameter("Submit")!=null)
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.getOADBTransaction().commit();
    please help with an example(sample code).
    its very urgent.
    thanks in advance
    Seshu
    Edited by: its urgent on Dec 25, 2011 9:31 PM

    Hi ,
    1.)You must have to create a EO based on custom table and then VO based on this EO eventually to save the values in DB
    2.) the row.setNewRowState(Row.STATUS_INITIALIZED); is used to set the the status of row as inialized ,this is must required.
    3.) When u will create the VO based on EO the viewattributes will be created in VO which will be assigned to the fields to take care the db handling .
    You must go thtough the lab excercise shipped with you Jdeveloper ,there is a example of Create Employee page ,that will solve your number of doubts.
    Thanks
    Pratap

  • How to select data from cluster table

    hi experts,
                   I have a report which picks data from bseg (cluster table ) for a month report it is taking around 4 minutes to process.I feel it is not good when take the report after some months.
    how to select data from these table???how to declare itab for these cluster tables????can we include any search condition or any other kind of internal table???
    please advice.
    mani

    Hi Manikandan,
    The following code may be helpful to understand how to select the data from cluster table.
    Types: Begin of ty_kna1,
    Kunnr type kna1-kunnr,
    adrnr type kna1-adrnr,
    end of ty_kna1,
    begin of ty_bseg,
    belnr type bseg-belnr,
    kunnr type bseg-kunnr,
    end of ty_bseg,
    begin of ty_final,
    belnr type bseg-belnr,
    kunnr type kna1-kunnr,
    adrnr type kna1-adrnr,
    end of ty_final.
    Data: it_kna1 type table of ty_kna1,
    wa_kna1 type ty_kna1,
    it_bseg type table of ty_bseg,
    wa_bseg type ty_bseg,
    it_final type table of ty_final,
    wa_final type ty_final.
    Select kunnr adrnr from kna1 into table it_kna1 where....
    if sy-subrc = 0.
    select belnr kunnr into table it_bseg for all entries in it_kna1 where kunnr = it_kna1-kunnr.
    endif.
    sort it_kna1 by kunnr.
    Loop at it_bseg into wa_bseg.
    move wa_bseg-belnr to wa_final-belnr.
    read table it_kna1 into wa_kna1 with kunnr = wa_bseg-kunnr binary search.
    if sy-subrc = 0.
    move: wa_kna1-kunnr to wa_final-kunnr,
    wa_kna1-belnr to wa_final-belnr.
    endif.
    append wa_final to it_final.
    clear wa_final.
    endloop.
    Loop at it_final into wa_final.
    write: / wa_final-belnr, wa_final-kunnr, wa_final-adrnr.
    endloop.
    Reward if useful.
    Thankyou,
    Regards.

Maybe you are looking for

  • How to insert values in the standard table

    Hi Experts,   I have a Standard table ( Info structure ), its called S551. It having 20 fields, Now i want to insert some 1000 records inthat table from Excel sheet, can any one plz help this.   If i tried in se11, with create entries option its not

  • Can't open Acrobat Pro 9 with Photoshop cs5 open

    For some reason I can't open pdf files or even the Acrobat application while photoshop cs5 is open.  As soon as I shut it down I can open the file no problems.  I'm assuming it has something to do with how much memory photoshop is using, but I've nev

  • Pdf attachment problems on osx lion

    Hello i was wondering if apple has fixed the pdf attachment problem seen on other iOS' such as 7.1.  I get the same error (blank pdf file, white screen), however, it doesn't happen all the time.  any explanations and comments would be greatly appreci

  • Incomplete Posting of AR to GL

    Hi, EBS R12.0.4 We can not close AR period due to pending hang transactions. I raise and SR and the support give me this action plan. ACTION PLAN ========== 1. Run the concurrent program - transfer journal entries to GL. -- upload us log and output f

  • Wifi works. 3G doesn't on certain apps

    iPhone 5. Wifi everything works fine.  When on 3G , only email and whatsapp works, all other apps just sit there waiting.  A speed test shows that 3G is active and working.  Cannot use safari, Facebook, twitter etc when not On wifi. Any clues