05-06-2010 2:33 PM
hey everybody,
maybe this is a silly question (I apologize in advance), but I'm just wondering about method get_class_agent.
Why doesn't it work like this?
DATA lo_gp_agent TYPE REF TO ZCL_SAMPLE1.
lo_agent ?= cl_os_system=>get_class_agent( 'ZCL_SAMPLE1' ).
If i declare a variable of type seoclskey and put the name of the variable into brackets it will work:
DATA: lo_gp_agent TYPE REF TO ZCL_SAMPLE1,
lv_clsname TYPE seoclskey.
lo_agent ?= cl_os_system=>get_class_agent( lv_clsname ).
I don't think this is very comfortable.. whenever I want to reference to another class agent I have to set lv_clsname?!
Does anybody have an idea why the first coding doesn't work?!
Thx. Anne
05-06-2010 3:14 PM
It is because SEOCLSKEY is the structure, not a Data Element. If it could be data element you can directly use the Class name in the I_CLASS_NAME. I guess, we don't have any other option other than taking the helper variable (LV_CLS_NAME type SEOCLSKEY) for the Class Name.
Regards,
Naimesh Patel
05-06-2010 3:14 PM
It is because SEOCLSKEY is the structure, not a Data Element. If it could be data element you can directly use the Class name in the I_CLASS_NAME. I guess, we don't have any other option other than taking the helper variable (LV_CLS_NAME type SEOCLSKEY) for the Class Name.
Regards,
Naimesh Patel
05-06-2010 3:18 PM
aahh.. stupid.. I just overlooked this information when looking up SEOCLSKEY in se11..
Thx. Problem solved!