‎2009 Jun 04 12:33 PM
Hi,
I need some information in one of my methods.
The info residing in higher level method in the ABAP Callstack.
My callstack looks like this
Event Type___Event_______________________________Program
METHOD___IF_RSPLS_CR_METHODS~DERIVE_____ZFIB0001_IP_CHAR_REL==========CP <- I'm here.
METHOD___IF_RSPLS_CR_MAPPER~DERIVEM_____CL_RSPLS_CR_MAPPER============CP
METHOD___IF_RSPLS_CR_CONTROLLER~DERIVE__CL_RSPLS_CR_CONTROLLER========CP
METHOD___CR_DERIVE_________________________CL_RSPLS_DELTA_BUFFER_B=======CP
METHOD___WRITE______________________________CL_RSPLS_DELTA_BUFFER_B=======CP
METHOD___WRITE______________________________CL_RSPLS_DELTA_BUFFER_AM======CP
METHOD___WRITE_EXT__________________________CL_RSPLS_DELTA_BUFFER=========CP
METHOD___STORE_DELTA_IN_BUFFER____________CL_RSPLFR_CONTROLLER==========CP
METHOD___EXECUTE_SERVICE___________________CL_RSPLFR_CONTROLLER==========CP
METHOD___EXECUTE____________________________CL_RSPLFR_WEB_START_SERVICE===CP
FUNCTION_BICS_CONS_EXECUTE_PLANNING_FUN__SAPLRSBOLAP_BICS_CONSUMER
FORM_____BICS_CONS_EXECUTE_PLANNING_FUN__SAPLRSBOLAP_BICS_CONSUMER
FORM_____REMOTE_FUNCTION_CALL_____________SAPMSSY1
MODULE___%_RFC_START_______________________SAPMSSY1
I need to access line 4 from the bottom (function in SAPLRSBOLAP_BICS_CONSUMER).
From here i need to access
L_R_DATA_PROVIDER which is a class type CL_RSPLFR_WEB_START_SERVICE.
I have tried to use the method in , but so far it has been unsuccesful.
Is it possible to gain access to a class higher in the hierarchy ?
Br Rasmus
‎2009 Jun 04 2:53 PM
To get an access of the object, you can try this way:
DATA: ld_class TYPE string,
ld_method TYPE string.
DATA: lo_obj TYPE REF TO object.
FIELD-SYMBOLS:
<lo_provider> TYPE ANY.
ld_class = '(SAPLRSBOLAP_BICS_CONSUMER)L_R_DATA_PROVIDER'.
ASSIGN (ld_class) TO <lo_provider>.
Now, if you want to execute the method, you can try this way:
lo_obj ?= <lo_provider>.
ld_method = 'LINE_GET'.
CALL METHOD lo_obj->(ld_method)
....
To get an access of the public attributes:
ld_class = '(SAPLRSBOLAP_BICS_CONSUMER)L_R_DATA_PROVIDER->attr'. "put actual attribute name
ASSIGN (ld_class) TO <lo_attr>.
Regards,
Naimesh Patel
‎2009 Jun 04 3:13 PM
Hi Naimesh,
Thanks for your post.
I have tried you suggestion, but the <lo_provider> does not get assigned.
lookup_string = '(SAPLRSBOLAP_BICS_CONSUMER)L_R_DATA_PROVIDER'.
ASSIGN (lookup_string) to <lookup>.
IF <lookup> is ASSIGNED.
lo_obj ?= <lookup>.
endif.
- Rasmus
‎2009 Jun 05 6:36 AM
Hello Rasmus
Looking at the coding of fm BICS_CONS_EXECUTE_PLANNING_FUN I would say you cannot access L_R_DATA_PROVIDER because it is a local variable.
FUNCTION bics_cons_execute_planning_fun.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_FUNCTION_HANDLE) TYPE RSBOLAP_HANDLE
*" EXPORTING
*" VALUE(E_MAX_MESSAGE_TYPE) TYPE SYMSGTY
*" VALUE(E_EXECUTED) TYPE RS_BOOL
*" VALUE(E_DATA_AREA_CONTAINS_DATA) TYPE RS_BOOL
*" TABLES
*" E_T_MESSAGE STRUCTURE BICS_PROV_MESSAGE OPTIONAL
*" I_T_STATISTIC_INFO STRUCTURE RSSTA_S_EVENTINPUT OPTIONAL
*" E_T_OUT_OF_SYNC_DP STRUCTURE RSBOLAP_S_OBJECT_NAME OPTIONAL
*" EXCEPTIONS
*" INVALID_FUNCTION_HANDLE
*" VARIABLE_INPUT_NECESSARY
*"----------------------------------------------------------------------
* Begin of the rfc function module
rfc_function_module_start 'BICS_CONS_EXECUTE_PLANNING_FUN' i_function_handle.
DATA:
l_r_data_provider TYPE REF TO if_rsbolap_data_provider, " <<< local variable
l_r_function TYPE REF TO cl_rsplfr_web_start_service,
l_invalid_function_handle TYPE rs_bool,
l_s_mesg TYPE rrms_s_mesg,
l_t_mesg TYPE rrms_t_mesg,
l_t_names TYPE RSBOLAP_T_OBJECT_NAME,
l_s_name type rsbolap_s_object_name.
* Get the data provider
l_r_data_provider =
cl_rsbolap_application=>get_data_provider_static( i_handle = i_function_handle ).
...
The variable would be accessible if it were global, i.e. defined in the TOP-include.
The main program SAPLRSBOLAP_BICS_CONSUMER does not know anything about local variables within the function modules.
Regards
Uwe
‎2009 Jun 08 8:35 AM
Of course, you are quite right.
How about the import parameters should I be able to access them.
E.g. I_FUNCTION_HANDLE?
‎2009 Jun 08 2:33 PM
Yes you can get an access of the importing parameter.
Try like this:
ld_class = '(SAPLRSBOLAP_BICS_CONSUMER)I_FUNCTION_HANDLE'.
ASSIGN (ld_class) TO <lo_provider>.
I didn't realize that L_R_PROVIDER is local variable and hence we can't access it. I apologize for that.
Regards,
Naimesh Patel
‎2009 Jun 08 2:48 PM
Hello Rasmus
Most likely the answer is again: NO.
Why?
Looking at the "Attributes" tabstrip of fm BICS_CONS_EXECUTE_PLANNING_FUN you can see that the flag "Global" is NOT set. Thus, the interface parameters are NOT globally visible in the function group.
Regards
Uwe
‎2009 Jun 08 2:52 PM
‎2009 Jun 08 2:55 PM
Allright, who said it was going to be easy.
How about line no. 5.
this also holds the information that is need
But now it is a method call in a class.
Is it possible to get this class ?
CL_RSPLFR_WEB_START_SERVICE===CP
And how should it be written?
‎2009 Jun 09 11:42 AM
The class has a public attribute called n_handle which should reflect the I_FUNCTION_HANDLE from earlier.
I have tried 2 get it but unsuccesfull.
Here is what i have tried.
lookup_string = '(CL_RSPLFR_WEB_START_SERVICE===CP)N_HANDLE'.
ASSIGN (lookup_string) to <lookup>.
lookup_string = '(CL_RSPLFR_WEB_START_SERVICE)N_HANDLE'.
ASSIGN (lookup_string) to <lookup>.
lookup_string = '(CL_RSPLFR_WEB_START_SERVICE)IF_RSBOLAP_DATA_PROVIDER~N_HANDLE'.
ASSIGN (lookup_string) to <lookup>.
lookup_string = '(CL_RSPLFR_WEB_START_SERVICE===CP)IF_RSBOLAP_DATA_PROVIDER~N_HANDLE'.
ASSIGN (lookup_string) to <lookup>.
All the time <lookup> does not get assigned. Any ideas ?
‎2009 Jul 31 9:06 AM
‎2009 Sep 14 11:14 AM
‎2009 Sep 14 12:55 PM
Wow, first posted in June. I admire your persistence.
Unless I've missed something, this seems very straightforward. If n_handle is a public static attribute, you can get it directly, without needing the assign, or accessing the call stack.:
DATA: l_handle TYPE RSBOLAP_HANDLE.
DATA: l_r_data_provider TYPE REF TO if_rsbolap_data_provider
l_handle = CL_RSPLFR_WEB_START_SERVICE=>N_HANDLE. " you don't need the interface qualifier as this attribute is aliased
l_r_data_provider = cl_rsbolap_application=>get_data_provider_static( i_handle = l_handle ).matt
‎2010 Jan 15 12:54 PM
The attribute is not a static attribute but an instance variable.
Br Rasmus
‎2010 Jan 25 3:14 PM
Hello Rasmus,
have you already considered implementing the implicit enhancement point at the beginning of function module BICS_CONS_EXECUTE_PLANNING_FUN? You could write the value of I_FUNCTION_HANDLE to memory and access this value later in your code. If you have the handle, you can call the static method GET_DATA_PROVIDER_STATIC of class CL_RSBOLAP_APPLICATION to receive the desired object instance.
Regards,
David