abapwebdynpro

Field "GET_ATTRIBUTE(" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement


I'm working on my first webdynpro application. I used the wizard to call a function module from my componentcontroller. I used another wizard to call the componentcontroller method from a view method. After that I tried to use node attributes as arguments, but I'm getting the error that's in the title. The error is pointing at the first argument (Activestatus).

This is the code of the view method.

method DOREFRESHDATA .
  DATA lo_nd_filternode TYPE REF TO if_wd_context_node.
  DATA lo_el_filternode TYPE REF TO if_wd_context_element.

  lo_nd_filternode = wd_context->get_child_node( name = wd_this->wdctx_filternode ).
  lo_el_filternode = lo_nd_filternode->get_element( ).

  DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .
  lo_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
  lo_componentcontroller->execute_getorders(
    activestatus = lo_el_filternode->get_attribute( name = 'ACTIVESTATUS' )
    batch = GETFILTERSTRING( ATTRIBUTENAME = 'BATCH' )
    cancelstatus = lo_el_filternode->get_attribute( name = 'CANCELSTATUS' )
    completestatus = lo_el_filternode->get_attribute( name = 'COMPLETESTATUS' )
    confirmstatus = lo_el_filternode->get_attribute( name = 'CONFIRMSTATUS' )
    enddate = lo_el_filternode->get_attribute( name = 'STARTDATEENDDATE' )
    endtime = lo_el_filternode->get_attribute( name = 'STARTDATEENDTIME' )
    equipment = GETFILTERSTRING( ATTRIBUTENAME = 'EQUIPMENT' )
    financialstatus = lo_el_filternode->get_attribute( name = 'FINANCIALSTATUS' )
    materialdescription = GETFILTERSTRING( ATTRIBUTENAME = 'MATERIALDESCRIPTON' )
    materialnumber = GETFILTERSTRING( ATTRIBUTENAME = 'MATERIALDESCRIPTION' )
    order = GETFILTERSTRING( ATTRIBUTENAME = 'ORDERNUMBER' )
    orderplopo = lo_el_filternode->get_attribute( name = 'ORDERTYPE' )
    ordertype = GETFILTERSTRING( ATTRIBUTENAME = 'PROCESAREA' )
    plannedstatus = GETFILTERSTRING( ATTRIBUTENAME = 'PLANNEDSTATUS' )
    startdate = lo_el_filternode->get_attribute( name = 'STARTDATESTARTDATE' )
    starttime = lo_el_filternode->get_attribute( name = 'STARTDATESTARTTIME' )
    technicalstatus = lo_el_filternode->get_attribute( name = 'TECHNICALSTATUS' )
  ).
endmethod.

Is it illegal to call a function as argument and do I have to create a local variable for each argument or is something else going wrong.

I'm new to ABAP and Webdynpro. Thank you for your help.


Solution

  • 1) It seems that you are using an old release of ABAP (before 7.02), you cannot indicate a method as argument of a parameter (or maybe the compiler gives an incorrect message because of the problem indicated in 2) below)

    2) Moreover, GET_ATTRIBUTE is not a functional method, for instance you can't do operations like variable = instance->method( ... ) ; you must use the IMPORTING word to get the attribute value.

    Solution: you could code something like this (declare lv_activestatus with the right type) :

    lo_el_filternode->get_attribute( EXPORTING name = 'ACTIVESTATUS'
                                     IMPORTING value = lv_activestatus ).
    lo_componentcontroller->execute_getorders(
                activestatus = lv_activestatus
                ...