‎2011 May 25 2:27 PM
Hi Experts,
I've just created an abap proxy dynamically
FIELD-SYMBOLS <ref> TYPE any.
CREATE DATA dref TYPE REF TO
(ld_class).
ASSIGN dref->* TO <ref>.
CREATE OBJECT <ref>
TYPE
(ld_class)
EXPORTING
logical_port_name =logicalport.
This runs OK
But I can't call an Interface of the object proxy that belongs to ld_class
ld_prot ?= <ref>->if_proxy_basis~get_protocol( if_wsprotocol=>sequence ).
because the object <ref> is type any, it doesen't runs
This work' s fine
MOVE <ref> ?TO proxy1.
ld_prot ?= proxy->if_proxy_basis~get_protocol( if_wsprotocol=>sequence )
if proxy is explicity declarated like class proxy
But I don't want do it. I want do it dynamically to avoid write data declaration explicity
I think this is a problem for every data that must be declarated by the form TYPE REF TO
What must I do ?
thanks in advance.
‎2011 May 25 2:34 PM
‎2011 May 25 3:25 PM
‎2011 May 27 8:50 AM
Get the name of the method into a string - l_method, say. Then use: CALL METHOD <ref>->(l_method) EXPORTING... I'm not sure you need to use a field symbol though - consider this:
DATA: lr_proxy TYPE REF TO OBJECT, "Maybe CL_PROXY_BASIS instead of OBJECT???
l_method TYPE string.
CREATE OBJECT lr_proxy TYPE (ld_class).
CALL METHOD lr_proxy->(l_method) EXPORTING.
(Thread moved to ABAP Object forum)