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

Similar Messages

  • How can I display all the columns on the screen without scrolling from side to side?

    My clinic software has many columns. How can I display all the columns without having to scroll from left to right all the time?

    If the software you are using doesn't offer the ability to increase or decrease document size, as many do, then the only way is to increase your screen resolution. If that's not possible, maybe you can decrease your font size?  If you can't do any of these, I think you're out of luck!

  • How can I list all the domains configured for Weblogic Servers?

    How can I list all the domains configured for Weblogic Servers?
    I saw a note, which says the following:
    "WebLogic Server does not support multi-domain interaction using either the Administration Console, the weblogic.Admin utility, or WebLogic Ant tasks. This restriction does not, however, explicitly preclude a user written Java application from accessing multiple domains simultaneously."
    In my case, I just want to list all the domains, is that possible by using any scripts?
    Thanks
    AJ

    If you use WLS Node Manager and the Config Wizard was used to create the domains, then the list of domains should be in a location like this:
    <MIDDLEWARE_HOME>\wlserver_10.3\common\nodemanager\nodemanager.domains
    Enterprise Manager Grid Control also has support for multi-domain management of WLS in a console.

  • How can i display all the query items to a table?

    how can i display all the query items to a table in a jsp file?
    i always have an out of memory error..

    any body??any idea?
    is it possible thru configuration or i have to write a program by the abaper??
    Biswa

  • With Apple Remote Desktop How can I change all the computer names

    After a re-imaging session?. I would like to not have to visit each station and manually change the computer name.
    Is this at all possible using ARD?

    Hi
    I don't use DeployStudio and know nothing about it. In terms of simply changing the names? Yes. Clearly not in the same way. You could use what's built-in on OSX Server if you have it? System Image Utility allows creation of nbis with an associated workflow that can define workstation names from a pre-prepared list of MAC Addresses and desired names as a Post-Install Action.
    This is fairly well-documented in the Server Forum and elsewhere.
    HTH?
    Tony

  • How can I get ALL the user info from WWW_FLOW_FND_USER -table?

    Hi.
    I use HTML DB authentication and therefore all my user information is stored in HTML DB tables. I can use :APP_USER to get USER_NAME, but in my application I need to have also USER_ID, FIRST_NAME, LAST_NAME and EMAIL_ADDRESS fields from database. I don't want to change any database/schema security level so I cannot read directly from WWW_FLOW_FND_USER -table when I am inside in SCOTT -schema/sec.level.
    How to read all the information?

    Thank you for your help, but I cannot find any information about backage wwv_flow_user_api on OTN or in HTML DB documentation.
    Where to start?

  • How can I dynamically specify a Column Name in a Where Clause of a DB

    I have a page that query the Database based on the column Name and values entered by the user. on this page I have a drop down list of all the Column names and a text field. The user can choose from any of the dropdown list option to set the column Name and also enter a value.How can I dynamically pass the option choosed by the user from the drop down list to the dataProvider in seesionBean1 as a column Name???Help

    Hi,
    This is a working example of a search form.
    In the JSP page we have several texts box, a table bound to a DataProvider with the rowSet in the SessionBean and a search button.
    JSP source:
                    <ui:body binding="#{PackageAirtime.body1}" id="body1">
                        <ui:form binding="#{PackageAirtime.form1}" id="form1">
                            <table border="0">
                                <tr>
                                    <td>
                                        <table border="0" width="100%">
                                            <tr>
                                                <td>
                                                    <ui:label binding="#{PackageAirtime.pageTitle}" id="pageTitle" text="Package Airtime"/>
                                                    <br/>
                                                    <br/>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <table border="0" cellpadding="2" cellspacing="2">
                                                        <tr>
                                                            <td>Package ID:</td>
                                                            <td>
                                                                <ui:textField binding="#{PackageAirtime.textPackageID}"
                                                                    id="textPackageID"/>
                                                                <ui:button
                                                                    binding="#{PackageAirtime.buttonPackageID}" id="buttonPackageID"
                                                                    onClick="handlePackageIDPopup(); return false;" text="..." toolTip="Open package locator"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Airtime Code:</td>
                                                            <td>
                                                                <ui:textField binding="#{PackageAirtime.textAirtimeCode}"
                                                                    id="textAirtimeCode"/>
                                                                <ui:button
                                                                    action="#{PackageAirtime.buttonAirtimeCode_action}"
                                                                    binding="#{PackageAirtime.buttonAirtimeCode}" id="buttonAirtimeCode"
                                                                    onClick="handleAirtimeCodePopup(); return false;" text="..." toolTip="Open airtime code locator"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td></td>
                                                            <td>
                                                                <ui:button action="#{PackageAirtime.searchButton_action}" binding="#{PackageAirtime.searchButton}"
                                                                    id="searchButton" text="Search" toolTip="Search records"/>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                    <br/>
                                                    <ui:staticText binding="#{PackageAirtime.staticTextSearchResults}" id="staticTextSearchResults"/>
                                                    <br/>
                                                    <ui:table binding="#{PackageAirtime.searchResults}" id="searchResults" paginationControls="true">
                                                        <script>
    /* ----- Functions for Table Preferences Panel ----- */
    * Toggle the table preferences panel open or closed
    function togglePreferencesPanel() {
      var table = document.getElementById("form1:table1");
      table.toggleTblePreferencesPanel();
    /* ----- Functions for Filter Panel ----- */
    * Return true if the filter menu has actually changed,
    * so the corresponding event should be allowed to continue.
    function filterMenuChanged() {
      var table = document.getElementById("form1:table1");
      return table.filterMenuChanged();
    * Toggle the custom filter panel (if any) open or closed.
    function toggleFilterPanel() {
      var table = document.getElementById("form1:table1");
      return table.toggleTableFilterPanel();
    /* ----- Functions for Table Actions ----- */
    * Initialize all rows of the table when the state
    * of selected rows changes.
    function initAllRows() {
      var table = document.getElementById("form1:table1");
      table.initAllRows();
    * Set the selected state for the given row groups
    * displayed in the table.  This functionality requires
    * the 'selectId' of the tableColumn to be set.
    * @param rowGroupId HTML element id of the tableRowGroup component
    * @param selected Flag indicating whether components should be selected
    function selectGroupRows(rowGroupId, selected) {
      var table = document.getElementById("form1:table1");
      table.selectGroupRows(rowGroupId, selected);
    * Disable all table actions if no rows have been selected.
    function disableActions() {
      // Determine whether any rows are currently selected
      var table = document.getElementById("form1:table1");
      var disabled = (table.getAllSelectedRowsCount()>0)?false : true;
      // Set disabled state for top actions
      document.getElementById("form1:table1:tableActionsTop:deleteTop").setDisabled(disabled);
      // Set disabled state for bottom actions
      document.getElementById("form1:table1:tableActionsBottom:deleteBottom").setDisabled(disabled);
    }</script>
                                                        <f:facet name="title">
                                                            <ui:staticText binding="#{PackageAirtime.table1Title}" id="table1Title" text="Package Airtime search results"/>
                                                        </f:facet>
                                                        <ui:tableRowGroup binding="#{PackageAirtime.tableRowGroup1}"
                                                            emptyDataMsg="No records matching the search criteria" id="tableRowGroup1"
                                                            sourceData="#{PackageAirtime.s23_package_airtimeDataProvider}" sourceVar="currentRow">
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn1}" headerText="Package ID" id="tableColumn1" sort="S23_PACKAGE">
                                                                <ui:staticText binding="#{PackageAirtime.staticText1}" id="staticText1" text="#{currentRow.value['S23_PACKAGE']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn2}" headerText="Airtime Code" id="tableColumn2" sort="S23_AT_CODE">
                                                                <ui:staticText binding="#{PackageAirtime.staticText2}" id="staticText2" text="#{currentRow.value['S23_AT_CODE']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn7}" headerText="Prepaid Value" id="tableColumn7">
                                                                <ui:staticText binding="#{PackageAirtime.staticText6}" id="staticText6" text="#{currentRow.value['SUBR_AT_PREPAID_PERIOD_VAL']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn8}" headerText="Prepaid Type" id="tableColumn8">
                                                                <ui:staticText binding="#{PackageAirtime.staticText7}" id="staticText7" text="#{currentRow.value['SUBR_AT_PREPAID_TYPE']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn4}" headerText="Start" id="tableColumn4" sort="PRSM_PK_START">
                                                                <ui:staticText binding="#{PackageAirtime.staticText3}" id="staticText3" text="#{currentRow.value['PRSM_PK_START']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn5}" headerText="End" id="tableColumn5">
                                                                <ui:staticText binding="#{PackageAirtime.staticText4}" id="staticText4" text="#{currentRow.value['PRSM_PK_END']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn6}" headerText="Units" id="tableColumn6">
                                                                <ui:staticText binding="#{PackageAirtime.staticText5}" id="staticText5" text="#{currentRow.value['PRSM_PK_UNITS']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn9}" headerText="Carry-over limit" id="tableColumn9" valign="Top">
                                                                <ui:staticText binding="#{PackageAirtime.staticText8}" id="staticText8" text="#{currentRow.value['ROM_PLAN_CARRY_LMT']}"/>
                                                            </ui:tableColumn>
                                                            <ui:tableColumn binding="#{PackageAirtime.tableColumn3}" headerText="Details" id="tableColumn3" width="100">
                                                                <ui:hyperlink action="#{PackageAirtime.viewpackageAT_action}" binding="#{PackageAirtime.hyperlink1}"
                                                                    id="hyperlink1" text="View"/>
                                                            </ui:tableColumn>
                                                        </ui:tableRowGroup>
                                                    </ui:table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </ui:form>
                    </ui:body>
    ...JAVA source:
        public void prerender() {
            search_action();
        public String search_action() {
            try {
                String command = "SELECT s23_package, s23_at_code, prsm_pk_start, prsm_pk_end,  prsm_pk_units, subr_at_prepaid_period_val,  subr_at_prepaid_type, subr_disc_type, subr_disc_rate,  subr_disc_value, subr_disc_perm,  subr_at_prepaid_bill_per_val, subr_at_prepaid_recurring,  s23_package_fwd, s23_at_code_fwd, prsm_pk_start_fwd,  subr_ppa_infinite, subr_ppa_carry_over, rom_plan_carry_lmt  FROM s23_package_airtime, ROM_23_PPLAN_COMP  where rom_23_pack_plan = s23_package";
                String where = "";
                String packageID = (String)textPackageID.getText();
                if (packageID == null) {
                    packageID = "";
                packageID = packageID.replace("'", "''");
                if (packageID != "") {
                    if (where != "") {
                        where += " AND ";
                    where += "upper(S23_PACKAGE) LIKE upper('" + packageID + "%')";
                String airtimeCode = (String)textAirtimeCode.getText();
                if (airtimeCode == null) {
                    airtimeCode = "";
                airtimeCode = airtimeCode.replace("'", "''");
                if (airtimeCode != "") {
                    if (where != "") {
                        where += " AND ";
                    where += " upper(S23_AT_CODE) LIKE upper('" + airtimeCode + "%')";
                if (where != "") {
                    command += " AND " + where;
                this.getSessionBean1().getS23_package_airtimeRowSet().setCommand(command);
                this.staticTextSearchResults.setText(tdi.business.Utils.getRowCountMessage(s23_package_airtimeDataProvider.getRowCount()));
            catch (Exception e) {
                log("Error during search for packages airtime", e);
            return null;
        public String searchButton_action() {
            search_action();
            this.tableRowGroup1.setFirst(0);
            return "";
        }I put the search_action() call in the prerender() to have data in my table when the page is open. For a large resultset the best aproach is to let the user select some search criteria and then call the search_action() using a button (searchButton_action() ).
    I've added a hyperlink column to my table, it is used to display the current record details in a new page.
    I have defined in my SessionBean a getRowkey/setRowkey methods.
    When the user click on a "View" hiperlink the following code is executed:
        public String viewpackageAT_action() {
            RowKey row = tableRowGroup1.getRowKey();
            this.getSessionBean1().setPackageAirtimeRowKey(row);
            return "packageairtime_details";
        }I will step over the "Page Navigation".
    In the Detail Page I have the following code:
        public void init() {
           this.s23_package_airtimeDataProvider.setCursorRow(this.getSessionBean1().getPackageAirtimeRowKey());
    }Now I have the detail page opened and also the DataProvider opened at the saved RowKey value.
    Finally, in the SessionBean:
         * Holds value of property packageAirtimeRowKey.
        private RowKey packageAirtimeRowKey;
         * Getter for property packageAirtimeRowKey.
         * @return Value of property packageAirtimeRowKey.
        public RowKey getPackageAirtimeRowKey() {
            return this.packageAirtimeRowKey;
         * Setter for property packageAirtimeRowKey.
         * @param packageAirtimeRowKey New value of property packageAirtimeRowKey.
        public void setPackageAirtimeRowKey(RowKey packageAirtimeRowKey) {
            this.packageAirtimeRowKey = packageAirtimeRowKey;
        }Note: You should enable page navigation in the result(s) table.
    That's about it :)
    Hope this helps,
    Catalin Florean.

  • How can I see all the Transaction Code that the client is using?

    How can I see all the List of Transaction Code that the client is using?

    Hello Sugauli,
    Did you mean to ask
    transaction types the client is using?
    instead of
    transaction code
    If so, go to SPRO (in ERP system) and follow this path:
    Sales and Distribution -->
         Sales -->
             Sales Documents -->
                 Sales Document Header -->
                      Define Sales Document Types
    All the transaction types that are not used have an X in the column Block.
    Easwar Ram
    http://www.parxlns.com

  • 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

  • How can I copy all the comments from my picture/s in fotostream to my picture/s in my library?

    How can I copy all the comments from my picture/s in fotostream to my picture/s in my library?

    Hi, first, you should prevent the iTunes library auto sync with iPhone: Launch iTunes > click Preferences... > click Devices. In the window, check the option 'Prevent iPods, iPhones, and iPads from syncing automatically'. Next, connect your iPhone with your computer via the USB cable. Click the mini menu for iTunes on the very top left and click the option 'Show menu bar'. After then you can see iTunes File, Edit, View, Control, Store and Help menus on the ribbon. Click File > Devices > Transfer purchases from (your iPhone name). You can also access to the File menu by holding down Alt (Option on Mac), Shift and F keys. This is how to get your iPhone purcahsed song transferred to iTunes Library.

  • How can I visualize all the visits I made to a specific webpage?

    Hello.
    In case I visited a web page several times, how can I see all the visits I made to this page? The data I get in History is the Visit date (which is the last visit date) and the Count, but I would like to see the date and time of all the visits to this web page. I found a program (MozillaHistoryView) that gives me the first and the last visit date, but still I do not see the intermediary visits. (The file I use to get the data is a history.dat file).
    Does anybody have an answer?
    Thanks.

    You could use Global Search (Ctrl-K) and enter the address or name, then filter the results by checking the appropriate box for Filters or People.

  • How can I copy all the info from a contact card in address book to paste into a documnent?

    How can I copy all the info from a contact card in address book to paste into a documnent?

    Tom Wolsky wrote:
    The advantage goes to FCP7 if you allow that it can copy and paste filters, audio and video, transformations, and other attributes separately.
    You can do that in FCPX too, as all the things you cited are listed separately in the inspector.
    Here's a little gotcha. Let's say you've color corrected a few clips and you've applied an effect to one and want to paste it the other clips. You switch off color correction and copy the clip. You select the other clips and paste effects. What do you think happens? The effect is applied, but the color correction is applied as well, only it's switched off as it was in the first clip, so all the color correction on the other clips is lost. Fun, eh?
    I'll try to replicate your gotcha - but no, that doesn't sound like fun at all!

  • How can I have all the numbers transfered from my old cellphone?

    In my old cell phone I have more than one number for each person: cell phone, land line, office etc. When I have transfered my telephone contacts from my old cell phone to my iphone, only one number for each name appears : how can I have all the numbers transfered?

    When transfer contacts through SIM only the first number is really transferred.
    What kind is your old phone?

  • 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 can we find all the available  user-exits in sap without using SMOD?.

    How can we find all the available  user-exits in sap without using SMOD?.

    Hi,
    Please check this links for user exits list.
    http://www.planetsap.com/Userexit_List.htm
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/ab038.htm
    Regards,
    Ferry Lianto

Maybe you are looking for

  • IPod Touch 2nd gen. audio dropouts

    I just received my 2nd gen 8GB touch. Transferred one album to it for testing. The sound every now and then drops out for a split second. Never in the same spot in music though- so it's not a bad rip or faulty transfer. The dropouts also occur when l

  • Missing startup script in bridge cc

    I have photoshop cc and bridge cc loaded on my computer. I also had CS6 on the same computer.  I deleted photoshop CS6 from my computer. When I try to open a file in bridge cc I get an errer message that cs6 cannot be found.  I checked my bridge cc s

  • Help I keep getting  a configuration error message

    Every new document I create gives me the following message when I try to preview **Error** C:\Documents and Settings\wozZonline\Local Settings\Application Data\Macromedia\Flash 8\en\Configuration\Classes\FP8\TextField\StyleSheet.as: Line 7: The name

  • My iPhone just called itself randomly..has this happened to anyone else?

    My iPhone just called itself randomly..has this happened to anyone else? when i picked up it said it was some national credit thing and said my debit card has been temporaly block....funny thing is..... i dont have a debit card with that company and

  • LaunchPad Does Not Showing icons Of Few Apps

    Hi Guys I Got A Realy Bug Problem, Launchpad does not showing icons on some apps, but names - it does. its realy annoying, here is picture of the problem(maybe in file not so sure):