2010 Dec 21 5:58 PM
we have a BADI object of type ISU_UCES_CO_NEW. now in the codes of a FM this object is assigned with values. one of the value assigned is a class object ZCL_ISU_UCES_CO_NEW in the object.
We need to access the attribute of the sub class ZCL_ISU_UCES_CO_NEW inside the main object ISU_UCES_CO_NEW.
Checking in the debugging we are able to see the value but need to access it through the program.
How to access the class attributes with in a class .
Your ideas are appreciated.
we have a BADI object of type ISU_UCES_CO_NEW. now in the codes of a FM this object is assigned with values. one of the value assigned is a class object ZCL_ISU_UCES_CO_NEW in the object.
We need to access the attribute of the sub class ZCL_ISU_UCES_CO_NEW inside the main object ISU_UCES_CO_NEW.
Checking in the debugging we are able to see the value but need to access it through the program.
How to access the class attributes with in a class .
Your ideas are appreciated.
2010 Dec 29 8:05 AM
you need to cast your object into an instance of the ZCL_ISU_UCES_CO_NEW class in order to access its proper attributes
so if you have a parameter of type ref to ISU_UCES_CO_NEW called P_UCES you do it like this:
DATA: lo_uces TYPE REF TO zcl_isu_uces_co_new.
lo_uces ?= p_uces.
* now you have access to attributes of object lo_uces
2010 Dec 29 11:04 PM
The casting of lo_uces ?= p_uces. throws a syntax error for incompatibility.
lo_uces TYPE REF TO zcl_isu_uces_co_new
P_UCES TYPE REF TO isu_uces_co_new
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |