2007 May 25 1:24 PM
Hi friends,
How are you all doing...
Can any one say how to call method 'on_costing_component_to_outtab' which belongs to the class 'cl_im__gui_itemization_ck'. Here the problem is two of this method parameters l_cl_cost_estimate & l_cl_costing_component are referred to further classes.
I declared in below faction and it is working fine when this method has normal code. Inside this method if some other class method is call then it is giving dump saying that paramether l_cl_cost_estimate & l_cl_costing_component are passed null and could not recognious until runtime. So how to make this method to work, there is one more class method called inside of this method. If i am creating objects for l_cl_cost_estimate & l_cl_costing_component then it is saying sub classes cannot be created.
Please give guidance for this so that i proceed further. Its very urgent friends.
Data: l_cl_exm_im_gui_itemization_ck TYPE REF TO cl_im__gui_itemization_ck,
l_cl_cost_estimate TYPE REF TO cl_cost_estimate,
l_cl_costing_component TYPE REF TO cl_costing_component.
create object: l_cl_exm_im_gui_itemization_ck.
CALL METHOD l_cl_exm_im_gui_itemization_ck->if_ex_gui_itemization_ck~on_costing_component_to_outtab
EXPORTING
im_execution_service = l_ck_execution_service
im_cost_estimate = l_cl_cost_estimate "class
im_costing_component = l_cl_costing_component "class
im_gui_currency = l_ck_ewknz
CHANGING
ch_outtab_line = ws_ch_outtab_line.
-
METHOD if_ex_gui_itemization_ck~on_costing_component_to_outtab.
....
...
CALL METHOD im_cost_estimate->set_state
EXPORTING
im_calc_requested = ckc_yes.
ENDMETHOD.
-
2007 May 25 5:50 PM
Hello Srikanth
You cannot provide empty reference variables to the method but you need to have <b>instances </b>of CL_COST_ESTIMATE and/or CL_COSTING_COMPONENT.
The CONSTRUCTOR method of CL_COST_ESTIMATE has an optinal parameter IM_QUANTITY (of type CKBK_QUANTITY) and
CL_COSTING_COMPONENT has an optional parameter IM_QUANTITY (of type CKF_QUANTITY).
Based on your business scenario you have to provide reasonable values for these importing parameters and create instances of both classes. These instances are then "fed" to method ON_COSTING_COMPONENT_TO_OUTTAB.
Regards
Uwe
Hi friends,
How are you all doing...
Can any one say how to call method 'on_costing_component_to_outtab' which belongs to the class 'cl_im__gui_itemization_ck'. Here the problem is two of this method parameters l_cl_cost_estimate & l_cl_costing_component are referred to further classes.
I declared in below faction and it is working fine when this method has normal code. Inside this method if some other class method is call then it is giving dump saying that paramether l_cl_cost_estimate & l_cl_costing_component are passed null and could not recognious until runtime. So how to make this method to work, there is one more class method called inside of this method. If i am creating objects for l_cl_cost_estimate & l_cl_costing_component then it is saying sub classes cannot be created.
Please give guidance for this so that i proceed further. Its very urgent friends.
Data: l_cl_exm_im_gui_itemization_ck TYPE REF TO cl_im__gui_itemization_ck,
l_cl_cost_estimate TYPE REF TO cl_cost_estimate,
l_cl_costing_component TYPE REF TO cl_costing_component.
create object: l_cl_exm_im_gui_itemization_ck.
CALL METHOD l_cl_exm_im_gui_itemization_ck->if_ex_gui_itemization_ck~on_costing_component_to_outtab
EXPORTING
im_execution_service = l_ck_execution_service
im_cost_estimate = l_cl_cost_estimate "class
im_costing_component = l_cl_costing_component "class
im_gui_currency = l_ck_ewknz
CHANGING
ch_outtab_line = ws_ch_outtab_line.
-
METHOD if_ex_gui_itemization_ck~on_costing_component_to_outtab.
....
...
CALL METHOD im_cost_estimate->set_state
EXPORTING
im_calc_requested = ckc_yes.
ENDMETHOD.
-
2007 May 25 2:09 PM
2007 May 25 5:50 PM
Hello Srikanth
You cannot provide empty reference variables to the method but you need to have <b>instances </b>of CL_COST_ESTIMATE and/or CL_COSTING_COMPONENT.
The CONSTRUCTOR method of CL_COST_ESTIMATE has an optinal parameter IM_QUANTITY (of type CKBK_QUANTITY) and
CL_COSTING_COMPONENT has an optional parameter IM_QUANTITY (of type CKF_QUANTITY).
Based on your business scenario you have to provide reasonable values for these importing parameters and create instances of both classes. These instances are then "fed" to method ON_COSTING_COMPONENT_TO_OUTTAB.
Regards
Uwe
2007 May 26 5:50 AM
Hello Uwe Schieferstein,
When i am creating objects for this class cl_cost_estimate & cl_costing_component then it is giving error message sub classes are not allowed to create instances. Yet I am unable to solve this problem. If possible try to test in zprogram by call in this method.
Its not allowing me to create object in this faction.
l_cl_cost_estimate type ref to cl_cost_estimate
l_cl_costing_component type ref to cl_costing_component
then it is saying sub classes cannot be created.
Pls try this friends..
Thanks & Regards,
Chitupolu Srikanth..
2007 May 26 1:49 PM
2007 May 28 11:13 AM
You can create instances of Class <b>cl_cost_estimate</b> using method <b>create_simple</b> or <b>create_from_db_table</b>.
This class in declared with the attribute "Creation of Instances" as Protected, so the only ways to create an Instace are declaring an Inheriting class and then use the Instance method "Constructor" or create a new class, setting <b>cl_cost_estimate</b> as a friend, and then again call the method Constructor. Otherwise, you can use static methods to get an Instance of the class, and the correct methods are those mentioned above (they return an instance of the object itself).
As Static Methods (with ret parameter), you can call these like
lr_cost_estimate = cl_cost_estimate=>create_simple( EXPORTING .... ).
For class cl_costing_component, you can simply create an instance directly using Constructor (CREATE OBJECT <ref_obj>).
Hope this helps,
Roby.
Message was edited by:
Roberto Pagni
2007 May 29 5:18 PM
DATA: l_cl_exm_im_gui_itemization_ck TYPE REF TO zcl_im__gui_itemization_ck, "MAIN CLASS
l_cl_cost_estimate TYPE REF TO cl_cost_estimate, "CLASS
l_cl_costing_component TYPE REF TO cl_costing_component. "CLASS
DATA: l_costing_variant TYPE ckf_cost_estimate_header-costing_variant,
l_costing_model TYPE ck_costmodel,
ls_organization TYPE ckf_organization,
ls_costing_dates TYPE ckf_costing_dates,
l_exttx TYPE ck_adhoc_exttx, "kk_path
ls_texts TYPE khtu.
DATA: lr_cp TYPE REF TO cl_wrap_gen_cp_ck.
CREATE OBJECT lr_cp
EXPORTING
i_kokrs = ls_organization-controlling_area
i_bukrs = ls_organization-company_code
i_werks = ls_organization-plant
i_prctr = ls_organization-profit_center
I_GSBER =
I_KALSM =
I_ZSCHL =
I_KALNR =
i_klvar = l_costing_variant
I_OBJNR =
i_date_of_rates = ls_costing_dates-valuation_date
i_valuation_date = ls_costing_dates-valuation_date
i_date_from = ls_costing_dates-date_from
i_date_to = ls_costing_dates-date_to
I_REVENUES_ALLOWED = 'X'
i_revenue_det_type = 'N' "! for this display case:don't offer DIP
i_sd_doc_for_rev = i_sd_doc_for_rev
i_posnr_sd_doc_for_rev = i_posnr_sd_doc_for_rev
i_execution_profile = '0001'
i_description_cp = l_exttx. "ls_texts
assign object of costing
DATA: lr_object_of_costing TYPE REF TO if_object_of_costing.
lr_object_of_costing = lr_cp.
create ce
DATA: lr_cost_estimate TYPE REF TO cl_cost_estimate.
CALL METHOD cl_cost_estimate=>create
EXPORTING
im_costing_variant = l_costing_variant
im_object_of_costing = lr_object_of_costing
RECEIVING
re_cost_estimate = lr_cost_estimate.
l_cl_cOST_ESTIMATE = lr_cost_estimate.
create object : l_cl_exm_im_gui_itemization_ck,
l_cl_costing_component.
CALL METHOD l_cl_exm_im_gui_itemization_ck->IF_EX_GUI_ITEMIZATION_CK~on_costing_component_to_outtab
EXPORTING
im_execution_service = c_ck_execution_service
im_cost_estimate = l_cl_cOST_ESTIMATE
im_costing_component = l_cl_costing_component
im_gui_currency = c_ck_ewknz
CHANGING
ch_outtab_line = ws_ch_outtab_line.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |