Get all rows from a table control

Hi All,
I have a table control with one column. What function should I use to retrieve all the rows ? Do I need to iterate row by row and read each row or is it possible to do it in one function ?
Thanks,
Kanu
Solved!
Go to Solution.

Supposing vells in the column have all the same data type, you can retrieve the whole column with a single instruction:
GetTableCellRangeVals (panel, control, VAL_TABLE_COLUMN_RANGE (1), array, VAL_COLUMN_MAJOR);
The array passed must be large enough to retrieve all data. Alternatively, you may substitute the macro VAL_TABLE_COLUMN_RANGE with the appropriate MakeRect instruction.In case your table was dinamically built, you can obtain the nu,ìmber of rows using GetNumTableRows and dimension your array accordingly.
The above macro is defined in userint.h together with some other useful macros that can be used to access data in a table.
There are some precautions to take in case of string values or some cell type (ring, combo box, button...) that are described in the hell for the function.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?

Similar Messages

  • Get selected row in a table control

    What is the best approach to get a selected row, all fields, in a table control?  I see this done in various transactions in MM but do not see how to do this in documentation.
    Thanks

    in the screen flow logic you need something like this:
      LOOP AT t_partner.
           MODULE get_selected_line.
          MODULE process_partner.
      ENDLOOP.
    PAI module get_selected_line :
    MODULE get_selected_line INPUT.
    only get cursor position once....as it's constant within each loop
      IF sy-stepl EQ 1.
        CLEAR wv_cursor_0120.
        GET CURSOR LINE wv_cursor_0120.
        IF wv_cursor_0120 = 0.
          wv_cursor_0120 = 1.
        ENDIF.
    convert the relative line of the screen to the actual line number in the table
        wv_absolute_line = wv_cursor_0120 + tc_partner-top_line - 1.
      ENDIF.
    ENDMODULE.                 " GET_SELECTED_LINE  INPUT
    module process_partner needs to be something like this:
    MODULE process_partner INPUT.
    only process the selected line
    CHECK sy-stepl = wv_cursor_0120.
    CASE ok_code.
    endcase.
    endmodule.

  • How to get multiple rows from database table?

    hello !
    I need to get multiple rows from a OLEDB database table and display them on a table object.
    I did "Wrap in subfrom" on the table,  set  subform of the table to "flowed", and checked "Repeat row for each data item" of Row1 of the table.
    But I can get only one row on the table object.
    I need your help.
    Thanks

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • How get all rows of a table with a BAPI

    Hi,
    how is it possible to get more then one row by calling a BAPI from the WD. In my Application I need the rows of a Table coming from the r/3 System. How is it possible to get all the rows after the first call? What is the logic behind it? My purpose is also to create an own BAPI.
    regards,
    Sharam
    null

    Hi,
    If I understand, you don't want display the result into a Web Dynpro Table. If so, after the execution, the result of your request is stored into the context. Then you don't really need to transfert the data from your context to an Java Array.
    But if you want to do it, here is the code :
    guess your result node called
    nodeResult
    Vector myVector = new Vector();
    for (int i = 0; i < wdContext.nodeResult().size(); i++){
       myVector.put(wdContext.nodeResult().getElementAt(i));
    I hope this will answer to your question.
    Regards

  • How to get current row data in table control

    Hi , expert ,
       I am professional in oracle ,  but  now I am a new guy in SAP ABAP .
    I  have a question in UI
    How to get current row data and click pushbutton  in table control  to open next screen ?
    I want to get the current data and open next screen to carry out detail detail .
    Thansk for all your suggestion .

    GET CURSOR LINE SY-CUROW .
      READ TABLE internal_table index SY-CUROW.

  • Need to get the row selected in table control without ay action

    Dear Team,
    I have a requirement in which I need to pass the row selected of a table control to a variable.
    Here I need to get the row selected with out any other action
    then the action of selection of a row.
    Is it possible to read table control values using FM DYNP_VALUES_READ.
    thanks in advance,
    regards,
    Sai

    HI,
    Sai Kumar Potluri
    I tried in IDES it working.
    Here is the code.
    REPORT  ZPRA_TC_D.
    TABLES : SCARR.
    CONTROLS TC TYPE TABLEVIEW USING SCREEN 1.
    DATA : SELLINE TYPE I,
           SELINDEX TYPE I.
    DATA : ACT LIKE SCARR-CARRID,
           ANT LIKE SCARR-CARRNAME.
    DATA : ITAB LIKE SCARR OCCURS 0 WITH HEADER LINE.
    CALL SCREEN 1.
    *&      Module  STATUS_0001  OUTPUT
    *       text
    MODULE STATUS_0001 OUTPUT.
      SET PF-STATUS 'ME'.
    *  SET TITLEBAR 'xxx'.
    SELECT * FROM SCARR INTO TABLE ITAB.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  MOV  OUTPUT
    *       text
    MODULE MOV OUTPUT.
      MOVE-CORRESPONDING ITAB TO SCARR.
    ENDMODULE.                 " MOV  OUTPUT
    *&      Module  USER_COMMAND_0001  INPUT
    *       text
    MODULE USER_COMMAND_0001 INPUT.
    CASE SY-UCOMM.
    WHEN 'BACK' OR 'UP' OR 'EXIT'.
      LEAVE PROGRAM.
    WHEN 'SEL'.
      GET CURSOR FIELD SCARR-CARRID LINE SELLINE.
      SELINDEX = TC-TOP_LINE + SELLINE - 1.
      READ TABLE ITAB INDEX SELINDEX.
      ACT = ITAB-CARRID.
      ANT = ITAB-CARRNAME.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0001  INPUT
    In Flow Logic.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0001.
    LOOP AT ITAB WITH CONTROL TC.
      MODULE MOV.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT ITAB.
    ENDLOOP.
    MODULE USER_COMMAND_0001.

  • Cannot get all rows from cfProcResult

    We upgraded one of our servers (A) from CF 6 to 7.02. Another
    server (B) has CF 7.01.
    On server B (CF 7.01) the code works (below), all rows of
    each dataset are returned.
    Now on server A (CF 7.02) all of the resulting datasets have
    only the first record in them. If I add maxrows="-1" to each of the
    cfProcResult tags there is no change. If I change that to
    maxrows="100" then I can get the rows up to 100.
    Is this a bug or is there a different means to return all
    rows?

    It think its a bug. I got the same results under MX 7.0.2.
    The topic of maxrows recently came up on another thread. I
    did some searching and according to TechNote 18339 there was a
    change with maxrow
    "<cfquery maxrows=N> bug. ColdFusion MX (until ColdFusion
    MX 7.0.1 CHF2) didn't pass maxrows to the underlying driver
    (statement.setMaxRows())"
    Given the results you're getting, it sounds like CF is
    applying the maxrow to all of the resultsets, not just the one
    where maxrows was declared. I suspect cfstoredproc's usage of
    statement.setMaxRows() is incorrect. Thats just a guess though.
    Bottom line, I think you'll need handle it manually.
    Personally, I would recommend placing the row count logic in the
    stored procedure (if possible). The overall results will be more
    consistent and you won't have to worry about this kind of issue
    again.
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_18339
    http://livedocs.adobe.com/coldfusion/7/htmldocs/00000314.htm
    http://www.remotesynthesis.com/blog/index.cfm/2006/3/23/Maxrows-Issue-in-CFQuery

  • How to get the rows from a table having some column has any letter

    Hi All,
    suppose i have a table having columns id(number), code(varchar).
    code has alphanumeric characters (ex. ABC123, 67B56 etc).
    some codes are only numbers (2344, 7898 etc).
    how can i get the rows which have alphabets in the code.
    ex:
    id code
    1 AB45
    2 456
    3 890
    4 67B7
    how can i write a query such that it should give me the ids 1 and 4 (as they have alphabets in code)
    thanks in advance to all

    Thanks to one and all.
    i am gettig my required output.
    But i have a doubt in the operator.
    If i add or remove '[]' in the operator, i am getting different ouputs.
    There is a count difference in the result of the operators used.
    REGEXP_LIKE(<column>,'[[:lower:]]')
    REGEXP_LIKE(<column>,'[[[:lower:]]]')
    REGEXP_LIKE(<column>,'[:lower:]')
    Can anybody please explain what is the difference in using '[]', in the operator?
    What is the correct syntax, whether i have to use two '[]'s or one '[]'.
    Also, can i use REGEXP_LIKE() in oracle 8i version.( I am unable to use the operator in 8i)?
    Any query to get the required output in 8i version?
    Thanks in advance to all.

  • Get exact row from database table

    This is part of my source code that displays one row from getQuest recordset. Always first.
    <body>
    <p><?php echo $row_getQuest['content']; ?></p>
    <p>: <?php echo $row_getQuest['prom1']; ?></p>
    <p><?php echo $row_getQuest['prom2']; ?></p>
    <?php echo $row_getQuest['dos1']; ?>(); <?php echo $row_getQuest['dos2']; ?> (); <?php echo $row_getQuest['dos3']; ?> (); <?php echo $row_getQuest['dos4']; ?>(); <?php echo $row_getQuest['dos5']; ?> (); <?php echo $row_getQuest['dos6']; ?> (); <?php echo $row_getQuest['dos7']; ?> ().
    </body>
    Can i change it so, that on this page it always displayed row with exact position in the table - for example second or 15th - independently of row contents and rows deletition, moving or changing in table?

    But if I add 5 rows to table, then delete all of them and add 5 again - auto incremented id will 6 for first in table and 10 for last. If i delete all and add 5 again it will be 11...15 and so on. As I said - I cannot rely on row contens - because I'm planning to delete and add data from that table frequently. Or other solution could be to allways keep id from 1 to [amount of rows]. I do not know how this is done.
    Or am I wrong about id?

  • Deleting a row from a table control through right-clic​k menu

    I have a table control. I want to delete a row from it when a user right clicks on a particular row and selects "Delete row" menu item. I have managed the creation of menu item but have not been able to delete the row which is right clicked and the menu item "Delete row" is selected. Guidance required! Thanks!

    smercurio_fc wrote:
    It's irrelevant whether the table is a control or indicator. See attached VI.
    Hi smercurio,
    please see the attached picture. In my previous post i mean the different in the menu. The red marked function is not available, if the table is an indicator. LV8.5!
    Mike
    Message Edited by MikeS81 on 04-18-2008 05:19 PM
    Attachments:
    Unbenannt.PNG ‏22 KB

  • How to move the selected rows from a  table control in dialog programming

    hiiiiiiii Every1
    I have to update some fields for a slected row in table control on click of a button and save it in database.
    Regards
    Sachin Dhingra

    see below example, I have added INSERT option after DELETE option, you can use same table or you can use differnt table by populating into that table and insert into the db table. If you want to use same internal table then use below code
    LOOP AT itab INTO demo_conn WHERE mark = 'X'.
    insert into table from itab.
    ENDLOOP.
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA cols LIKE LINE OF flights-cols.
    DATA: ok_code TYPE sy-ucomm,
    save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
    TABLES demo_conn.
    SELECT * FROM spfli INTO TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
    cols-screen-input = '0'.
    MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    MODULE cancel INPUT.
    LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
    MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
    save_ok = ok_code.
    CLEAR ok_code.
    CASE save_ok.
    WHEN 'TOGGLE'.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
    IF cols-screen-input = '0'.
    cols-screen-input = '1'.
    ELSEIF cols-screen-input = '1'.
    cols-screen-input = '0'.
    ENDIF.
    MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    WHEN 'SORT_UP'.
    READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
    IF sy-subrc = 0.
    SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
    cols-selected = ' '.
    MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDIF.
    WHEN 'SORT_DOWN'.
    READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
    IF sy-subrc = 0.
    SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
    cols-selected = ' '.
    MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDIF.
    WHEN 'DELETE'.
    READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
    IF sy-subrc = 0.
    LOOP AT itab INTO demo_conn WHERE mark = 'X'.
    DELETE itab.
    ENDLOOP.
    ENDIF.
    WHEN 'INSERT'.
    READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
    IF sy-subrc = 0.
    LOOP AT itab INTO demo_conn WHERE mark = 'X'.
    itab1 = itab.
    modify itab1.
    ENDLOOP.
    ENDIF.
    if not itab1 is initial.
    INSERT dbtab FROM TABLE itab1.
    endif.
    ENDCASE.
    ENDMODULE.

  • OdbcDataAdapter.Fill() not getting all rows from RDB using 64bit driver

    I am using VS2012 Pro on Windows 7 (64-bit). I am migrating an older 32-bit VS2008 app to the new environment. I'm building for the .NET Framework 4.5.
    The app queries an RDB database and uses the Oracle RDB drivers version 3.3.2.0. When I build as a 32-bit app and use the 32-bit Oracle RDB Driver, the query succeeds and returns all 341 data rows. When I built it as 64-bit and use the 64-bit driver, I only
    get the first 101 rows.
    Oracle says the problem is in the OdbcDataAdapter.Fill() method. I was able to confirm this. I created an OdbcDataReader and used the debugger to see what was being read, I can see all 341 rows, but when I use the DataAdapter.Fill (or DataSet.Load) method,
    the results are truncated to 101 rows. Changing the SQL to query different tables does not change the problem. Below is a code sample:
            private DataSet runQuery()
                string connString32 = @"PROVIDER=MSDASQL;DRIVER={Oracle RDB Driver};SVR=myserver;DATABASE=ATTACH 'filename mydatabase';CLS=myclassname;uid=myusername;pwd=mypassword;xpt=2";
                string connString64 = @"PROVIDER=MSDASQL;DRIVER={Oracle RDB Driver 64 Bit};SVR=myserver;DATABASE=ATTACH 'filename mydatabase';CLS=myclassname;uid=myusername;pwd=mypassword;xpt=2";
                string sql = "SELECT person_id FROM person_tab";      
                DataSet ds = new DataSet();
                using (OdbcConnection conn = new OdbcConnection(connString64))  
                    OdbcCommand cmd = new OdbcCommand(sql, conn);
                    OdbcDataAdapter da = new OdbcDataAdapter();
                    da.SelectCommand = cmd;
                    conn.Open();
                    da.Fill(ds, "myDataSet");
                return ds;
    Has anyone else encountered this problem? If so, how did you get around it?

    Hello,
    Since I do not have the RDB database, I made a test with both 32bit and 64bit ODBC Driver 11 for SQL Server and query for 1000 records, however, both of them can work fine.
    As far as I know, the ODBC is just a component as a bridge to connect the driver and the application and since you are use the Oracle RDB driver, I suggest you posting it to the Oracle forum:
    https://community.oracle.com/community/developer/english
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Get selected row from af:table in backing bean

    Hi Experts,
    I have an af:table and i have seelctBoolean check box in that. If the user select 'x' nos of check boxes i want to display the row data of those selected rows. Can somebody help me in getting the selected row data in backing bean?
    I am using adf faces and backing bean.
    JSF Code:
    <af:table value="#{demo.partyList}" var="row"
    rowBandingInterval="0" binding="#{demo.t1}" id="t21"
    rowSelection="multiple">
    <af:column>
    <af:selectBooleanCheckbox text="#{row.person_first_name}"
    label="Label 1" id="sbc1"
    />
    </af:column>
    <af:column>
    <af:inputText value="#{row.emirate}"/>
    </af:column>
    </af:table>
    <af:commandButton action="#{demo.print}" text="Print"/>
    BB Code:
    public void print(){
    // what code to write here
    }

    This is the code
    JSF ::
    <af:table value="#{createOpportunity.dataList}" var="row"
    rowBandingInterval="0" binding="#{demo.t1}" id="t21">
    <af:column headerText="Model">
    <af:selectBooleanCheckbox text="#{row.modelRange}"
    label="Label 1" id="sbc1" value="#{row.selected}"/>
    </af:column>
    <af:column headerText="Description">
    <af:outputText value="#{row.description}"/>
    </af:column>
    <af:column>
    <af:inputText value="#{row.quantity}"/>
    </af:column>
    </af:table>
    <af:commandButton action="#{createOpportunity.print}" text="Print"/>
    Backing bean Code::
    public void print () {
    selectedDataList = new ArrayList<ModelDescription>();
    for (ModelDescription dataItem : dataList) {
    if (dataItem.isSelected()) {
    System.out.println(dataItem.getQuantity());
    selectedDataList.add(dataItem);
    // dataItem.setSelected(false); // Reset.
    Clicking on the print button shows "We have 0 rows selected"
    Thnks for ur replies guys ..
    Edited by: Wannabe Java Guru on Mar 9, 2011 1:43 AM

  • How to get current row from advanced table

    Hi,
    I have the following code to pick the value of columnA from one of the columns of an advanced table:
    OAViewObject vo = (OAViewObject)am.findViewObject("AAALineVO2");
    if (vo != null)
    OARow vorow = (OARow)vo.getCurrentRow();
    String ColA = (String)vorow.getAttribute("ColumnA");
    String message = ColA; //to throw message so i can verify the value of ColumnA
    throw new OAException(message, OAException.INFORMATION);
    }It's picking up the first value of ColumnA of the first record correctly, however when I add a new row, it's not picking up the value of columnA anymore.
    What am I doing wrong?
    Thanks in advance,
    N

    Try with this:
    import oracle.apps.fnd.lookups.server.LookupCodeVORowImpl;
    public void aaa (String row)
        LookupCodeVORowImpl laborcreateeovorowimpl = (LookupCodeVORowImpl)findRowByRef(row);
    }Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How can i get all values from jtable with out selecting?

    i have one input table and two output tables (name it as output1, output2). Selected rows from input table are displayed in output1 table. The data in output1 table is temporary(means the dat wont store in database just for display purpose).
    Actually what i want is how can i get all values from output1 table to output2 table with out selecting the data in output1 table?
    thanks in advance.
    raja

    You could set the table's data model to be the same:
    output2.setModel( output1.getModel() );

Maybe you are looking for

  • Step for Publish a development created with Webdynpro for Java

    Good Afternoon. I am new in this of publish development in the portal. We created a development with Webdynpro java using RFC. We want know what are the step for publish this development in the portal ESS? The development work fine. But i don't know

  • Systemd as user, dual monitor, awesome, popups (long desc inside)?

    Okay, this is quite difficult to describe, so please bear with me. I run systemd as user and awesomewm on a laptop which is normally plugged in to an external monitor for a dual screen. 64-bit Arch, fully updated, running [testing] I've got my own ho

  • Next ADF Version?

    Hello, My company is currently on ADF 10g on Oracle App Server 10g. We are thinking about migrating to ADF 11g on Weblogic 11g. However, since ADF 11g is about 4 years old, does it make sense to wait for the next version of ADF and app server? Does a

  • Why is the adobe air installer failing?

    Hi there, I am trying to install Story Plus on my laptop, but I get an error message saying there's a problem with the installer, get a fresh copy from the author. so, here's the log from that issue.  Thanks for any help you can offer. [2014-12-28:15

  • Adobe interactive form(ABAP WD)size is increasing & not opening from EP UWL

    Hello All, Adobe interactive form (ABAP WD) size is increasing after cleansing data from MDM and the form is not opening from portal UWL. Same application is working fine in Dev and Qa environment. In dev and QA the form size is around 150 KB after c