Skip to Content
0
Former Member
Jul 25, 2013 at 09:23 AM

how to access instance attribute if the standard class does not allow to instantiate outside

187 Views

Hi All,

I am trying to copy some standard functionality into a custom application. I want to do the following.

DATA: l_response TYPE REF TO if_http_response.
DATA: server TYPE REF TO if_http_server.

l_response = server->response.

with this piece of code i am getting runtime dump that the objref is not assigned and dats quite true since server was not instantiated.

now if i try to instantiate the server as follows.

DATA: l_response TYPE REF TO if_http_response.
DATA: server TYPE REF TO if_http_server.

create object server type cl_http_server.

i am getting the syntax error you can only create the instance of the class cl_http_server within the class itself or within one of its subclasses.

Any ideas ?

Thanks

Linda