Skip to Content
0
Former Member
May 06, 2010 at 01:33 PM

problem with method cl_os_system=>get_class_agent

26 Views

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