1

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.

Peter
  • 850
  • 5
  • 16
  • 2
    Maybe you should check if "lo_el_filternode IS BOUND" before calling its method get_attribute() – Eralper Apr 17 '18 at 10:53
  • Some closing parenthesis miss the space before them... Can you add them and check again? – VXLozano Apr 17 '18 at 09:58
  • Thank you for your reply. I've added the spaces, but it did not help. The error is poining at the line starting with "activestatus =" which alread had the space. – Peter Apr 17 '18 at 10:08
  • Please, then edit the question to reflect the change and not mislead some other people in my direction :) – VXLozano Apr 17 '18 at 10:11

1 Answers1

5

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
            ...
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48