How to read the column name of the Table.

hi
   I have applied sort functionality to the Table columns. It is working fine but I need to read the table column name before sorting ( On which column user trying to sort ).
   Thank you all,
Rama...

Hi Alex
   Thank you very much for your valid input.
But I am facing one problem here. To get sort functionality I added following logic in WDDOMODIFYVIEW method.
  DATA wd_table TYPE REF TO cl_wd_table.
  CHECK first_time = abap_true.
  wd_table ?= view->get_element( 'TABLE_NAME' ).
  wd_this->table_control ?= wd_table->_method_handler.
  wd_this->table_control->set_key_attribute_name( 'COL_NAME1' ).
here I hard coded first column name(i.e. COL_NAME1). Is it correct?
  and added following code in SORT ACTION of table i.e.
wd_this->table_control->apply_sorting( ).
To get column name I am using the method in SORT ACTION of table which you mentioned but always I am getting  COL_NAME1 only....
Please help me how can I rectify this...
Thank you
Rama

Similar Messages

  • How to read the column name of a table from sap system using C#?

    Hi!!
    I am using SAP .NET connector and creating a windows application.
    Now I wanna read the column name when a table name is given....
    Connection is done, but I don't know the code to read the column names alone...
    Can anyone help me with the code??

    fine!!
    So if i give the table name, which the RFC_READ_TABLE function module have, will it run properly? or i wanna change all the codes in order to support RFC_READ_TABLE function module?
    Because from the beginning I was using BAPI_CUSTOMER_GETLIST function, but my client requirement is to use ERP function module RFC_READ_TABLE, he didn't give any table name also..
    This is my code: What I have to change in this???
    ECCDestinationConfig ECCDestination = new ECCDestinationConfig();
                RfcDestinationManager.RegisterDestinationConfiguration(ECCDestination);
                RfcDestination rfcDest = null;
                rfcDest = RfcDestinationManager.GetDestination(a);
                    RfcRepository repo = rfcDest.Repository;
                    IRfcFunction customerList = repo.CreateFunction("BAPI_CUSTOMER_GETLIST");
                    IRfcTable addressData = customerList.GetTable("AddressTable"));
                    int j = addressData.Metadata.LineType.FieldCount;
                    for (int i = 0; i < j; i++)
                        RfcElementMetadata metadata = addressData.GetElementMetadata(i);
                        listallcolumn.Items.Add(metadata.Name);
    Message was edited by: Jeswin Rebil

  • How to display the column names of a table in the output

    Hi,
    I want to display the name of the columns of the table without using literals in a abap report.
    EX: Consider the table KNA1
    KUNNR NAME  ADDRESS
    I want to display the column names in the above fashion without using hardcoded write statements.
    Thanking in anticipation

    You can use this FM <b>DDIF_FIELDINFO_GET</b> It gives you all the names related to fields in a table -:)
    Greetings,
    Blag.

  • How to get the column names of the table into the Dashboard prompt

    how to get the column names of the table into the Dashboard prompt
    Thanks & Regards
    Kishore P

    Hey john,
    My requirement is as follows
    I have created a Rank for Total sales by Region wise i.e RANK(SUM(Dollars By Region)) in a pivot table.
    My pivot table looks like this
    COLUMN SELECTOR: TOTAL US , REGION , DISTRICT , MARKET
    ---------------------------------------------------- JAN 2009          FEB 2009        MAR 2009
    RANK              REGION                  DOLLARS           DOLLARS        DOLLARS DOLLARS
    1 CENTRAL 10 20 30 40
    2 SOUTHERN 10 30 30 70
    3 EASTERN 20 20 20 60
    4 WESTERN 10 20 30 40
    When i select the District in column selector
    Report has to display rank based on Total Sales by District. i.e
    ------------------------------------------------- JAN 2009         FEB 2009       MAR 2009
    RANK             DISTRICT              DOLLARS           DOLLARS        DOLLARS DOLLARS
    for this i need to change the fx of rank i.e RANK(SUM(Dollars By Region)) to RANK(SUM(Dollars By District)) and fx of Region i.e Markets.Region to Markets.District dynamically.
    so , i need to capture column name of the value selected from the column selector and dynamically i need to update the fx 0f RANK & fx of region.
    do you have any solution for this?
    http://rapidshare.com/files/402337112/Presentation1.jpg.html
    Thanks & Regards
    Edited by: Kishore P on Jun 24, 2010 7:24 PM
    Edited by: Kishore P on Jun 24, 2010 7:28 PM

  • How can I list all the column names of a table by programming?

    Hi,
    Now I want to write an function which has the following features:
    Firstly, The function was given a parameter as table name.
    Then, it will lists all the columns names of the table.
    e.g
    table: person
    ---firstName------lastName----+
           Michale               Jackson
    We can get the columns 'firstname' and 'lastName' by calling the function with table name 'person'.
    And I also wonder that where I can get reference book or any other materials?
    Thanks.
    Edited by: wenjing wang on Feb 15, 2008 6:42 AM
    Edited by: wenjing wang on Feb 15, 2008 6:57 AM

    hi,
    hope the below code helps u. Just take the headee which contains the field name and split it like below and compare it with the field name u want here 'last name'.
    here,
    'First name' will be in wt_filedata1 and remaining field names in wt_filedata2, so 'do' continues.
    c_tab must be the separator, either , or + or tab etc..
    CODE:
    read table person into wl_header index 1.
    do.
        split wl_header at c_tab into: wt_filedata1 wt_filedata2.
        if wt_filedata1 <> 'lastname'.
          cnt1 = cnt1 + 1.
          wl_header = wt_filedata2.
        else.
          exit.
        endif.
      enddo.
    Please reward if it is useful.
    regards,
    sri

  • How to select even the column names of a table?

    Hello All,
    Is there a way to select even the column names of a table in the select statement?
    My select from a table (say X) is in a SQL* Plus script that gets invoked by application tier and displays data in the application tier window. User's can then copy the data into a spreadsheet and do their processing. However, I need to give them the column names too along with the data.
    Thanks,
    Chiru

    If there is a middle tier that is selecting and
    displaying the data, and that's what the users are
    copying from, the middle tier would have to address
    its presentation of the data to allow users to
    include column names. If this is a common task, the
    application should probably be modified to give users
    the option of downloading the data in a spreadsheet
    directly rather than forcing them to copy and paste
    data.Thanks for the reply.
    The users don't have to copy paste. The application tier has an options in the "Tools" menu item which allows them to copy the entire output to a file (in my case a txt file which is a pipe delimited). Then they have to do text to columns to get the data into each column of the spreadsheet. I could have directly called the stored procedures from the application tier and created ".csv" files and FTP'd them to the user's folders. However, I am having to go this round about because, I am not getting enough support from the LAN team in FTP'ing etc.
    OK I'll think of another workaround.
    Thanks,
    Chiru

  • Set the column name of a table in a list box

    is there any code to set the column name of a table in a list box at oracle devloper 6i?
    pls help.

    I dont want to go for pl/sql . It should work any table.You want Dynamic SQL without using PL/SQL? Tricky. I'm sure there's a possible way using some very complex and convoluted XML functionality of SQL but in reality you are asking for something that isn't natural to SQL queries, especially if you are expecting a dynamic number of columns to be produced for each row of data. SQL expects a table structure, including output formats, to be a defined number of columns with any number of rows, not a defined number of rows with any number of columns.
    Perhaps if you explain why you need this sort of functionality then we may be able to offer a better solution.
    ;)

  • How to rename a column name in a table? Thanks first!

    I tried to drop a column age from table student by writing the
    following in the sql plus environment as :
    SQL> alter table student drop column age ;
    but I found the following error
    ORA-00905: &#32570;&#23569;&#20851;&#38190;&#23383; (Lack of Key word)
    I have oracle enterprise edition 8.0.5 installed at windows 2000
    thank you
    And I want to know how to rename a column name in a table?
    thanks

    In Oracle 8i, your syntax would have worked.  However, if I
    recall correctly, in Oracle 8.0, you can't rename or drop a
    column directly.  One way to get around that problem is to
    create another table based on a select statement from your
    original table, providing the new column name as an alias if you
    want to change the column name, or omitting that column from the
    select statement if you just want to drop it.  Then drop the
    original table.  Then re-create the original table based on a
    select statement from the other table.  Then you can drop the
    other table.  Here is an example:
    CREATE TABLE temporary_table_name
    AS
    SELECT age AS new_column_name,
           other_columns
    FROM   student
    DROP TABLE student
    CREATE TABLE student
    AS
    SELECT *
    FROM   temporary_table_name
    DROP TABLE temporary_table_name
    Something that you need to consider before doing this is
    dependencies.  You need to make a list of all your dependecies
    before you do this, so that you can re-create them afterwards. 
    If there are a lot of them, it might be worthwhile to do
    something else, like creating a view with an alias for the
    column or just providing an alias in a select.  It depends on
    what you need the different column name for.

  • How to know the column name using the index name for a particular table

    Hi All,
    I have small query regarding, I have index name and table name so by using this how can I know the column name associated with that index of that particular table specific to Oracle9i.
    Thanks
    Sudheer

    select *
    from user_ind_columns -- or all_ind_columns
    where table_name = UPPER('&table_name')
    and index_name = UPPER('&index_name');
    Regards
    Arun
    Gurgaon

  • How To Know The Column Name Of The Internal Table

    HI ,
            i have an internal table .
    f1          f2           f 3         f4            f5  
    matnr   mbrsh    mtart     meins       minbe
    i want to know the column name which depending on the value i.e . if it is matnr then f1 , if mbrsh it is f2 ..so on
    Thanks.

    Hi ,
          thanks for your replies . i am elaborating my query .
            I have an internal table with 80 fields i.e.f1,f2,f3......f80 . In the first index i will be having the fieldnames
    i.e.matnr , mbrsh , meins , mtart ..... . From second index onwards i will be having the corresponding data  for the field name.  i need to display a particular field in a table control . Here i will be knowing the fieldname. If i can get to know the column name i.e whether f1 or f2 or ... .i Can populate the data into the table control.
    Wht i have done is taken a field symbol  and used the following code.
    read table i_upload index 1  assigning <lv_upload>.
    here i will get the initial first record i.e
    F1                                             MATNR
    F2                                             MBRSH
    F3                                             MTART
    F4                                             WERKS
    F5                                             LGORT
    F6                                             VKORG
    F7                                             VTWEG
    F8                                             MAKTX
    F9                                             MEINS
    F10                                             MATKL
    F11                                             BISMT
    F12                                             BRGEW
    F13                                             GEWEI
    F14                                             NTGEW
    F15                                             GROES
    F16                                             KLART
    F17                                             CLASS
    F18                                             SPART
    F19                                             VRKME
    F20                                             UMREN
    now i want to the field name .
    Hope it is clear this time .
    Thanks.

  • How to call the column names into the prompt and display values dynamically

    Hi,
    i have a typical requirement where I have to call 3 columns into the AGE Prompt (I know we can use the Column Selector to call the columns) .Below is the Screen Shot.
    !http://i46.tinypic.com/2qjfukh.jpg!
    2nd Requirement)
    The three columns I have are order Date, Ship Date and Entry Date.
    Whenever I click on Orderdate from the Prompt, It should dynamically show its values in the report.
    and When I click on the Ship Date from the Prompt, it should display the corresponding values in the report.
    and so on with the Entry Date.
    Can anybody help me how to acheive this.
    Thanks a ton.

    Ok so then you can use a fake column prompt. Here's one quick approach (nicer and cleaner with LOV tables but I don't if you have any of those).
    - Create a fresh prompt using any column you want.
    - Open the column formula using the fx button and replace the formula with 'abc'.
    - Use "SqL Results" as the "Show" option.
    - SQL:
    select case when 1=0 the Markets.Region else 'Order Date' from Paint.Markets UNION ALL
    select case when 1=0 the Markets.Region else 'Ship Date' from Paint.Markets UNION ALL
    select case when 1=0 the Markets.Region else 'Entry Date' from Paint.Markets
    - Set Variable = Presentation Variable = @{vPresVarSelectedDate}{Order Date}
    - Label = Date
    Then in the request, you change the column formula for the date. I'm going to make it short and just assume you called your time dimension alias(es) like the lowest grain:
    "@{vPresVarSelectedDate}{Order Date}"."@{vPresVarSelectedDate}{Order Date}"
    Cheers,
    C.

  • Rename the Column Name in the Repository

    Hi,
    after creation the Repository and some Answers I want to change the name of some columns in the Repository (Presentation Layer or Busines Layer).
    After changing this column names the answers will not work any more until I replace the columns in answers.
    Has got somebody experience with changing column names in Repository and Catalog without replacing the columns in answers?
    Regards,
    Stefan

    Rename the objects in the Business Model Layer and that would get automatically reflected in Presentation Layer. In order for presentation layer to remain constant just double click on the columns and uncheck the "Use Logical Column Names". This would ensure that your presentation layer is not renamed when you rename the BM.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • How to get only column names from different tables as single table columns

    Hi All,
       I have one requirement in which we want only column names from different tables.
    for example :
     I have three tables T1 ,T2, T3 having
      col1 clo2 clo3 -->  T1 , 
      col3 col5 ,clo6 --> T2 ,
      Clo6 col8 col9 --> T3
    columns i want to get only all  Column names from all table as single Resultset not any data from that how can i get that empty resultset 
    because this empty result i want to bind in datagridview(front end) as Empty resultset 
    Please tell me anyways to do this
    Niraj Sevalkar

    If I understand you want an empty result set, just with metadata. SET FMTONLY do the trick:
    SET FMTONLY ON
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    SET FMTONLY OFF
    Another alternative is to include an imposible contition
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    WHERE 1 = 0
    If you are using a SqlDataAdapter in your client application. You can use the FillSchema method. the select command may be any select statement that returns the columns you want. Under the covers FillSchema will call SET FMTONLY ON.
    If you are using SqlCommand.ExecuteReader you can pass SchemaOnly to CommandBehavior argument. SET FMTONLY ON is called under the covers. Again the select command may be any select statement that returns the columns you want.
    "No darás tropezón ni desatino que no te haga adelantar camino" Bernardo Balbuena

  • Should the column name in the not in clause be indexed?

    Hi, Everyone,
    I am having oracle database version 11.0.1.6 on windows server 2003 R2.
    I have a query like this:
    Select * from icm
    where customer_no not in (select customer_no from icm_pre);
    I would like to know whether we should index the customer_no column in icm_pre table too? I have indexed customer_no column in icm.
    Will there be a better performance if i index both the columns in the 2 tables?
    Thanks

    user10636796 wrote:
    | Id  | Operation                      | Name                           | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | INSERT STATEMENT               |                                |     1 |   147 |   764   (1)| 00:00:10 |
    |   1 |  LOAD TABLE CONVENTIONAL       | ICM_UPSEL_0_ALL                |       |       |            |          |
    |   2 |   HASH GROUP BY                |                                |     1 |   147 |   764   (1)| 00:00:10 |
    |   3 |    NESTED LOOPS                |                                |       |       |            |          |
    |   4 |     NESTED LOOPS               |                                |     1 |   147 |   763   (1)| 00:00:10 |
    |*  5 |      HASH JOIN RIGHT ANTI NA   |                                |     1 |    78 |   687   (1)| 00:00:09 |
    |   6 |       TABLE ACCESS FULL        | ICM_UPSEL_1_ALL                | 18556 |   235K|    68   (0)| 00:00:01 |
    |*  7 |       TABLE ACCESS FULL        | ICM_UPSEL_MIN_PRDIFF_0         |   223K|    13M|   618   (1)| 00:00:08 |
    |*  8 |      INDEX RANGE SCAN          | PRICE_DIFF_IDX                 |    84 |       |     3   (0)| 00:00:01 |
    |*  9 |     TABLE ACCESS BY INDEX ROWID| ICM_PRE                        |     1 |    69 |    76   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    5 - access("A"."PR_CODE_BBL"="PR_CODE_BBL")
    7 - filter("A"."FLAG"=0 AND "A"."PRICE_DIFF">0 AND "A"."SCORE">=0.5 AND "A"."PRICE_DIFF"<=10)
    8 - access("A"."PRICE_DIFF"="B"."PRICE_DIFF")
    filter("B"."PRICE_DIFF"<=10 AND "B"."PRICE_DIFF">0)
    9 - filter("B"."SCORE">=0.5 AND "B"."FLAG"=0 AND "A"."CUSTOMER_NO"="B"."CUSTOMER_NO" AND
    "A"."PR_CODE_BBL"="B"."PR_CODE_BBL" AND "A"."SCORE"="B"."SCORE")
    How many rows are there in ICM_UPSEL_MIN_PRDIFF_0, how many match the "constant" predicates, is there an efficient way of finding them, how many will be left after you apply the subquery test.
    Ditto for ICM_PRE, and do the figures look like if you apply the subquery to ICM_PRE (which seems possible)
    What's the most precise path for joining the two main tables - and is there a supporting index for that join
    Notice that you have a duplicated predicate in your original query - is the query correct ?
    Notice that the subquery has turned into a "null aware anti join" - so changing the NOT IN to a NOT EXISTS (suggested by another poster) is not logically the same query - do you have a missing constraint (or two) which might help the optimizer find a better path.
    Regards
    Jonathan Lewis

  • Changing the Column name of a table horizontally

    Hi ,
    I have a table named emp.
    Empno Sal
    10 1000
    20 2000
    30 3000
    40 4000
    I need the output like
    Empno 10 20 30 40
    sal 1000 2000 3000 4000
    Note: It should work for any table. Also not the column & row mapping which should be synchronised like the original structure.

    I dont want to go for pl/sql . It should work any table.You want Dynamic SQL without using PL/SQL? Tricky. I'm sure there's a possible way using some very complex and convoluted XML functionality of SQL but in reality you are asking for something that isn't natural to SQL queries, especially if you are expecting a dynamic number of columns to be produced for each row of data. SQL expects a table structure, including output formats, to be a defined number of columns with any number of rows, not a defined number of rows with any number of columns.
    Perhaps if you explain why you need this sort of functionality then we may be able to offer a better solution.
    ;)

