on 2019 Aug 01 4:35 AM
Hi Experts,
I am trying to read material components after its BOM explosion in Z report. I am using one class to get this component details passing KEKO structure(Kalnr, material, plant and other details are added).
Code Snippet :
DATA : lvr_costs TYPE REF TO CL_COSTING_PERSISTENCE.
CREATE OBJECT lvr_costs.
CALL METHOD lvr_costs->costing_read_simple
EXPORTING
im_kekokey = ls_kekokey
im_read_mode = '0'
IMPORTING
ex_itemization = l_temization
ex_ccs = l_ccs
ex_costing_inconsistent = l_inconsistent
* ex_ccs_location =
* ex_itemization_location =
EXCEPTIONS
internal_error = 1
not_found = 2
others = 3
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
Error while activating : An instance of the class "CL_COSTING_PERSISTENCE" can only be created within the class itself or within one of its subclasses.
Please suggest way to remove this error or any FM to get component of material after BOM explosion.
If you look at the class CL_COSTING_PERSISTENCE you can see it has protected instance generation set, meaning its constructor cannot be called from the outside. This is because it implements the singleton design pattern.
Use CL_COSTING_PERSISTENCE=>CREATE for instantiation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.