When double clicking on alv ,want to get the column name

Hello there,
    I'm displaying the value of internal table in an alv using Reuse_alv_grid_display method ,using fieldcatalog.I want to know the column name when double clicking on a particular line .If the the fieldname is 'MATNR' then i want to check that column name.
    If anybody have any idea plz terply me.
Thanking you neon

for that you have to use the USER_COMMAND event.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
   I_CALLBACK_PROGRAM                = sy-repid
   I_CALLBACK_USER_COMMAND      = 'USER_COMMAND'
   IT_FIELDCAT                       = it_fcat
  TABLES
    t_outtab                          = itab
EXCEPTIONS
   PROGRAM_ERROR                     = 1
   OTHERS                            = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
FORM USER_COMMAND using ucomm type sy-ucomm
                                               selfield type slis_selfield.
data: fieldname(30).
case ucomm.
when '&IC1'.
case selfield-fieldname.
   when 'MATNR'.
    message 'clicked on Matnr' type 'I'.
   when 'POSNR'.
   endcase.
endcase.
ENDFORM.

Similar Messages

  • Reading csv file how to get the Column name

    Hi,
    I am trying to read a csv file and then save the data to Oracle.
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection c = DriverManager.getConnection("jdbc:odbc:;Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=.;Extensions=csv,txn");
    Statement stmt = c.createStatement();
    ResultSet rs = stmt.executeQuery("select * from filename.csv");
    while(rs.next())
       System.out.println(rs.getString("Num"));
    My csv file looks like this:
    "CHAM-23","COMPANY NAME","Test","12",20031213,15,16
    Number,Environ,Envel,Date,Time
    "1","2",3,"4",5
    "6","7",8,"9",9
    Now is there anyway using the above code I start processing the file from the second row that holds the names of the columns and skip the first row. And also can I get the name of the column using ResultSet something like:
    if columnName.equals("Number")
    Because I may have a csv file that could have more columns:
    "CHAM-24","COMPANY NAME","Test","12",20031213,16,76
    Number,Environ,Envel,Date,Time,Total,Count
    "1","2","3","4","5",3,9
    "6","7","8","9",9",,2
    So I want to get the column name and then based on that column I do some other processing.
    Once I read the value of each row I want to save the data to an Oracle Table. How do I connect to Oracle from my Application. As the database is on the server. Any help is really appreciated. Thanks

    The only thing I could think of (and this is a cluj) would be to attempt to parse the first element of each row as a number. If it fails, you do not have a column name row. You are counting on the fact that you will never have a column name that is a number in the first position.
    However, I agree that not always placing the headers in the same location is asking for trouble. If you have control over the file, format it how you want. If someone else has control over the file, find out why they are doing it that way. Maybe there is a "magic" number in the first row telling you where to jump.
    Also, I would not use ODBC to simply parse a CSV file. If the file is formatted identically to Microsoft's format (headers in first row, all subsequent rows have same number of columns), then it's fine to take a shortcut and not write your own parser. But if the file is not adhering to that format, don't both using the M$ ODBC driver.
    - Saish
    "My karma ran over your dogma." - Anon

  • My iMac locks up constantly in email. I click on one or two emails. Then when I click on another email, I get the spinning wheel and have to relaunch. Why does it get confused and lock up?

    My iMac locks up constantly in email. I click on one or two emails. Then when I click on another email, I get the spinning wheel and have to relaunch. Why does it get confused and lock up? Seems like it is stuck.

    10.6.8 here, MacBook Pro. Comcast. Mail  freeze ups. Occasional warnings to use "Log Out" under the Apple icon.
    Disk Repair run several times. Shows lots of Java  "remote" issues.
    I run Disk Repair several times, shows a lot of Java, "remote" issues.
    Restart don't know if it helps, I do it all the time. What's with quitting Mail but it doesn't quit, and why a separate maneuver to "Log Out".
    i

  • HT4623 I updated my iPhone 4s and cannot access Passbook. When I click on App Store, I get the following message "cannot connect to iTunes Store." How do I correct this?

    I updated my iPhone 4s and cannot access Passbook. When I click on App Store, I get the following message: "cannot connect to iTunes Store." How do I correct this problem?

    That's because there are not enough apps that use Passbook yet. Wait.

  • When i click to open itunes i get the disclaimer, i click AGREE and the program wont open

    when i click to open itunes i get the disclaimer, i click AGREE and the program wont open    HELP

    Refer to this article to remove SC files:
    http://support.apple.com/kb/TS2363
    Then Repair your Quicktime. START / CONTROL PANEL / PROGRAMS N FEATURES / hightlight QUICKTIME and click REPAIR.

  • Getting the column names dynamically

    hi gurus,
    i have list item populated with many table names from a schema.
    i have grid in oracle forms 10g and i want to fill the grid with the data that should come at least four/more columns.
    i want to fire the list change trigger when each time any one table name is selected/changed.
    how can i get the column names dynamically
    please give me the step by step process
    for filling the grid..

    hi ,
    by getting column names dynamically i am creating a record group
    using this below query
    SELECT COLUMN_NAME, DATA_TYPE FROM USER_TAB_COLUMNS WHERE TABLE_NAME = <table_name>
    but when timestamp datatype is there then it is showing error cannot create group groupname
    but the record group is running successful on varchar2,number,date dayatypes
    if any alternative is there i mean to say without using record group then tell me or where is the problem

  • 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

  • Help to get the column names from ResultSet.

    Hi,
    I hava a ResultSet and i want the column names into a String Array.
    i wrote the code to get the column names as below,
    String s = "select Dept_No,Dept_Name from tb_dept";
    rs = statement.executeQuery(s); // ResultSet defined before
    String[] columnNames1 = null;
    ResultSetMetaData meta = rs.getMetaData ( ) ;
    for (int x = 1; x <= meta.getColumnCount(); x++)
    columnNames1[x] = meta.getColumnName(x).toString();
    but i'm getting NullPointer exception. However if i print the column names means its printing the first column name and giving NullPointer Exception at the next step.
    Can anyone help me...
    Thanks,
    Rashmy

    but rs.getRow() ll give the current roe no right?
    but we can move to the last row using last() method
    and get the row count right?
    thank you yaar.
    private int getRowCount(ResultSet resultSet){
            int total = 0;
            try{
                resultSet.afterLast();
                if(resultSet.previous()) total = resultSet.getRow();
                resultSet.beforeFirst();
            }catch(SQLException sqle){
                javax.swing.JOptionPane.showMessageDialog(null,sqle);
            return total;
        }

  • Get the column names of a query (in own plugin)

    Hi,
    I'm developing my first plugin. It is a region plugin where the plugin-user passes a sql query as the source that the plugin will turn into a formated report.
    I found how to retreive the query result by using APEX_PLUGIN_UTIL.GET_DATA functions. Since it is an array, it is simple to cycle through the data rows. But how can i figure out
    1) how many columns the query returns
    2) whats the name of the columns is?
    Thanks a lot in advance for any hint...
    Cheers, Hans

    Hi Hans,
    the package APEX_PLUGIN_UTIL provides everything you need. No need to do your own DBMS_SQL handling!
    Have a look at the API documentation and the example of GET_DATA at http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_plugin_util.htm#BABFBIJD
    The t_column_value_list record type is a two dimensional array defined as
    type t_column_value_list  is table of wwv_flow_global.vc_arr2 index by pls_integer;The first array contains an entry for each column.
    l_column_value_list.COUNTcan be used to get the number of columns.
    l_column_value_list(1).COUNTcan be used to get the number of rows. An example to iterate over all columns and rows:
    for l_column in 1 .. l_column_value_list.count loop
        for l_row in 1 .. l_column_value_list(l_column).count loop
            sys.htp.p('column#=' || l_column || ' row=' || l_row || ' value: ' || l_column_value_list(l_column)(l_row));
        end loop;
    end loop;If you need the name of the columns and maybe the original data type and not everything converted to VARCHAR2 you have to use the more sophisticated GET_DATA2. See http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_plugin_util.htm#BABFJHAI
    This function returns the record type t_column_value_list2 which is defined as
    type t_value is record (
        varchar2_value      varchar2(32767),
        number_value        number,
        date_value          date,
        timestamp_value     timestamp,
        timestamp_tz_value  timestamp with time zone,
        timestamp_ltz_value timestamp with local time zone,
        interval_y2m_value  interval year to month,
        interval_d2s_value  interval day to second,
        blob_value          blob,
        bfile_value         bfile,
        clob_value          clob );
    type t_value_list is table of t_value index by pls_integer;
    type t_column_values is record (
        name       varchar2(32767),
        data_type  varchar2(20), /* use c_data_type_* constants to compare */
        value_list t_value_list );
    type t_column_value_list2 is table of t_column_values         index by pls_integer;Again, it's some kind of two dimensional array. The first dimensions are the columns. But this time you also get some details of the parsed column. For example:
    for l_column in 1 .. l_column_value_list2.COUNT loop
        sys.htp.p('Column Name: ' || l_column_value_list2(l_column).name || ' Data Type: ' || l_column_value_list2(l_column).data_type );
    end loop;Will return you all the columns of the SQL statement. Using "name" and "data_type" you can get the column name and the data type. To access the values you can use
    for l_column in 1 .. l_column_value_list2.COUNT loop
        sys.htp.p('Column Name: ' || l_column_value_list2(l_column).name || ' Data Type: ' || l_column_value_list2(l_column).data_type );
        for l_rows in 1 .. l_column_value_list2(l_column).value_list.COUNT loop
            sys.htp.p(
                'row=' || l_row || ' value: ' ||
                apex_plugin_util.get_value_as_varchar2 (
                    p_data_type => l_column_value_list2(l_column).data_type,
                    p_value     => l_column_value_list2(l_column).value_list(l_row) );
        end loop;
    end loop;I used apex_plugin_util.get_value_as_varchar2 to always get a VARCHAR2, independent of the actual data type of the column. If you need the original data type, use "number_value", ... of the t_value record type.
    Hope that gives you a direction
    Patrick
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Need help on getting the column names of Tabletype

    I have a table Mapping with the following values: This Mapping table contains the table names (in Tabname) and the column names(colname) of various tables and values(ValuesTobeFilled) for the columns.
    I have to insert into the tables present in the Tabname field with the values present in the ValuesTobeFilled in the columns present in the Colname field.
    Note: The Mapping table need not contain all the columns of the base table. The columns that are not present can be filled with null. And this mapping table is not fixed i.e. rows can be inserted/deleted frequently.
    Sample values in mapping table:
    Tabname                        Colname        ValuesTobeFilled
    sample_items     Eno     Corresponding Expression to get the values from XML input
    sample_items     Ename     Corresponding Expression to get the values from XML input
    XXX     YYY     Corresponding Expression to get the values from XML input
    Before filling in the actual tables, I have to store the entire data temporarily and I have used a tabletype declared as follows:
    TYPE T_sample_items IS TABLE OF sample_items%ROWTYPE INDEX BY BINARY_INTEGER;
    l_sample_items T_sample_items;
    Where the table sample_items have the following columns:
    •     Eno
    •     Ename
    •     Eaddress
    •     Eemail
    So, the tabletype should be filled as:
    Eno     Ename     Eaddress     EEmail
    1     XXX     -     -
    I have declared a cursor to select the values from mapping table and I need to fill in the ValuesTobeFilled values to the corresponding table.
    CURSOR c_xpath (c_tname mapping.TABNAME%type)
    IS
    select * from mapping where tabname = c_tname;
    CURSOR c_tables
    IS
    SELECT DISTINCT TABNAME FROM mapping;
    FOR crsr IN c_tables
    LOOP
    p_tname := CRSR.TABNAME;
    FOR csr IN c_xpath(p_tname)
    LOOP
    IF l_xml_doc.EXISTSNODE(CSR.XPATH_EXP) = 1
    THEN
    l_node_value := l_xml_doc.extract(CSR.XPATH_EXP).getStringVal(); -- This is the value to be stored in the corresponding column
    ELSE
         l_node_value := NULL;
    END IF;
    IF CSR.COLUMN_NAME = ‘eno’
    THEN
         l_sample_items(1).eno := l_node_value;
    ELSIF CSR.COLUMN_NAME = ‘ename’
    THEN
         l_sample_items(1).name := l_node_value;
    END IF;
    END LOOP;
    END LOOP;      
    And I need to eliminate hard coding while comparing the column names (in the following piece of code) as the Mapping table values are subject to insertion/deletion:
    IF CSR.COLUMN_NAME = ‘eno’
    THEN
         l_sample_items(1).eno := l_node_value;
    ELSIF CSR.COLUMN_NAME = ‘ename’
    THEN
         l_sample_items(1).ename := l_node_value;
    END IF;
    I need to insert the values directly into the tabletype without this hardcoding. Please suggest me ways to compare the mapping table values with the field (column) names of the tabletype. If it is not possible using tabletype, please suggest any other ways of fixing the problem.
    Many thanks,
    Gopi

    I take it this isn't going to be a serious production system at the end of the day?
    Storing metadata in tables for extraction and insertion of data is just wrong in so many ways. It smells heavily of Entity Attribute Value modelling, which is the most wrong way to use a relational database and is known to have major performance implications and be liable to bugs and issues. The idea that EAV modelling allows for 'generic' databases where new data items can be added flexibly later on without having to change code is usually justified with an excuse of "it means we don't have to update all our tables when we want a new column" which is easily countered with "if you're adding a single column a good relational design wouldn't require you to add it to more than one table anyway in most cases".
    Just what exactly are you trying to do and why? There has to be a better way.

  • Problem Getting the Column name in the BPEL Problem.

    I have created one Variable Assume the name Nptf. I want to get the name of the Variable and Store it in another variable. Is there any possibility to do that.
    Thanks in advance
    Regards
    GSR

    I do not understand your question. How would you identify the variable whose name you want to copy, if not by name?
    Marc

  • How to get the Column names of output that is displaying in Sql Developer(Oracle 11g).

    Hi,
        I am using OCCI to interact with DB through code, which means I am writing a vc++ file to interact with Data Base and execute the Stored Procedure which I am calling from the C++ Code. And  also displaying the output of the Stored Procedures to the Front End. I am succeeded in this, but now I should be able to display  the Column names of the output to Front End. Can any one help me on this.
    Example:
    Sno  |   Sname
    ------- |-------------
    1          ABC
    2          DEF
    I am getting (1,ABC) and (2,DEF) as the output of the Stored Procedure but I need the Column names also to display. How to get them.
    Thanks in Advance..:)

    Look at Re: exporting csv via pl/sql - select statement?
    It has an example how to extract the column name from a cursor. You have to check, whether you can use DBMS_SQL.DESCRIBE_COLUMNS
    Your procedure might need another out parameter, that returns the column names , e.g. as comma separated list or as varray.

  • How can i get the column names in CSV file.

    Hi,
    After execution of infospoke i can not see the column names in that file.How can i get column of respective infoprovider?
    Thanks,
    Gananadha Lenka

    Hello Gana,
    Actually while exporting the data using Info Spoke, we have the possibility to modify the data that we send. This is possible using transformations.
    In your Info Spoke, you have a tab called Transformations.
    Here you need to create an implementation and then use BADi to populate data.
    Check if you can write a start routine sort of thing here and insert a new record into the internal table by hardcoding with your field headings.
    Let me know if you dont know how to create transformations.
    Kris...

  • Problem with iTunes. I have Windows 8 on a new laptop. Installed latest version of iTunes. Can play music in My Library but when I click on Itunes Store I get the message "iTunes has stopped working. A problem caused the program to stop working correctly.

    I have a new laptop with Windows 8 as operating system. Installed latest version of iTunes ontop computer. I can play music in My Library but when I click on iTunes, I get the message " iTunes has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify if a solution is available."
    Anyone know what is the cause and if there is a resolution? Have tried to re-installing iTunes and have also tried restoring laptop to an earlier date.

    iPad not appearing in iTunes
    http://www.apple.com/support/ipad/assistant/itunes/
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/TS1591
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    iTunes for Windows: Device Sync Tests
    http://support.apple.com/kb/HT4235
    IOS: Syncing with iTunes
    http://support.apple.com/kb/HT1386
    Apple - Support - iPad - Syncing
    http://www.apple.com/support/ipad/syncing/
    iTunes 10.5 and later: Troubleshooting iTunes Wi-Fi Syncing
    http://support.apple.com/kb/ts4062
    The Complete Guide to Using the iTunes Store
    http://www.ilounge.com/index.php/articles/comments/the-complete-guide-to-using-t he-itunes-store/
    iTunes Store: Associating a device or computer to your Apple ID
    http://support.apple.com/kb/ht4627
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    Best Fixes for ‘Cannot Connect to iTunes Store’ Errors
    http://ipadinsight.com/ipad-tips-tricks/best-fixes-for-cannot-connect-to-itunes- store-errors/
    Try this first - Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    This works for some users. Not sure why.
    Go to Settings>General>Date and Time> Set Automatically>Off. Set the date ahead by about a year.Then see if you can connect to the store.
     Cheers, Tom

  • HT1725 When I click on a Movie I get the following "You have already purchased this item but it has not been downloaded. To download it, select Check For Available Downloads from the Store menu." Then get err = 11111

    iTunes quit unexpectedly during the download of a movie.  When I click on that movie now I get the following message: "You have already purchased this item but it has not been downloaded. To download it, select Check For Available Downloads from the Store menu."
    I follow the instructions, but the download still doesn't resume - err = 11111
    Any advice?

    Yeah, I am going to blast my iPhone for the 4th time today and pray this goes away. I had 6 apps showing updates, the 6 badge icon shows on the App Store on my iPhone and, having run them all, the 6 apps have two copies each on my iPhone: one that is the old version of the app and will not run and the other is a faded version of the app with an empty progress bar on the icon. Click those and you get an error message about connecting to iTunes, etc. as described in the article I linked to above.
    It gets stranger than this. If I install a completely NEW app, the 6 that are stuck mid-update heal themselves and appear with the new version only, however now completely different apps (Hold Em for instance - which I did not update and didn't need an update) will not launch "app name Cannot Launch" message comes up.
    Agh!

Maybe you are looking for

  • SQL*LOADER/SQL usage in Migration

    I have very limited migration requirements. I DO NOT need to migrate a database. I DO need to change some SQL and BCP load scripts from SQL-SERVER 6.5 to their equivalents in ORACLE 8.0.5. For this limited purpose, should I proceed to handcode these,

  • HT1222 Problem downloading I.O.S. 6 for I phone 4

    I recently just triend to download the I.O.S. 6 update to my I phone 4 but as it finished I got an error message saying unknown error (9006) what do I do?

  • PI SLD Problem

    Hello, When we are trying to open SLD in PI server ,i got the following error in trace files.Please help me to resolve this problem. defaultTrace_00.9.trc:#1.#00212816975C00130012057400002485008FD81383FDC17E#1290596724425#com.sap.engine.services.serv

  • Help Editing code from a published html file with flash detection enabled from flash

    hi guys ive publish a html file with flash detection enabled from flash heres the code from the publish html: <!-- saved from url=(0013)about:internet --> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"

  • Problems with photo streaming

    I have downloaded icloud on my Iphone 4, ipad and pc with windows 7 and i am having problems streaming photos. I have everything turned on and i am at home with good wi-fi yet i can't get any of the photos that i take on my phone to stream onto ither