Maybe you are looking for

  • Multiple email accounts in Thunderbird, but email always sent out from just one no matter which i use - how do I stop that?

    I have multiple email accounts on TB. however, whenever I send an email from any of the other accounts, when the email arrives it shows as having been sent from the email account I first set up on TB. even if i am replying to an email received, the r

  • No mouse or sound on my new W7 Bootcamp Install - PLEASE HELP!!

    I recently installed a new copy of Windows 7 on my MacBook Pro using BootCamp 3.2.  Now my Windows will not connect with my mouse via bluetooth.  I can no longer hear sound from my onboard speakers either.  I get sound out  headphone jack but that's

  • Incorrect number of data lines in TST03

    Hi, one of our scheduled jobs is being cancelled with no errors but those found on SP12 - Consistency Check: Incorrect number of data lines in TST03 Any idea of what might be happening? SM21 reports the following: Error 13 for write/read access to a

  • Three Finger Zoom

    Anyone here who's having problem with the iPod touch 5th Gen, 3 Finger Zoom? Before, it does work but a certain point, it stopped recognizing the 3 finger zoom. For me to be able to use the said function, i have to reset all the settings of the iPod

  • PXI 6602 +BNC-2121 +LabView 7.0

    Hello, I am using a PXI 6602 with BNC-2121 Connector Accessory and LabView 7.1 to measure a time in a cams programmer (it is composed by a motor, cams, microswitches. The cams rotate and commutate the microswitch state). I need to use all eight count