Finding column Name in structure

Hi All
I have a requirement where i have the field names ( matnr, ekorg) etc., in an intenal table. eg., . using those names I need to read another internal table which carries values for the fields. I need to write a program to check if a particular field in table 1 has an initial value in table 2 or not.
for my logic, I am looping on tab1( since it will contan only few fields) and assigning it to field symbols. but since the values from tab1 are dynamic, i cant hard code to assign field name like Matnr. So I am unable to figure out who to read tab2 with the field names i find in tab1.
I used cl_abap_tabledescr=>describe_by_data (itab2) to columize the fields of itab2. but this method doesnt fetch me the field values? I was wondering if my approach was correct and if there is any way to use fields from itab1 to read values from itab2.
I am not an ABAP expert, so any help is appreciated
Regards
Ruel

Hi,
You can use this to get the field values.
ASSIGN COMPONENT <comp> OF STRUCTURE <s> TO <FS>.
[Here|http://help.sap.com/saphelp_470/helpdata/en/fc/eb3923358411d1829f0000e829fbfe/content.htm] is the link to documentation.

Similar Messages

  • Finding column name in database

    Hi all..
    I want to find each column name, how many tables this column name is there
    in database.
    For single colum, i can find by using this query..
    select a.COLUMN_NAME, a.TABLE_NAME from all_tab_columns a where
    a.OWNER='DC_ERD' and a.COLUMN_NAME ='ACCESSORY_MAKER'
    If i want to find for each column present in the database, can anybody please tell
    me if it is possible in sql or pqsql is needed.
    Thanks in advance,
    Pal

    Are you asking about the number of tables, it's been used or the tables list?
    select column_name, count(table_name)
    from all_tab_columns
    group by column_nameCheers
    Sarma.

  • Finding Column Name for a Data Pattern

    Hi all,
    I want to find out all the column names which is having matching data pattern such as 'Football'
    I want to get all those column names whose data matches value 'FootBall'
    Which Data Dictionary i can find out column name with data value
    Pls advice
    Thanks

    Definitely a strange requirement but hey....
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    cursor cur_tables is
      3      select table_name from user_tables order by 1;
      4    cursor cur_columns(p_table IN VARCHAR2) is
      5      select column_name from user_tab_columns
      6      where data_type IN ('CHAR', 'VARCHAR2')
      7      and table_name = p_table;
      8    v_cnt NUMBER;
      9    v_sep VARCHAR2(10);
    10    v_where VARCHAR2(2000);
    11    v_word VARCHAR2(30) := 'FOOTBALL';
    12  begin
    13    DBMS_OUTPUT.ENABLE(1000000);
    14    FOR t IN cur_tables
    15    LOOP
    16      v_sep := ' WHERE ';
    17      v_where := NULL;
    18      FOR c IN cur_columns(t.table_name)
    19      LOOP
    20        v_where := v_where||v_sep||c.column_name||' LIKE ''%'||v_word||'%''';
    21        v_sep := ' OR ';
    22      END LOOP;
    23      IF v_where IS NOT NULL THEN
    24        EXECUTE IMMEDIATE 'SELECT count(*) FROM '||t.table_name||v_where INTO v_cnt;
    25        IF v_cnt > 0 THEN
    26          DBMS_OUTPUT.PUT_LINE(v_word||' is in table '||t.table_name);
    27        END IF;
    28      END IF;
    29    END LOOP;
    30* end;
    SQL> /
    FOOTBALL is in table ADDRESS
    FOOTBALL is in table LOGTEXT
    FOOTBALL is in table NOMINAL
    PL/SQL procedure successfully completed.
    SQL>

  • How to find column names in a table

    Am learning the basics of SQL Plus.
    Have entered the following query:
    SELECT * FROM t_ebb_session;
    This gives me the following output.
    USER_ID SESSION_ID LAST_ACCE
    However LAST_ACCE is not the full name of the column as I get 'Invalid column name when I use it in a select statement.
    How do I display the full name?

    By default, SQL*Plus will set the column display width of a character column to its size in the database, and the heading will be the column name in uppercase, truncated to fit that width if necessary. (There is a different rule for numeric columns.)
    You can override this with the COLUMN command, e.g:
    COLUMN some_column_name FORMAT a30 HEADING "Alternative Name"
    Check out the SQL*Plus documentation for all the COLUMN options.

  • Find column name from constraint name

    How to fetch the column name from a constraint name to which the constraint is applied?.
    I only know the name of the constraint and can get the table name from "dba_constraints". How can I know to which column in the table this constraint is applied.
    Thanks

    What about this?
    satyaki>
    satyaki>
    satyaki>desc user_cons_columns;
    Name                                      Null?    Type
    OWNER                                     NOT NULL VARCHAR2(30)
    CONSTRAINT_NAME                           NOT NULL VARCHAR2(30)
    TABLE_NAME                                NOT NULL VARCHAR2(30)
    COLUMN_NAME                                        VARCHAR2(4000)
    POSITION                                           NUMBER
    satyaki>
    satyaki>Regards.
    Satyaki De.

  • Finding columns names in a ResultSet

    Hi,
    Is it possible to get the columns names in a ResultSet ?
    After a SQL query, while parsing the ResultSet List, I would like to detect the columns names used in the select processed. Is it possible ?

    Hi,
    Take a look at the method:
    public ResultSetMetaData getMetaData() in the ResultSet.
    /Kaj

  • Finding Table Name from Structure Name

    Hi All,
    Can someone tell me,whats the best/fastest way to find out the Table name where a data gets stored actually,when we know a structure name
    Bhavin P Shah

    Hi Bhavin,
    The fastest way would be to use the<b> " WHERE USED "</b> option that you find on the application toolbar.
    Step:
    1. Go to SE11.
    2. Enter the Structure Name.
    3. Press the  <b> " WHERE USED "</b> button.
    4. Select "Dictionary Tables.
    After that you should get the list of all the Dictionary Tbales that use your structure.
    <b>Kindly Reward points if you found the reply helpful</b>.
    Cheers,
    CHAITANYA.

  • Finding Table name from structure

    Hi,
    I need to find the trans. table name for the field ATP Quntity, It's coming from the Structure MDEZ field name MNG04. Please Help me guys??????????/
    I tried where used list, it's giving 2 tables But both are not having any data. Please guide me is there is anyother way can i achieve this?????????

    Hi Hari,
    Thanks for ur help. Can i add Program manipulated field value into Search help display. B'cos in selection criteria we can only create view for tables. How i can display manipulated value that's not in table to display in Search help result screen?
    I need to add extra display result in material field's Search help result screen like Stock on hand plant details.
    thanks,
    Subha

  • Find column name in a package

    Hi,
    I am working in oracle 9i . I want to know the specified column (one) in the procedures that are availbale in the schema.
    For ex.
    If my schema contains 10 procdure means, i want to know the column (one) that are used in how many procedures..
    rgds...

    Like this?
    select * from user_source where upper(text) like '%YOUR_COLUMN%'

  • How to find column name for OIM attributes?

    What is the COLUMN_NAME for attributes "Password Generated" and "Design Console access" in OIM 11g?
    Also I cannot find FormMetaData.xml anywhere. Which file represents FormMetaData.xml in OIM11g?

    Thanks Rajiv.
    Here is what I got for the query,
    SELECT USR_EMP_TYPE FROM USR WHERE USR_FIRST_NAME = 'Test';
    USR_EMP_TYPE
    Consultant
    But Design Console Access is a CheckBox in UserForm for OIM 11g, doesnt this value has to be True/False?
    Please help me understand

  • How to find out name of table for a structure.

    hello all,
                I want to find out name of table for a structure ADDR1_DATA. can anybody pls tell me how to find out it?
    Thanks,
    Ashu

    Hi Ashu,
    You write the structure name in se11
    after selecting the database table radio button
    click on the where used list button in the application tool bar.
    You will find the table name if it is used else where.
    Check out the website at:
    http://sap-idoc2edi-consulting.com/
    Read the blog at:
    http://blogs.ittoolbox.com/sap/ehadzipetros
    Regards,
    Jagadish

  • Finding source database table/column name for a column in a view

    Hi i need to be able to identify the original database table/column name for a column in a view.
    e.g. say i have a view like this
    create v1 as select a.name fname, b.name bname, c.name cname,......
    from u1.names a, u2.names b. u3.names c
    where .....
    Now I want to find out that the database table/column name for the fname, bname and cname columns in the view v1, which in this instance is u1.name.name, u2.names.name, u3.names.name.
    But i need to be able to do it for any view. Short of parsing the SQL is there an easy way of doing this?
    Now obviusly I can't do this for virtual columns but I will know my column is not virtual as it has an index on it.

    But i need to be able to do it for any view. Short of
    parsing the SQL is there an easy way of doing this?No, parsing the SQL is the only way. Good luck it is not something I would want to attempt.

  • How do I find the name of an append structure?

    Lets say I want to add a field to the component BT115QS_SLSQ (Sales quote search).
    I enhanced the component and the view (SlsQuotSQ).
    If I go to the context nodes and the context node BTQSLSQUOT.
    I can see the implementation class ZL_BT115QS_SLSQUOTESQ_CN00.
    If I go inside of this class I see a tab attributes with a field called base_entity_name
    the initial value is BTQSlsQuot for this attribute.
    But how would I ever know that the append strcture name for this component / view is CRMST_QUERY_SLSQUOT_BTIL ???
    I only displayed it above becuase I did endless searches and realized this is the one.  But is there an easier way to find the append strcture name so that when I go to SE11 I can either copy and paste it in or type it in.  Is there somewhere in the workbench or anywhere which tells me its in this case CRMST_QUERY_SLSQUOT_BTIL ???
    How do I find this name ?

    Edit:
    FOUND THE ANSWER!
    Here is a complete document I put together for anyone else with this issue.
    I would really love to blog SAP issues like this because there seems to be very little help on the forums for the CRM Web client side :(...
    Purpose
    The purpose of this document is to explain how to find the append structure and how to use it.
    Problem
    Letu2019s say I want to add a field to the component BT115QS_SLSQ (Sales quote search).
    I enhanced the component and the view (SlsQuotSQ).
    If I go to the context nodes and the context node BTQSLSQUOT (this is in the context nodes area)
    I can see the implementation class ZL_BT115QS_SLSQUOTESQ_CN00.
    If I go inside of this class I see a tab attributes with a field called base_entity_name
    the initial value is BTQSlsQuot for this attribute.
    That is the key here, in order to determine the append structure to use when going into SE11 you need to know the name of the base_entity_name.  In the above case the base entity name is BTQSlsQuot.
    That means you need to use BTQSlsQuot
    Step By Step Procedure
    1)     Get the base entity name as described above
    2)     Once the base entity name is given go to transaction GENIL_MODEL_BROWSER
    3)     Enter a component or a component set like so:
    a.     
    4)     Press the green check box
    5)     For model select u201CDynamic Search Objectsu201D (for this particular case because we are trying to add a field to a dynamic search)
    6)     Select u201CDynamic Query Object BTQSlsQuotu201D
    7)     Once you expand this you should be given the attribute structure as shown below:
    Now you have the attribute structure name CRMST_QUERY_SLSQUOT_BTIL
    How To Use Append Structure
    Now that youu2019ve found the append structure to use it follow these steps:
    1)     Go to SE11
    2)     Click radio button Data type
    3)     Enter CRMST_QUERY_SLSQUOT_BTIL
    4)     Click display like so:
    a.     
    5)     Click the u201Cappend structureu2026u201D button at the top right
    6)     Add the field as a ZZ field and enter the data type like so:
    a.     
    References
    No search available for field //BTOPPORTH/EXPREVENUE (STRUCT.EXP_REVENUE) ?
    Field Available in Results List But Not Available In Search Criteria?
    Edited by: Hermiz Jon on Jan 6, 2011 5:51 PM

  • How to find the column name and table name with a value

    Hi All
    How to find the column name and table name with "Value".
    For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
    Any help is highly appricatable
    Thanks & Regards
    Srikkanth.M

    2 solutions by Michaels (the latter is 11g upwards only)...
    michaels>  var val varchar2(5)
    michaels>  exec :val := 'as'
    PL/SQL procedure successfully completed.
    michaels>  select distinct substr (:val, 1, 11) "Searchword",
                    substr (table_name, 1, 14) "Table",
                    substr (t.column_value.getstringval (), 1, 50) "Column/Value"
               from cols,
                    table
                       (xmlsequence
                           (dbms_xmlgen.getxmltype ('select ' || column_name
                                                    || ' from ' || table_name
                                                    || ' where upper('
                                                    || column_name
                                                    || ') like upper(''%' || :val
                                                    || '%'')'
                                                   ).extract ('ROWSET/ROW/*')
                       ) t
    --        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
           order by "Table"or
    SQL> select table_name,
           column_name,
           :search_string search_string,
           result
      from cols,
           xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
           columns result varchar2(10) path '.'
    where table_name in ('EMP', 'DEPT')
    TABLE_NAME           COLUMN_NAME          SEARCH_STRING        RESULT   
    DEPT                 DNAME                ES                   RESEARCH 
    DEPT                 DNAME                ES                   SALES    
    EMP                  ENAME                ES                   JONES    
    EMP                  ENAME                ES                   JAMES    
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   PRESIDENT
    EMP                  JOB                  ES                   SALESMAN 
    9 rows selected.

  • Finding column and table name

    Hi,
    I need to find out that '101c_0000000018' value is which column and table of database.
    Is there a way to find it? I am looking for table and column which is storing this data.
    Thanks
    Sandy

    It's possible but performance is going to be horrible.
    Assuming the data is stored in a CHAR or VARCHAR2 column, something like
    DECLARE
      l_value VARCHAR2(100) := '101c_0000000018' ;
      l_cnt   PLS_INTEGER;
      l_sql    VARCHAR2(1000);
    BEGIN
      FOR x IN (
          SELECT table_name, column_name
            FROM dba_tab_cols
           WHERE owner = <<name of schema>>
             AND data_type IN ('CHAR', 'VARCHAR2' )
      LOOP
        l_sql := 'SELECT COUNT(*) FROM ' || x.owner || '.' || x.table_name || ' WHERE ' || x.column_name || ' = :1';
        EXECUTE IMMEDIATE l_sql
          INTO l_cnt
         USING l_value;
        IF( l_cnt > 0 )
        THEN
          dbms_output.put_line( 'Found the value ' || l_value || ' in owner = ' || x.owner || ' table name = ' || x.table_name || ' column name = ' || x.column_name );
        END IF;
      END LOOP;
    END;Justin
    Edited by: Justin Cave on Dec 8, 2011 12:20 PM

Maybe you are looking for

  • Can't Create Bean Error

    I modified the numguess example that comes with tomcat but I get a "can't create bean" error message when I call my jsp file. If anyone can see what I'm doing wrong or suggest ways to discover the problem I'd appreciate it. My modified jsp: <!-- Copy

  • Urgent: how to call servlet from JSP

    I have a working servlet which returns a table in html format. I also updated the web.xml file according to the information I got from the previous message. My problem is how to correctly invoke the servlet in the JSF. I tried the following ways: <js

  • IPhone + Apple TV = Perfect Union

    Wouldn't it be great to take advantage of the iPhone sensors and the Apple TV for playing games, surfing the web full screen, typing text rather than managing with the remote, among any other possibilities?

  • HT204053 Complicated not well designed account settings

    I use my account for everything, but when I want to update my apps, it shows me my cousins account. How do I delete his account and then use mine? It's on a iPhone 5

  • External Procedure Call: Temporary Blob Array out.

    Hello, I am having difficulty getting out an array of blob from the external procedure call interface. I am trying to create an array of blob initialized with temporary blobs. I was successfully able to create single blob parameter out but no success