Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

[Debugger] How to get access to an object instance without reference variable

nikbereziuk
Explorer

Folks,

I'm curious if there is a way to get access to an object instance in Debugger if this instance hasn't been assigned to any local reference variable?

Example:

data(lv_check2) = zcl_rebate_split_singleton=>get_instance( )->is_split_process_activated( ).

How do I display the instance of ZCL_REBATE_SPLIT_SINGLETON in order to see its attributes? Yes, of course, I could firstly assign the instance to some reference variable (let's say, "lo_instance"), and in the next line get the flag (lo_instance->is_split_process_activated( ) ), and just display the content of lo_instance to see all its attributes... But can I achieve the same without the variable?

Not a critical question, but I'd like to know.

Thanks in advance,

Mykyta

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

With the backend debugger, you may look at the static attributes of a class as if it was a normal variable by entering {C:classname}. In your case, it will be:

{C:zcl_rebate_split_singleton}

.

EDIT: does anybody know something equivalent in the Eclipse ADT debugger ?

.

6 REPLIES 6

Sandra_Rossi
Active Contributor

With the backend debugger, you may look at the static attributes of a class as if it was a normal variable by entering {C:classname}. In your case, it will be:

{C:zcl_rebate_split_singleton}

.

EDIT: does anybody know something equivalent in the Eclipse ADT debugger ?

.

Jelena
Active Contributor

"Today I learned..." 🙂 Thank you!

former_member697070
Discoverer
0 Kudos

Hi All,

I am trying to capture an existing class instance in memory stack at the run-time.

This is not working. Do you know how can be this achieved. Thank you in advance.

Br

Hakan

DATA clazz TYPE REF TO /sapsrm/cl_fpm_gaf_provider.

FIELD-SYMBOLS: <var> TYPE any.

ASSIGN '{C:/SAPSRM/CL_FPM_GAF_PROVIDER}' TO <var>.

clazz = <var>.

That does not answer the question and it's not related to the debugger, please ask your own question.

0 Kudos

Should be called instance not clazz. Bad design.

0 Kudos

Under loaded programms are various classes.

how can assign the shown reference {C:CL_DYNP_RAL_API} to <var>

e.g.

DATA clazz TYPE REF TO {C:CL_DYNP_RAL_API}.

FIELD-SYMBOLS: <var> TYPE any.

ASSIGN '{C:CL_DYNP_RAL_API}' TO <var>.

clazz = <var>. "this is not working!!!

br

H.A.