‎2006 Sep 09 10:24 AM
Hi,
Where we can find parameters needed to pass while creating a object. Ex : create object grid
exporting
<parameters needed>
Regards,
Satya
‎2006 Sep 09 10:32 AM
‎2006 Sep 09 10:36 AM
hi naga,
chk this.
DATA: grid1 TYPE REF TO cl_gui_alv_grid,
custom_container1 TYPE REF TO cl_gui_custom_container.
create a custom container control for our ALV Control
CREATE OBJECT custom_container1
EXPORTING
container_name = cont_on_main
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
CREATE OBJECT grid1
EXPORTING i_parent = custom_container1.
for any clarifiaction pls mail me.
pls reward points, if this helped u.
regards,
anversha.
anversha.shahul@wipro.com
‎2006 Sep 09 12:20 PM
Hi,
The only place to find the parameters to be passed while creating an object of a class is method <b>'CONSTRUCTOR'</b> in class definition. This method is called when the statement 'create object objname' is executed.
Suppose you need to create an object of type 'cl_gui_alv_grid'. Go to definition of this class in transaction SE24 and look for method 'CONSTRUCTOR'. In this particular case, there are eight parameters that can be supplied while creating the object however, only one i.e. 'I_PARENT' type ref to CL_GUI_CONTAINER is mandatory. You can also use an object of type 'CL_GUI_CUSTOM_CONTAINER' in place of 'CL_GUI_CONTAINER' as 'CL_GUI_CUSTOM_CONTAINER' is a subclass of 'CL_GUI_CONTAINER' and as such has access to all its components.
Hope this was helpful.
Regards.
‎2006 Sep 09 8:18 PM
Hello Naga
If a class has a CONSTRUCTOR method then simply check which of its IMPORTING are obligatory (= not optional).
However, sometimes the instantiation of classes is protected or even private. In this case, there will be a "factory" class which usually has a CREATE method to instantiate objects (e.g. CL_RECA_MESSAGE_LIST and CF_RECA_MESSAGE_LIST=>CREATE). In these cases you have to check the CREATE method for obligatory parameters.
Regards
Uwe