Dynamic rows in ABAP webdynpro table

hi all
I've got a question. I have a webdynpro with a table.
This table is feed by a node. The number of rows of this node is dynamic.
I had seen in the properties of the table object that the number of visible rows can be set.
But is there also a method to set this number of rows dynamicly? So when the node has 20 rows
the table object is also set to show 20 rows and when there are none, the table
only shows the header of the  table.
Currently the table always shows 5 rows, without checking how many rows there actually are.
Does any of you know how to do this?
kind regards,
Anton Pierhagen

Hi Anton ,
You can use the method SET_VISIBLE_ROW_COUNT() of the class cl_wd_table for setting the visible row count dynamically.
In the WDDOMODIFY view , you can get the reference of the table UI element used and proceed.
DATA lo_table TYPE cl_wd_table.
lo_table ?= view->get_element( ID = 'name_of_table_in_the_view').
lo_table->SET_VISIBLE_ROW_COUNT(value = 5)."Here the value you can decide based on your data.
But this method is not recommended as it directly deals with the view's elements and will be very difficult for the person maintaining the code.
Instead create a attribute which can store a number and bind the visible row count property to this attribute.
set this attribute with the values based on the data.(as in number of visible rows you would want to see.)
Thanks,
Aditya

Similar Messages

  • ABAP Webdynpro Table Control

    Hi all,
    I am a Webdynpro beginner, I am developing a ABAP Webdynpro program. I have a table in my View, And I want to the Row became READ ONLY based on the context.
    For Example, there is a user name field in the table, if the user name is equal to the user who run the program, this row will be modifiable. if not, the row will be Read Only.
    I don't know which function can do so. Could anyone help me?
    I can use VIEW->GET_ELEMENT to get the table. but I didn't find the method in the CL_WD_TABLE helpful.
    Thanks
    Ming

    For further description,
    the table is binded to a ( 0 ... n ) context node.  There are 6 columns in the table. 3 of them are textviews and the others are inputfield. I want two of the inputfields in each rows became Read_Pnly or not base on the value in the same row in a textview field.
    For example, there are six column, col1 col2 col3 col4 col5 col6.
    if col = 'MM'.
    col1 col2  are editable.
    else.
    col1 col2 are read_only.
    Thanks in advance.
    Ming

  • Unable to selelct a Row in ABAP Webdynpro ALV table

    Hi,
    I have a ALV Table in webdynpro  and I need to choose a Row in that table. But the table is not allowing me to choose the row.
    Row_selectable is at 'X'.
    Row selection type is at 8.
    Still.. the grid looks like it is in display mode..
    pls help

    Hi
    You explicitly need to make the table editable.
    DATA lo_table_setings TYPE REF TO if_salv_wd_table_settings.
      lo_table = lo_interfacecontroller->get_model( ).
      lo_field_settings ?= lo_table.
      lo_table_setings->set_cell_action_event_enabled( value = abap_true ).
      lo_table_setings->set_read_only( value = abap_false ).
      lo_table_setings->set_enabled( value = abap_true ).
    have u written thse lines in ur code??
    Regards,
    Arvind

  • Abap WebDynpro: Table Maintenance Generator ??

    ...in ABAP Dictionary there is a tool for generating Table Maintenance for classical "Screen Painter" Dynpro. Is there (or will there ever be?) a similiar tool for generating Table Maintenance for WebDynpro ?

    Have a look at [this|"Table Maintenance Generator" for WD4A?; thread - nothing new until now afaik.
    Regards,
    TW

  • ABAP Webdynpro table scroll bar does not work

    Hello,
    I have created a dynamic WD table using cl_wd_dynamic_tool=>create_table_from_node. I have set the no. of visible rows to 5. Now when ever the table has more rows, it displays a vertical scroll bar. But if I scroll it down, after 5 rows, it dosent scroll further. Am I missing something here?
    Thanks and Regards,
    Sandhya

    Hi,
    I guess you might have wriiten the code in the MODFIYVIEW right.
    One thing you do....
    Use the FIRST TIME parameter , create the tbale and all. When the application runs for 2nd time, then reset the vsible row count value.
    Have you used any BIND_TABLE statement in this modfivyew.
    Please clarify above.
    Regards,
    Lekha.

  • ABAP WEBDYNPRO - Table Columns Buttons

    Hi Experts.
    I have a table and the last colum is a button.
    I would like to know, how do I get the index when starts the event of button?
    Tks a lot

    hi
    post your question in webdynpro ABAP forum.you'll get the solution there.
    regards
    Aakash Banga

  • ABAP WebDynpro: Table cells with different values.

    Hello,
    I am not sure how the following can be achieved.
    I have a table with 10 rows in it. First column should have different values in cells (static value that do not come from anywhere). For example, colors: black, green, yellow, etc.
    I inserted a table column. In that column I inserted a Cell Editor of type TextView. If I define a 'text' property of this element than it marks all cells in this column with this text. I need to assign different values to each cell.
    How can this be done?
    Thank you.

    Probably you should post this the Web Dynpro Forum
    Web Dynpro Java
    Regards,
    Ravi
    Note : Please close this thread.

  • How to get rid of vertical scroll bar in ABAP webdynpro table

    Hello,
    I have created a dynamic WD table using cl_wd_dynamic_tool=>create_table_from_node and then I restricted the number of lines to 1 by setting the 'Set_Row_Count' and 'Set_Visible_Row_Count' = 1. But still when I run the application I see a vertical scroll bar which looks very awkward for only 1 line. How do I get rid of this vertical scroll bar ?
    Thanks and Regards,
    Sandhya

    Hi,
    Is your table under any transparent container. have you set any scroll mode for this.
    One more thing, have you used SER SCROLLABLE COL COUNT property.Also is this property set firstVisibleScrollableCol.
    Regards,
    Lekha.
    Edited by: Lekha on Oct 28, 2009 11:18 AM

  • ESS- ABAP Webdynpro- table column not visible

    Hi,
    We are using SAP travel management for expense approvals. In the package PTRM_WEB_UI, you will find the component FITE_VC_RECEIPTS. In the VIEW - RECEIPTS_VIEW you will find in the table that there is a column called "Short Info". However this column in not visible in the portal.
    There is no personalization done to hide this column.
    The visible property of this column  is set to "visible".
    In portal content directory if i right click....this column is not even available to be added/removed.
    Please help me understand why this column in not visible and how can i make it appear in portal.
    Thank You!

    Any input?

  • ABAP Webdynpro Rendering issues after ECC Upgrade

    Dear All,
    We recently upgraded ECC to EHP 7 (Netweaver 7.4)  but our Portal is still at Netweaver 7.0 EHP2 SP16.
    The ABAP Webdynpro iViews in Portal have the following issues. ( We use IE11).
    1. The ABAP Webdynpro Table filtering is not working. When I click the filter button it does nothing.  
    2. The cursor in the  Input fields reset back to the first position while typing and create a big mess.
    Any help appreciated.
    Thank you.
    PK

    Hi N_niki
    There is no resolution as such.
    We had raised a Customer message with SAP and were informed that this was expected as the procedure to execute the reports was changed in ECC when compared to 4.6 (technical changes) and hence this issue shall remain for some queries wherein the old changes need to be brought back using an option in the SAP Query.
    Please refer to SAP Note # 723577 which could provide a better explanation for the issue.
    Hope this helps.
    Thanks
    Vinodh Sudhakaran

  • Pagination in Webdynpro Table

    Hi Colleagues.
    Im using NW 7.0 Java webdynpro
    Can I use dynamic pagination for java webdynpro table. I found an article explaining the same with NW7.1.
    Is there any option the functionality available in NW 7.0
    Thanks
    Bala

    Hi
    PLease check this article link
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e0d6c30a-c99e-2b10-f09b-c9a00b7e78c6&overridelayout=true
    Also check this blog link
    /people/bertram.ganz/blog/2008/11/27/web-dynpro-java-table-paging-unleashed-optimizing-heavy-table-performance
    Regards
    Ruturaj
    Edited by: Ruturaj Inamdar on Jul 31, 2009 1:32 PM

  • Deleting row from table in ABAP webdynpro

    Hi all,
    Can anyone help me regarding deletion of a row from a table in ABAP webdynpro.
    I have written a code like this :
        DATA:
          NODE_STUDINFOSYS                    TYPE REF TO IF_WD_CONTEXT_NODE,
          ELEM_STUDINFOSYS                    TYPE REF TO IF_WD_CONTEXT_ELEMENT,
          STRU_STUDINFOSYS                    TYPE IF_COMPONENTCONTROLLER=>ELEMENT_STUDINFOSYS .
      navigate from <CONTEXT> to <STUDINFOSYS> via lead selection
        NODE_STUDINFOSYS = WD_CONTEXT->GET_CHILD_NODE( NAME = IF_COMPONENTCONTROLLER=>WDCTX_STUDINFOSYS ).
      get element via lead selection
        ELEM_STUDINFOSYS = NODE_STUDINFOSYS->GET_ELEMENT(  ).
    deleting data selected via lead selection
        NODE_STUDINFOSYS->REMOVE_ELEMENT( ELEMENT = ELEM_STUDINFOSYS ).
    *But I am getting an error:*
    Error when processing your request
    What has happened?
    The URL http://hsdnt24s11.hclt.corp.hcl.in:8000/sap/bc/webdynpro/sap/znet310_add_del_sech/ was not called due to an error.
    Note
    The following error text was processed in the system HE6 : The lead selection has not been set. VIEW_ADD_DEL_01
    The error occurred on the application server hsdnt24s11_HE6_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: RAISEELEMENT_NOT_FOUND of program CL_WDR_CONTEXT_NODE===========CP
    Method: PATH_TABLE_GET_ELEMENT2 of program CL_WDR_CONTEXT_NODE===========CP
    Method: GET_BOUND_ELEMENT of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP
    What can I do?
    If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system HE6 in transaction ST22.
    If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server hsdnt24s11_HE6_00 in transaction SM21.
    If the termination type was ERROR_MESSAGE_STATE, then you can search for more information in the trace file for the work process 0 in transaction ST11 on the application server hsdnt24s11_HE6_00 . In some situations, you may also need to analyze the trace files of other work processes.
    If you do not yet have a user ID, contact your system administrator.
    Error code: ICF-IE-http -c: 800 -u: SUMANK -l: E -s: HE6 -i: hsdnt24s11_HE6_00 -w: 0 -d: 20081220 -t: 155832 -v: RABAX_STATE -e: UNCAUGHT_EXCEPTION
    HTTP 500 - Internal Server Error
    Your SAP Internet Communication Framework Team
    Can anyone help me???

    Hi Suman,
    this issue seems to be not specific to the FPM. I would like to suggest you to address this problem in the ABAP forum.
    Best regards,
    Thomas

  • How to process Line Selection on ALV Table in ABAP WebDynpro

    Hi there,
    I have a view with an ALV table whose context node retrieves its data from a Service Call for a method.
    The method provides certain data of a database table which the ALV displays.
    Now I would like to be able to select one row of that ALV table and after pressing a button or doubleclicking on the row or whatever a different view (as for me it is also ok on the same view) should appear to display the details of that selection.
    I only need to know how to retrieve the selected data.
    Or its index within the internal table.
    I am already looking for hours for a useful thread and actually there is one which obviously is about a similar issue apart from the multiple selection part: 
    How to process multiple row selection in ALV table in Wendynpro ABAP? Help!
    but i am afraid that i don't understand it. Or at least I misunderstand it since it does not work with me.
    The system example mentioned in the thread does not help me either because it somehow does not correspond to my needs, does it?
    It would be GREAT if somebody could help me with that. Please keep it simple for I am not an expert in webdynpro yet (obviously ^^) and also please explain in detail what I have to do with the context nodes since I am not sure whether the selection is stored in my already existing node or whether I need a special one for that.
    Thanks!!
    christina

    Hi Christina,
    If you just want to get one column data of the line that user clicked, use the Web Dynpro Code Wizard to Read Context of attibute you needed, then you will get code as follow:
    * Define data for read attribute
        node_alv TYPE REF TO if_wd_context_node,
        elem_alv TYPE REF TO if_wd_context_element,
        stru_alv TYPE if_view_display=>element_alv ,
        item_column_name  LIKE stru_alv-column_name.
    * navigate from <CONTEXT> to <ALV> via lead selection
      node_alv = wd_context->get_child_node( name = if_view_display=>wdctx_alv ).
    * get element via lead selection
      elem_alv = node_alv->get_element(  ).
    * get single attribute
      elem_alv->get_attribute(
        EXPORTING
          name =  `COLUMN_NAME'
        IMPORTING
          value = item_column_name ).
    The value of column_name is stored in item_column_name.
    If you need the index that the user clicked, try this:
    * Definition of field symbol for index
      FIELD-SYMBOLS : <fs_index> TYPE data.
    * Get the selected index
      ASSIGN r_param->index->* TO <fs_index>.
    The index of clicked line is stored in field symbol <fs_index>.
    Hope it will help.
    Best Regards,
    Stephanie

  • Error Handling in tables using ABap Webdynpro

    Hi All,
    I am new to this ABAP webdynpro programming. I have a small question. I am using a table control in one of my iview. I need to check some validations on some columns of this table. Let's say I have a table with 3 columns A,B and C. 
    Case 1 : Whenever any user enters values in C which is greater than A i want to raise an error message saying "The Value is greater than A". The user shouldn't be allowed to enter anyother inputs before correcting the same.
    OR
    Case 2: If the user enters 10 rows in the table and the 5th row contains the error. How can i highlight that row or field which contains the error.
    Your inputs will be valuable to me.
    Regards,
    Pravesh.

    Hi,
    Get the elements of the node for which you table is bound.
    Loop through the context element set.
    get the record for that context attribute and check the column A and column B value and throw
    the error using the report_error_element_message when there is error.
    Check this sample code -
      DATA:
        lt_attr_list type STRING_TABLE,
        ls_attr_list type string.
      ls_attr_list = column name.
      append ls_attr_list to lt_attr_list.
      clear ls_attr_list.
      ls_attr_list = column name.
      append ls_attr_list to lt_attr_list.
      clear ls_attr_list.
    DATA: lit_elementset type WDR_CONTEXT_ELEMENT_SET,
    lis_element type ref to IF_WD_CONTEXT_ELEMENT,
    ls_data type <<strucure type>>.
        CALL METHOD <<nodename>>->GET_ELEMENTS
          RECEIVING
            SET = lit_elementset.
        LOOP AT  lit_elementsetINTO  lis_element.
    lis_element->get_static_atributes->
    importing = ls_data.
    if ls_data-columnC GT ls-data-columnA.
    lr_msg_manager->report_element_error_message->
    message_text = 'Column C canot be gretaer than column A'
    element = lis_element
    attributes = lt_attr_list <<Populate the attributes table for which errors are to be shown>>
    endif.
    clear: ls_data, lis_element.
    ENDLOOP.
    Regards,
    Lekha.

  • ABAP Webdynpro - Populating second table based on data selected on first

    Hi Experts,
      I am new to ABAP Webdynpro. I have a requirement to show a search area, one table for header info, and second table for populating item level information.
      I was successful building a search area and populating first table when the 'Search' button is pressed.
      Now, I like to populate the second table with item details if a row on first table is selected. I tried to bind the OnSelect Event of first table to a method and try to get the results and bind to second table.. However, I am unsuccessful in this attempt.
      Here are my questions/challenges.
      1. When I select a row on first table, how can I extract the key information?
      2. Is it sufficient to create a context attribute and populate it with FM and bind that with second table? 
    I appreciate your help in answering this question.
    Thanks,
    SG

    Hi,
    Regarding...
    1. When I select a row on first table, how can I extract the key information?
    When you select any row in table, a lead selection will be set in the node which bound to the table.
    To read this selected record you need to use the following code. Here the name of context node is "FLAGS". And the structure ls_flags contains all the attributes defined in the node.
    DATA lo_nd_flags TYPE REF TO if_wd_context_node.
      DATA ls_flags TYPE wd_this->element_flags.
      lo_nd_flags = wd_context->get_child_node( name = wd_this->wdctx_flags ).
      CALL METHOD lo_nd_flags->get_static_attributes
        IMPORTING
          static_attributes = ls_flags.
    Regarding....
    2. Is it sufficient to create a context attribute and populate it with FM and bind that with second table?
    Based on the data that you got in the first step, you can fill an internal table with data that needs to be displayed in 2nd table.
    To bind the internal table you need to define the internal table of type context node. Use the following code to bind the internal table to context node which bound to 2nd table. Here name of  the context node is "OVERVIEW".
    DATA: lo_nd_overview TYPE REF TO if_wd_context_node,
                lt_overview TYPE wd_this->elements_overview.
    <<<< Fill lt_overview with data >>>>>
            lo_nd_overview = wd_context->get_child_node( name = wd_this->wdctx_overview ).
            CALL METHOD lo_nd_overview->bind_table
              EXPORTING
                new_items            = lt_overview.
    Alternatively you can use the Supply Function Method.
    Vikrant Trivedi

Maybe you are looking for