Scrollbar in ALV table

Hi All,
Is anybody using Scroll bars in ALV table? If yes please help me out.
Iam not able to set scroll bar.
Thank You,
Suresh.

Hi Suresh ,
In the INIT method of the view where you are using the ALV do the following coding.
data: l_ref_cmp_usage type ref to if_wd_component_usage.
data: l_ref_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .
data: l_VALUE type ref to Cl_Salv_Wd_Config_Table.
*initiate the used component
l_ref_cmp_usage =   wd_This->wd_CpUse_Alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
  l_ref_cmp_usage->create_component( ).
endif.
l_ref_INTERFACECONTROLLER =   wd_This->wd_CpIfc_Alv( ).
l_VALUE = l_ref_INTERFACECONTROLLER->Get_Model( ).
*Set visible col count
l_value->if_salv_wd_table_settings~SET_SCROLLABLE_COL_COUNT( EXPORTING value = 4 ).
So in method SET_SCROLLABLE_COL_COUNT give the number of columns visible for rest you will have to scroll.
Regards
Amol

Similar Messages

  • Does Flex or Flash islands support ALV table scrolling ?

    Hello experts,
    if I have a webdynpro abap ALV table, no "real" scrolling in a large list is possible. The paginator buttons as well as the "scrollbars" always trigger a roundtrip, and it takes a moment or two until the next page or line is displayed.
    A "real" scrolling would be like in Excel or in other web pages where you can quickly roll through a list, by using a scrollbar or the mouse scrolling wheel.
    Does anyone know if this will be supported by Flash islands (in EhP1 maybe?) ?
    Thank you
    Johannes

    I think you're mixing things a little bit. WebDynpro ALV table is one thing...and Flash Islands is another...you can't build an ALV inside Flex, at least no so easy.
    ALV is an SAP Technology and it doesn't fit on Flex which is Adobe Technology. You can use Flash Islands to embed a Flex file into WebDynpro, but that in no way affect any WebDynpro standard components.
    Greetings,
    Blag.

  • Displaying default value for a field in ALV table

    Hai all,
         I am having an ALV table in which I want to display Requisition number by default using a value which i generated randomly and it is stored in a variable.
    While displaying ALV table my req number field should display that value by default when ever user is inserting a row( all the coloumns n my alv are editable.
    Is it possible?? 
    Kindly give some suggestions.
    Thanks in Advance,
    Nalla.B

    Hai Kris,
        I took help from ur link and i declared a global attribute request_number.
    and i created an event handler ON_ALV_INSERT and did the follwing coding for giving default value wen ever am inserting new row.
    FIELD-SYMBOLS: <wa_row> LIKE LINE OF r_param->t_inserted_rows.
      DATA bill_details TYPE REF TO zdom_bill_detail.
      LOOP AT r_param->t_inserted_rows ASSIGNING <wa_row>.
        bill_details ?= <wa_row>-r_value.
        IF bill_details->REQ_NUMBER IS INITIAL.
      DATA lo_nd_bill_detail TYPE REF TO if_wd_context_node.
      DATA lo_el_bill_detail TYPE REF TO if_wd_context_element.
      DATA ls_bill_detail TYPE wd_this->Element_bill_detail.
    navigate from <CONTEXT> to <BILL_DETAIL> via lead selection
      lo_nd_bill_detail = wd_context->get_child_node( name = wd_this->wdctx_bill_detail ).
    lo_el_bill_detail = lo_nd_bill_detail->get_element( index = <wa_row>-index ).
          lo_el_bill_detail->set_attribute(
            EXPORTING
              name  = 'REQ_NUMBER'
              value = wd_comp_controller->request_number
    Wen am  setting the value of wd_comp_controller->request_number to my context attribute am getting NULL object ref error.
    lo_el_bill_detail->set_attribute(
        name =  `REQ_NUMBER`
        value = wd_comp_controller->request_number ).
    Pls give some suggestions,
    Thanks in Advance,
    Nalla.B

  • How can i  change the column label text in a alv table display

    how can i change the column label text in a alv table display??
    A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
    <i>*  declare column, settings, header object
    DATA: lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
    get column by specifying column name.
    lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
    set Header Text as null
    lr_column_header = lr_column->get_header( ).
    lr_column_header->set_text( ' ' ).</i>
    My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
    <i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
    i have checked in debugging and the error occured at the statement :
    <i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
    Thanks,
    Suri

    I found it myself how to do it. The error says that it is not able to find the reference object i.e  it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
      DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
             lr_if_controller  TYPE REF TO iwci_salv_wd_table,
             lr_cmdl   TYPE REF TO cl_salv_wd_config_table,
             lr_col    TYPE REF TO cl_salv_wd_column.
      DATA : node_year  TYPE REF TO if_wd_context_node,
             elem_year  TYPE REF TO if_wd_context_element,
             stru_year  TYPE if_alv_layout=>element_importing,
             item_year  LIKE stru_year-i_current_year,
             lf_string    TYPE char(x),
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    Get the entered value from the input field of the screen
    node_year  = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
    elem_year  = node_year->get_element( ).
      elem_year->get_attribute(
       EXPORTING
        name = 'IMPORT_NODE-PARAMETER'
       IMPORTING
        value = L_IMPORT_PARAM ).
      WRITE L_IMPORT_PARAM TO lf_string.
    Get the reference of the table
      lr_cmp_usage  =  wd_this->wd_cpuse_alv( ).
      IF lr_cmp_usage->has_active_component( ) IS INITIAL.
        lr_cmp_usage->create_component( ).
      ENDIF.
      lr_if_controller  = wd_this->wd_cpifc_alv( ).
      lr_column_settings = lr_if_controller->get_model( ).
    get column by specifying column name.
      IF lr_column_settings IS BOUND.
        lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
    set Header Text as null
        lr_column_header = lr_column->get_header( ).
        lr_column_header->set_text( lf_string ).
    endif.

  • How to delete a particular row in ALV table

    Hi,
    How to delete a particular row in ALV table based on some condition(by checking value for one of the columns in a row)
    Thanks
    Bala Duvvuri

    Hello Bala,
    Can you please be a bit more clear as to how you intend to delete the rows from your ALV? By the way deleting rows from an ALV is no different from deleting rows from a normal table. Suppose you have enabled selection property in ALV & then select multiple rows and click up on a button to delete the rows then below would be the coding: (Also keep in mind that you would have to maintain the Selection property of the context node that you are binding to your ALV to 0..n)
    data : lr_table_settings  TYPE REF TO if_salv_wd_table_settings,
                 lr_config          TYPE REF TO cl_salv_wd_config_table.
      lr_table_settings  ?= lr_config.
    ** Setting the ALV selection to multiple selection with no lead selection
      lr_table_settings->set_selection_mode( value = cl_wd_table=>e_selection_mode-multi_no_lead ).
    Next delete the selected rows in the action triggered by the button:
    METHOD onactiondelete_rows .
      DATA:  wd_node TYPE REF TO if_wd_context_node,
             lt_node1 TYPE ig_componentcontroller=>elements_node,
             wa_temp  TYPE REF TO if_wd_context_element,
             lt_temp  TYPE wdr_context_element_set,
             row_number TYPE i VALUE 0.
      wd_node = wd_context->get_child_node( name = 'NODE' ).
      CALL METHOD wd_node->get_selected_elements
        RECEIVING
          set = lt_temp.
      LOOP AT lt_temp INTO wa_temp.
        wd_node->remove_element( EXPORTING element = wa_temp ).
      ENDLOOP.
      CALL METHOD wd_node->get_static_attributes_table
        EXPORTING
          from  = 1
          to    = 2147483647
        IMPORTING
          table = lt_node1.
      wd_node->bind_table( new_items = lt_node1 ).
    ENDMETHOD.
    If in case this isn't your requirement please do let me know so that I can try come up with another analysis.
    Regards,
    Uday

  • About selecting single column in a alv table.........

    Hi Experts,
    I need single column to be selected from a ALV table...selected in da sense to be highlighted....as it happens..by default for a row.....
    I hope u understood my query...
    Please help me out in this..
    I know u all will surely help me...
    Thks and Regards,
    Runali.

    Hi Runali,
    Get the reference to the column settings of your ALV Model. Then you can get the reference of each column by passing the column ID. There is a method set_selected_state in the column class, but that does not highlight the column as it does for a row. So what you can use is a cell design for a column that will highlight the column with a color or whatever.
    lr_column = lr_column_settings->get_column( ID = id ).
    lr_column->set_cell_design( preferred design ).
    Hope this helps. Please award points if it solves your purpose.
    Regards,
    Nithya

  • UI Element : MessageArea : How to I show a ALV table instead of messages

    UI Element : MessageArea : How to I show a ALV table (Message Log) instead of all the messages.

    Hi,
    Create a View Container UI Element at the bottom of the View and Embed ALV into it. Catch the Errors and populate into ALV instead of report message.
    hope  this helps u.,
    Thanks & Regards,
    Kiran

  • How To Edit Selected Row In ALV Table

    Hello Experts,
    In My Webdynpro Application, I am displaying records from database table into an ALV Table.
    I want to edit only selected record from  ALV table.
    Please Suggest How to achieve this.
    Thanks,
    Pratibha

    The link given above is for the UI element 'Table' and does not pertain to ALV.
    To Make an ALV Editable on lead selection for that particular lead selected row.
    1. The ALV should be made lead selectable, when initializing
    2. The ON_LEAD_SELECT function should be invoked.
    3. Withing this function the index has to be retrieved to know which row was selected.
    4. Based on the index retrived all the columns have to pass FALSE to read_only in the column properties.
    Regards,
    Pramod

  • Delete button in ALV Table

    Hi,
    Does any one have a code sample for the ALV Table Delete button? When I hit the DELETE button the selected row gets deleted but how can I save this deletion to the database table so that when I do a refresh the deleted row does not re-appear.
    Thanks. Kim

    Hi Kim,
             i am sorry but I dont have a sample code for this .. but yes i can tell you a very simple logic here that should work fine ..
    When the user clicks on Delete Entry call method say "Delete_entry" and within this you can write code based on this logic..
    1) On_Action_Lead_Select should copy the content of that row to another context node say "Selected_Entry"
    2) Search for this entry in your internal table/database that was bound to the ALVs context node(data source) and remove it using standard functions
    3) again read the database/internal table data and bind it to the context node ..
    Your changes will be reflected in your ALV..
    I hope this helps and if it does please do award points
    Also please close the thread if the issue gets resolved ..
    Regards,
    Anoop

  • How to create a context menu in ALV table cell editor(Webdynpro abap )

    Hello Experts,
    I am having a problem in creating a context menu in a table cell editor in the ALV table output.I have assigned a 'lta' as the cell editor.But befor assigning the lta as cell editor I have assigned the menu to the lta.But when the view is rendered I can see the lta with the actioned assigned to it.But I cannot see the context menu.
    The code snippet below:
      "Create menu for each coloumn
      create OBJECT lo_menu_actions type CL_SALV_WD_VE_MENU EXPORTING
          id = 'MITM_ACTIONS'.
      lo_menu_actions->set_visible( value = abap_true ). 
      lo_menu_actions->set_visible_fieldname( value = 'ACTIONS' ).
      "ADd menu items
      CREATE OBJECT lo_menu_item_create type CL_SALV_WD_VE_MENU
      exporting
        id = 'MITM_CREATE_EXPRESSION'.
      lo_menu_item_create->set_visible( value = abap_true ).
      lo_menu_item_create->set_visible_fieldname( value = 'Create' ).
      "Add item 1
      lo_menu_actions->ADD_ITEM( VALUE = lo_menu_item_create ). 
      "  Set the cell editor for each column cell(link to an action)
      LOOP AT lt_node_dec_tab_cols INTO ls_node_dec_tab_cols .
        lv_column_name = ls_node_dec_tab_cols-object_name.
        lr_column = lr_column_settings->get_column( lv_column_name ).
       "Create 'lta' Ui item
        CREATE OBJECT lo_lta TYPE cl_salv_wd_uie_link_to_action.
        lo_lta->set_menu( value = lo_menu_actions ).
        lo_lta->set_text_fieldname( lv_column_name ).
        lr_column->set_cell_editor( lo_lta ).
        IF ls_node_dec_tab_cols-is_result EQ abap_true.
          lr_column->set_cell_design( value =
                      cl_wd_table_column=>e_cell_design-key_medium ).
        ENDIF.
      ENDLOOP.

    Hi Prakash,
    I have not come across this requirement till now to have context menu in a cell editor of alv.
    Unfortunately  the implementation of method SET_MENU of alv ui elements ( ex: cl_salv_wd_uie_text_view ) is not updating alv configurable table, instead it just stores in a global attribute as string. Hence has no effect on context menu.
    If your user is very particular about this requirement of having context menu in cell editor, you can go for a normal table. Because, normal table's cell editor has the property to set the menuID as we do it for other ui elements.
    Regards,
    Rama

  • How to display different icon within WDA alv table base on row data ?

    Hi,
    is that possible to display different icon for every row within ALV table depending on the row data ?
    for instance if the status 'S' display ~Icon/SuccessMessage and 'E' display ~Icon/ErrorMessage ?
    because base on this code below i only can set 1 icon for the whole row data.
    LOOP AT lt_columns ASSIGNING <fs_column>.
        CASE <fs_column>-id.
          WHEN 'ICO'.
            CREATE OBJECT lr_caption.
               lr_caption->set_image_source( value = '~Icon/SuccessMessage').
               <fs_column>-r_column->set_cell_editor( lr_caption ).
        ENDCASE.
      ENDLOOP.
    Thank you in advance.
    Fernand

    Hello,
    Yes it is possible to display different images based on data.
    For that what you can do is create one attribute 'STATUS' of type string in context node which you are mapping to ALV.
    And fill that attribute with the path to image based on your requirement like for status 'S' set the attribute to ~Icon/SuccessMessage and if status is 'E', set it to ~Icon/ErrorMessage at runtime.
    Now in the settings for ALV use the following code:
    * Display icon in column seatsocc
      DATA: lr_column TYPE REF TO cl_salv_wd_column,
            lr_image TYPE REF TO cl_salv_wd_uie_image,
            lv_icon TYPE string.
      lr_column = lv_model->if_salv_wd_column_settings~get_column( 'SEATSOCC' ).
      CREATE OBJECT lr_image.
      lr_image->SET_SOURCE_FIELDNAME( 'STATUS' ).
      lr_column->set_cell_editor( lr_image ).
    in the above code, column 'SEATSOCC' will be displayed as an icon.
    Sample code to fill the attribute 'STATUS'
    LOOP AT lt_flights INTO ls_flight.
        lv_seatsfree = ls_flight-seatsmax - ls_flight-seatsocc.
        IF lv_seatsfree = 0.
          ls_flight-status = 'ICON_RED_LIGHT'.
        ELSEIF lv_seatsfree <= 50.
          ls_flight-status = 'ICON_YELLOW_LIGHT'.
        ELSE.
          ls_flight-status = 'ICON_GREEN_LIGHT'.
        ENDIF.
        MODIFY lt_flights FROM ls_flight.
      ENDLOOP.
    Hope this helps!
    Regards,
    Srilatha
    Edited by: Srilatha M on Jun 25, 2010 12:02 PM

  • Embeding ALV table in dynamically created view container UI element

    Hi ,
    I created a view container UI element dynamically .that is working fine . I am using standard ALV component . Now i want to embed ALV table in View container UI element dynamically > please help me in this .
    Thanks in advance ,
    Vijay vorsu

    Hi,
    I am not sure how to do add an ALV table dynamically but you can have a look at this blog which talks about creating and adding a TABLE ui element dynamically. And TABLE UI element may solve your problem.
    http://mamma1360.blog.163.com/blog/static/314740992008127115551165/
    Thanks,
    Abhishek

  • In webdynpro for ABAP  alv table issue

    hello gurus,
                      i am new for webdynpro for ABAP.i strucked at one point at designing time.anybody  could you suggest me on this.
    thanks in advance.
    let me explain my scenario first.
    in my webdynpro for ABAP developement i have one alv table having ten fields.i am featching the data for eight fields from one Ztabale and updating , for rest of two fields we need to fill after displaying output using the respective F4 help. Right now these two fields are in input editable mode.now i am getting the values successfully from F4 help and at the same time it is allowing MANUAL ENTRIES also but as per my requirement it  should not allow  any manual entries . for this i have made these two fields are in readonly mode as like as rest of fields to avoid the MANUAL ENTRIES  but at this time i didnot get any F4 helpfor those two fields.
    so how can i achive my goal in this thing could any one suggest me.
    my final conclusion is we need to get only F4 help values into those two fields . it should not allow any manual values at any point of time.
    best regards,
    babu

    ya hi  harshit,
          my self also used same code in my action part . here i have one table with four fields  carrid , connid , fldate , price.
    for carrid i have created freely programmed search help.but if it is in display mode there is no F4 help in enable mode.
    in context for attribute carrid
    DATA lo_nd_flight TYPE REF TO if_wd_context_node.
      DATA lo_el_flight TYPE REF TO if_wd_context_element.
      DATA ls_flight TYPE wd_this->element_flight.
      DATA lt_flight TYPE wd_this->elements_flight.
    navigate from <CONTEXT> to <FLIGHT> via lead selection
      lo_nd_flight = wd_context->get_child_node( name = wd_this->wdctx_flight ).
      select connid fldate price from sflight into CORRESPONDING FIELDS OF TABLE
        lt_flight UP TO 20 ROWS.
    @TODO handle non existant child
    IF lo_nd_flight IS INITIAL.
    ENDIF.
    get element via lead selection
    lo_el_flight = lo_nd_flight->get_element( ).
    alternative access  via index
    lo_el_flight = lo_nd_flight->get_element( index = 1 ).
    @TODO handle not set lead selection
    IF lo_el_flight IS INITIAL.
    ENDIF.
    get all declared attributes
    lo_el_flight->get_static_attributes(
       IMPORTING
         static_attributes = ls_flight ).
    CALL METHOD lo_nd_flight->bind_table
      EXPORTING
        new_items            = lt_flight
       set_initial_elements = ABAP_TRUE
       index                =
    DATA: lo_cmp_usage TYPE REF TO if_wd_component_usage.
    DATA: lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.
        instantiate ALV component usage if necessary
      lo_cmp_usage = wd_this->wd_cpuse_alv( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
        pass reference to data node to instance of ALV usage
      lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
      lo_interfacecontroller->set_data( r_node_data = lo_nd_flight ).
    Configure ALV
      DATA lr_config TYPE REF TO cl_salv_wd_config_table.
      lr_config = lo_interfacecontroller->get_model( ).
    **declerations
      DATA: lt_columns TYPE salv_wd_t_column_ref,
            ls_columns TYPE salv_wd_s_column_ref,
            lr_input TYPE REF TO cl_salv_wd_uie_input_field,
            name TYPE string,
            lt_node_info TYPE wdr_context_attr_info_map,
            ls_node_info TYPE wdr_context_attribute_info,
            lv_tabix TYPE sy-tabix,
            lr_info TYPE REF TO if_wd_context_node_info.
      TYPES: BEGIN OF ty_name,
              name TYPE string,
             END OF ty_name.
      DATA: lt_name TYPE TABLE OF ty_name,
            ls_name TYPE ty_name.
    **for getting node info
    *Get the context node information
      lr_info = lo_nd_flight->get_node_info( ).
      lt_node_info = lr_info->get_attributes( ).
      LOOP AT lt_node_info INTO ls_node_info.
        CASE ls_node_info-name.
          WHEN 'CARRID'.
            ls_name-name = ls_node_info-name.
            APPEND ls_name TO lt_name.
         WHEN 'REGIONALOFFICER'.
           ls_name-name = ls_node_info-name.
           APPEND ls_name TO lt_name.
         WHEN 'INSPECTORNAME'.
           ls_name-name = ls_node_info-name.
           APPEND ls_name TO lt_name.
        ENDCASE.
      ENDLOOP.
    *Logic for  Table Horizontal Scrolling
      lr_config->if_salv_wd_table_settings~set_visible_row_count( 13 ).
      "  lr_config->if_salv_wd_table_settings~set_width( '1085' ).
      lr_config->if_salv_wd_table_settings~set_width( '100%' ).
      lr_config->if_salv_wd_table_settings~set_scrollable_col_count( 8 ).
      "  lr_config->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).
      lr_config->if_salv_wd_table_settings~set_first_visible_scroll_col( 'CARRID' ).
      lr_config->if_salv_wd_table_settings~set_cell_action_event_enabled( abap_true ).
    Set the table editable .
      DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings.
      lr_table_settings ?= lr_config.
      lr_table_settings->set_read_only( abap_false ).
      lr_table_settings->set_read_only( abap_true ).
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
            lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lt_string TYPE STANDARD TABLE OF string,
            ld_string TYPE string,
            ld_int TYPE i,
            lv_index TYPE i.
    Make few columns editable and attach inputfield, if permitted.
        DATA lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
        CLEAR lt_string.
        APPEND 'CARRID' TO lt_string.
        LOOP AT lt_string INTO ld_string.
          lr_column_settings ?= lr_config.
          lr_column = lr_column_settings->get_column( ld_string ).
          CREATE OBJECT lr_input_field
            EXPORTING
              value_fieldname = ld_string.
          lr_input_field->set_read_only( abap_true ).
          lr_column->set_cell_editor( lr_input_field ).
        ENDLOOP.
        CLEAR lt_string.

  • Column name in ALV table dissapeared after new language package installatio

    Hi,
    We have a custom field in an ALV table in SAP system. In english everything was just fine with our custom field.
    But when we installed a new languaged the column name dissapeared.
    My question is:
    Where does the ALV get the column name from? Is there a standard method which I can search for which is used for this purpose in ALV?
    regards
    Baran

    the field name comes from data element FIELD name you have specified when creating ur custom field..
    try to change that field name for that field..
    hope it works
    award points if helpful

  • WD4A Dynamic ALV Table with dynamic tables

    Hi all,
    first I want give you the information what I try to do.
    I have an another WD4A application for administrative use in which I can assign certain tablefields to a certain user. You can say it's something like a customizing application.
    In the next application (with my issues) I will display the tables for the user, but these tables are not the complete table.
    I have a node in my context of the component controller which is bound to my ALV. I add during the runtime attributes to my node.
    * .... coding ....declaration
    * get the node
      lr_node = wd_context->get_child_node( 'M_TABLE' ).
      lr_node_info ?= lr_node->get_node_info( ).
    * remove the attributes, if exists
      lr_node_info->remove_dynamic_attributes( ).
    * .... coding ....
    *   add attributes
        LOOP AT l_t_m_table INTO l_s_m_table.
          CLEAR ls_attribute.
    *     name of the attribute
          MOVE l_s_m_table-NAME TO ls_attribute-NAME.
    *     DDIC type of the attribute
          MOVE l_s_m_table-TYPE_NAME TO ls_attribute-TYPE_NAME.
    *     If the DDIC has a gen namespace like /B135/ replace the / with _
          REPLACE ALL OCCURRENCES OF '/' IN ls_attribute-NAME WITH '_'.
    *     add the attribute
          lr_node_info->add_attribute( EXPORTING
                                         attribute_info = ls_attribute ).
        ENDLOOP.
    This coding works fine I get the columns in my ALV. Then I tried to fill my ALV table with data from a database table.
    I created dynamicly an internal table with the following coding:
    *   Create dynamic table
        CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
          EXPORTING
            IT_FIELDCATALOG = l_t_FLDCAT
          IMPORTING
            EP_TABLE = l_t_NEW_M_TABLE.
    *   assign the table
        ASSIGN l_t_NEW_M_TABLE->* TO <M_TABLE>.
    *   structure of table
        CREATE DATA l_s_NEW_M_TABLE LIKE LINE OF <M_TABLE>.
        ASSIGN l_s_NEW_M_TABLE->* TO <l_s_m_table>.
    * get data from database
    SELECT * FROM (l_m_table) INTO CORRESPONDING FIELDS OF TABLE <M_table> WHERE OBJVERS = 'A'.
    With this coding I get the data from the database and only the required fields that means I have e.g. an itab with columns1, columns3, columns4 from the database.
    I also added e.g. these columns  (columns1, columns3, columns4 from the database) to the node as attribute. Now it should be possible to bind the table to the structure with this coding:
    lr_comp_usage_m = wd_this->wd_cpuse_usage_alv_M_table( ).
    *   create component if not active
        IF lr_comp_usage_m->has_active_component( ) IS INITIAL.
          lr_comp_usage_m->create_component( ).
        else.
    * set data if node exists
          l_ref_interfacecontroller = wd_this->wd_cpifc_usage_alv_M_table( ).
          l_ref_interfacecontroller->set_data( lr_node ).
        endif.
    *   bind table
        lr_node->bind_table( <M_TABLE> ).
    Now, I get an error, which is caused by the table binding.
    In ST22 I get:
    Short text
        Line types of an internal table and a work area not compatible.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "CL_WDR_CONTEXT_NODE_VAL=======CP" had to be
         terminated because it has
        come across a statement that unfortunately cannot be executed.
    Error analysis
        The statement
           "INSERT wa INTO TABLE itab"
        requires the lines of the internal table "TABLE" and the
        work area " wa" to be compatible. Compatibility means
        equivalence in the context of ABAP/4 type checking.
        In this case, the condition is not satisfied because the internal table
        "TABLE" has the line type "u" and the length 28, but the work area " wa"
        has the type "C" and the length 2.
        (If the work area " wa" is the header line of the internal
        table "TABLE", the above inconsistency can arise if an internal
        table t with the line type T1 is passed to a subroutine (FORM or
        FUNCTION) as an actual parameter and the corresponding formal
        parameter p is declared in the subroutine by "TABLES p STRUCTURE T2".
        If then T1 and T2 are incompatible, the header line p
        has the type T2 (specifed by STRUCTURE), but the internal
        table p has the line type T1 (passed from the actual parameter)).
    Source Code Extract
    Line  SourceCde
        1 method if_wd_context_node~get_static_attributes_table .
        2
        3   field-symbols:
        4     <element> like line of me->collection,
        5     <static_attributes> type data,
        6     <table> type index table.
        7
        8 * check whether elements are supllied or not
        9   if me->elements_supplied = abap_false.
       10     me->supply_elements( ).
       11   endif.
       12
       13   clear table.
       14
       15   if me->table_ref is not initial.
       16     assign me->table_ref->* to <table>.
       17     table = <table>.
       18   else.
       19     loop at me->collection assigning <element> from from to to.
       20       assign <element>->static_attributes->* to <static_attributes>.
    error in line 21       insert <static_attributes> into table table.
       22     endloop.
       23   endif.
       24
       25 endmethod.
    Any suggestions? Is it allowed to use bind_table() with a field symbol?
    Another strange thing is that if I try the same with static itab and attributes during runtime it works, but only if the fields of the itab has the same name as the attributes, which means that I can not use itabs with fieldnames like /BI0/S_CUSTOMER and if I can not use them it's difficult to read data from database with SELECT * FROM ... INTO CORRESPONDING FIELDS OF TABLE itab.
    Thanks in advance for your suggestions!
    Best Regards,
    Marcel

    Hi Francois,
    I solve it with the RTTI and the method    
    lr_node_info = lr_node_info->add_new_child_node(
                          name = 'Dynamic_TABLE'
                          IS_MANDATORY = ABAP_false
                          IS_MULTIPLE = ABAP_true
                          STATIC_ELEMENT_RTTI = lr_struct_descr
                          IS_STATIC = ABAP_false
    I don't know why it doesn't work with adding attributes and binding the table after adding the attributes.
    Anyway thanks for your help.
    Best Regards,
    Marcel

Maybe you are looking for

  • New iPod Touch (4th generation) - Music will not sync

    I just bought an 4th generation iPod Touch.  When syncing my from my Windows PC to the iPod everything syncs perfectly - photos, contacts, bookmarks - but not my music files.  The music sync box is checked.  The playlists are hightligthed, but no luc

  • I just bought the iPhone 5 and I tried to sync it to my itunes but it wont sync.. I tried everything!

    After several attempts to sync my new iphone to my itunes it still does not work. I have tried everything including deleting and reinstalling my itunes but nothing works. Nor does syncing from my phone! What can i do to fix this ?

  • Why does my iPhone 5 battery runs dead after only 5 hours in standby?

    My brand new iPhone 5 runds completely dead after only 5 hours standby. I might have done 2 or 3 calls, I switched off all the apps that are running in the background. Wifi and bluetooth are on, and should stay on. My old iPhone4 could work almost 2

  • Equipment BOM query

    Dear All, After maintaining equipment BOM , i think we are only able to issue (BOM Maintained)material against the Maintenance Order but its not happening.?? ? i think i am missing some customization, is it?. Plz guide, n do tell me main benefits of

  • LinuxPPC support

    Hi, Would it be possible to get a Linux PPC version please of Oracle 8i ? Winton