05-25-2007 2:13 PM
Hi friends,
How are you all doing...
Reward will be given for guidence. Pls its urgent..
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.
-
05-25-2007 4:45 PM
Hi,
You need to create the objects of those classes before calling the method...
Go through the code...
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.
<b>create object cl_cost_estimate.
create object cl_costing_component.</b>
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.
-
Regards,
Azaz Ali.
05-25-2007 4:45 PM
Hi,
You need to create the objects of those classes before calling the method...
Go through the code...
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.
<b>create object cl_cost_estimate.
create object cl_costing_component.</b>
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.
-
Regards,
Azaz Ali.
05-29-2007 5:16 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.
05-26-2007 5:57 AM
Hello Azaz Ali,
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.
create object: 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..
05-26-2007 1:48 PM
05-26-2007 8:59 PM
Hello Srikanth
Instantiation of class CL_COST_ESTIMATE is protected. Thus, there should always be a static "factory" method or a factory class around for instantiang.
The following coding sample shows how to to instantiate the classes required for calling your method.
*&---------------------------------------------------------------------*
*& Report ZUS_SDN_COST_ESTIMATE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zus_sdn_cost_estimate.
DATA: gd_service TYPE ck_execution_service,
gd_currency TYPE ck_ewknz,
gd_line TYPE string,
gd_cost_var type CK_KLVAR,
go_cost_obj type ref to IF_OBJECT_OF_COSTING,
go_item_cc TYPE REF TO cl_im_gui_itemization_cc,
go_estimate TYPE REF TO cl_cost_estimate,
go_component TYPE REF TO cl_costing_component.
START-OF-SELECTION.
CREATE OBJECT go_item_cc.
" Create instance of go_cost_obj -> required
CALL METHOD cl_cost_estimate=>create
EXPORTING
* im_quantity = ckc_default_quantity
im_costing_variant = gd_cost_var
* im_valuation_date = sy-datum
* im_costing_date_from =
* im_costing_date_to =
* im_costing_version = '01'
* im_no_cost_rollup = space
* im_saving_allowed = 'x'
im_object_of_costing = go_cost_obj
* im_no_cost_estimate_ref =
receiving
re_cost_estimate = go_estimate
EXCEPTIONS
failed = 1
others = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT go_component
* EXPORTING
* im_quantity =
.
CALL METHOD go_item_cc->IF_EX_GUI_ITEMIZATION_CK~ON_COSTING_COMPONENT_TO_OUTTAB
EXPORTING
im_execution_service = gd_service
im_cost_estimate = go_estimate
im_costing_component = go_component
im_gui_currency = gd_currency
CHANGING
ch_outtab_line = gd_line.
END-OF-SELECTION.
Regards
Uwe