Skip to Content
avatar image
Former Member

Not compatible with the formal parameter "NEW_ITEMS"

Dear,

I'm creating a very simple WD4A to just display the contents of the table.

So in the COMPONENTCONTROLLERS I created the node ZPI_USERS, according to the type of the internal table ZPI_USERS we have on the PI system.

Still in the COMPONENTCONTROLLER under methods I'm trying to implement this code in the 'wddoinit' event:

METHOD wddoinit.

  DATA: lt_users    TYPE zpi_users,
        node_users  TYPE wd_this->element_users,
        lo_nd_users TYPE REF TO if_wd_context_node,
        lo_el_users TYPE REF TO if_wd_context_element.

* navigate from <CONTEXT> to <USERS> via lead selection
  lo_nd_users = wd_context->get_child_node( name = wd_this->wdctx_users ).

  SELECT * FROM zpi_users
           INTO lt_users.

    lo_nd_users->bind_table( new_items = lt_users ).

  ENDMETHOD.

On trying to activate I get the following error :

Web Dynpro Comp. / Intf. ZPI_DISPLAY_MONIUSERS,Web Dynpro Component Controller COMPONENTCONTROLLER
Method WDDOINIT
"LT_USERS" is not type-compatible with formal parameter "NEW_ITEMS".

I know I'm overseeing something very simple, though I get the feeling I'm running in circles. Again: the only thing I want to do is show an internal SAP table through a Web Dynpro.

Kind regards,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    May 18, 2009 at 11:56 AM

    Hi,

    Is ZPI_USERS a table type.

    I think the node has some different fields and this table lt_users has some other.

    Might be the case where both the node and lt_users are not referring to same table structure.

    If you want to directly bind the same table then both the node and the internal table should refer to same structure .

    Regards,

    Lekha.

    Add comment
    10|10000 characters needed characters exceeded

  • May 18, 2009 at 11:58 AM

    Hi,

    I think your requirement is that you want to get the values form a node and display it in a table.

    If yes, the refer the following code.

    DATA lo_nd_node1 TYPE REF TO if_wd_context_node.
    lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ). "node1 is the node of node
    data: it_tab type table of wd_this->element_node1.
    
    lo_nd_node1->get_static_attributes_table(
    importing
    table = it_tab ). " Here you'll get all the data present in the node.
    
    lo_nd_node1->bind_table( it_tab ). " bind the internal table table with the table node.
    

    I hope it helps.

    Regards

    Arjun

    Edited by: Arjun Thakur on May 18, 2009 5:29 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 18, 2009 at 12:13 PM

    Hi,

    You have declared

    DATA: lt_users    TYPE zpi_users,

    This means that you are declaring a work area and not an internal table, whereas while binding we need to pass an internal table.

    Declare your table as follow,

    DATA: lt_users    TYPE TABLE OF zpi_users.
    
    " modify your select
        SELECT * 
          FROM zpi_users
          INTO TABLE lt_users.

    Hope this helps!

    Regards,

    Radhika.

    Add comment
    10|10000 characters needed characters exceeded

  • May 18, 2009 at 12:46 PM

    Hi,

    The new_items parameter expects an internal table to be passed as input to it. So just check that you zpi_users is a proper table type. Also you need to change your select statement so that you get the entire set of values into a table. Basing up on your code the system would think that lt_users is a structure and not an internal table.

    SELECT * FROM zpi_users INTO table lt_users.

    Regards,

    Uday

    Add comment
    10|10000 characters needed characters exceeded