‎2016 Feb 24 11:12 AM
hi,
i am calling an function module and get back lc_element:
lc_element is defined this way:
lc_element TYPE REF TO if_swf_cnt_element,
so far so good. when i set debugger after the call of the FM i get something like this when i click on lc_element:
i have NO idea of how to get the values of e.g. M_NAME or the values in the deep structure M_ELEM_REF. i can't loop over the lc_element as this is not an table.
so how can i access the data coming back into lc_element ?
br Martin
‎2016 Feb 24 7:38 PM
thanks to all -> i have resolved it by calling the methods
i thougt i can read that out directly -> as the debugger displays this values directly.
‎2016 Feb 24 12:25 PM
Hi Martin,
as lc_element refers to an object, you can use its interface to get the required values.
Regards,
Hubert
‎2016 Feb 24 12:26 PM
Hello Martin,
In you example, lc_element is a object reference to interface IF_SWF_CNT_ELEMENT which is embedded in class CL_SWF_CNT_ELEMENT where you can actually find implementation of several public methods.
So, to get the 'name' attribute for example, you will have to call the appropriate method, which I guess is GET_NAME:
DATA: lv_name type swfdname.
Call method lc_element->get_name importing NAME = lv_name.
Br,
Manu.
‎2016 Feb 24 12:30 PM
If you check the interface IF_SWF_CNT_ELEMENT, you will find a number of 'getter'-methods..
There is a GET_NAME for instance (and when you check the parameters, you can find out what the method returns):
example
CALL METHOD lc_element->get_name
IMPORTING
name = l_element.
‎2016 Feb 24 12:44 PM
Hi Martin.
Try,
DATA: lv_element TYPE REF TO CL_SWF_CNT_ELEMENT,
lv_name TYPE SWFDNAME.
IF lv_element IS BOUND.
lv_element->GET_NAME( IMPORTING NAME = lv_name
NAME_STRING = lv_namestring
EDITELEM = lv_element ).
ENDIF.
Hope it helpful,
Regards,
Venkat.
‎2016 Feb 24 12:47 PM
‎2016 Feb 24 7:38 PM
thanks to all -> i have resolved it by calling the methods
i thougt i can read that out directly -> as the debugger displays this values directly.
‎2016 Feb 25 11:12 AM
Did you notice the red icon, those attributes are "private", so you need a method to read them.
(Also Hubert's answer was the first good one, so you should mark it as correct)
Regards,
Raymond