Hi Folks,
I'm currenty writing a user exit in SAP BW and in this user exit I would like to retrieve the value of a certain instance attribute but I don't manage to do this.
Let me explain you what I mean. At a certain point in some standard code a "create object query" statement occurs which declares a certain class. Via query->n_handle the value of an attribute can be derived in this standard program.
But... then the user exit is being called but I don't have access anymore to query->n_handle. The strange thing is I'm 100% sure the class can still be accessed as I tested in debugging node that I can view the class instance 3<\CLASS=CL_RSR_REQUEST> in debugging mode on the tabstrip table where you usually view internal tables. This instance was created in the standard program via "create object query". Why can't I access this anymore in the user exit while I can perfectly view the class in this user exit while in debugging mode. Can anyone give me a hint how to fetch the value from the attribute of 3<\CLASS=CL_RSR_REQUEST> as I need this badly.
Thanks in advance.
I assume that your exit is probably a Customer Function or a BADI. Because of the scope of the interface into the object you are within, you no longer have visibility to the variable holding the pointer to the instance of your class. In other words, you can only see the variables that are exposed to your exit.
Now why can the debugger see the variable but you can't from the runtime? That has to do with the special way that the debugger actually references memory from any running program. Internally the debugger creates field symbols, referencing the program name and then the variable.
I don't think this is officially released ABAP functionality, but you should be able to do the same in your program if you create a field name variable and structure the value as follows: (EXTERNAL_PROGRAM)EXTERNAL_VARIABLE. Then assign this fieldname to a Field Symbol. You should then have a field symbol that points to a variable outside of your program area.
Hi,
i tried to understand and reuse your posted ideas. Does i understand right this is a way to
save the reference to a class instance. why you dont use a data object wich type is ref to cl_class like:
data: r_ref type ref cl_class.
Wich version of WAS do you use, i use 6.20 and get errors by exectuing your reports.
Thank you for answering my question.
Add a comment