Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8491

Class is instantiating with out having GET_INSTANCE method!

$
0
0

Hello

 

I saw a standard SAP class in PPM module, it doesn't have GET_INSTANCE method, but it has CLASS_CONSTRUCTOR and CONSTRUCTOR methods, and also it has GET_ATTRIBUTES method (actually, i want to call this method in my_z_prog), well.

 

Now, i want to use GET_ATTRIBUTES method of this class in my_z_prog, but when i checked this class in SE24 i didn't find any GET_INSTANCE method, hence i thought i can't use this class bcz of no chance of instantiting of this class

 

But, one of another developer (now, rolled off and out of project) called the same mathod / class by using the below code

 

DATA: lr_std_sap_class TYPE REF TO std_sap_class

 

CREATE OBJECT lr_std_sap_class

EXPORTING

iv_employee_number = lv_my_number

 

CALL METHOD lr_std_sap_class->get_attributes

IMPORTING

es_attributes = ls_my_attributes

Pls. let me know

 

1) With out having GET_INSTANCE method in it how its possible to create a OBJECT from out side (my_z_prog)?

 

2) What is the difference between GET_INSTANCE method and CONSTRUCOR method?

 

3) In this case how we are getting instance by using CREATE OBJECT?

 

4) The above is safe? i  mean, can go with the same approach?

 

When i tested this class in SE24 i saw the INSTANCE push button on the tool bar

 

Thank you


Viewing all articles
Browse latest Browse all 8491

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>