cancel
Showing results for 
Search instead for 
Did you mean: 

Reading dim from abap gives me "Error in Admin module or a component used by Admin module"

Former Member
0 Kudos

I am writing abap code to read the content or a dimension, but I got this error:

"Error in Admin module or a component used by Admin module" what does this error mean ?

My code is as follow:

 data:
    or_dim      type ref to cl_uja_dim,
    or_dim_data type ref to if_uja_dim_data,
    i_dim_attr  type uja_t_attr_name,
    w_dim_data  type ref to data,
    or_data     type ref to data,
    i_sel       type uj0_t_sel,
    w_sel       type line of uj0_t_sel.


  field-symbols:
    <i_dim> type standard table,
    <w_dim> type any.


  data:
    v_dim_name  type uj_dim_name value 'INDICATORS_RBM',
    v_appset_id type uj_appset_id value 'X_RBM'.


  data: or_error type ref to cx_uja_admin_error.


  try.
      create object or_dim
        exporting
          i_appset_id = v_appset_id
          i_dimension = v_dim_name.
    catch cx_uja_admin_error into or_error.
      message or_error->get_text( ) type 'W'.
    cleanup.
  endtry.


* Add dim properties to the intrnal table
  refresh: i_dim_attr, i_sel.
  clear w_sel.

  append: 'ID' to i_dim_attr,
          'DESCRIPTION' to i_dim_attr.

  w_sel-dimension = v_dim_name.
  w_sel-attribute = 'CALC'.
  w_sel-sign = 'EQ'.
  w_sel-option = 'I'.
  w_sel-low = 'N'.

  append w_sel to i_sel.

* Try read dimesnion according to the selectino criteria
  or_dim_data = or_dim.
  try.
      call method or_dim_data->read_mbr_data
        exporting
          it_attr_list = i_dim_attr
          it_sel       = i_sel
        importing
          er_data      = w_dim_data.
    catch cx_uja_admin_error into or_error.
      message or_error->get_text( ) type 'W'.
    cleanup.
  endtry.


Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

"I created a z program for Example E: Read Transaction Data via RSDRI ..

I got error CX_UJ_NO_AUTH, it seems I don't have the required permissions ?"

Looks like!

Try the first Example B - absolutely simple and has to work if you have permissions!

former_member186338
Active Contributor
0 Kudos

In general always start with very simple things and ensure that simple code is working. Then continue with advance coding...

former_member186338
Active Contributor
0 Kudos

By the way, for some methods to work properly in standalone model you need to set context:

DATA: l_appset_id type uj_appset_id value 'SIM',
l_appl_id type uj_appl_id value 'INPER',
l_user type UJ0_S_USER.

l_user-user_id = 'V.KALININ'.
CALL METHOD cl_uj_context=>set_cur_context
EXPORTING
i_appset_id = l_appset_id
is_user = l_user
i_appl_id = l_appl_id.
Former Member
0 Kudos

Yes, it was an authorization issue, now it is working, thank you for you help!!

Answers (2)

Answers (2)

former_member186338
Active Contributor
0 Kudos

Please read this document and compare with you code:

http://go.sap.com/documents/2015/08/6c91e080-5b7c-0010-82c7-eda71af511fa.html#

Former Member
0 Kudos

Thank you so much Sir!!!

former_member186338
Active Contributor
0 Kudos

What's the issue?

Former Member
0 Kudos

Thank you for the document, but the issue is still open. I tried the code in the document, but have the same problem!!

Former Member
0 Kudos

After debugging, the error is in the following line

lo_measure_dim ?= io_dim.

When trying to cast reference io_dim to lo_measure_dim

former_member186338
Active Contributor
0 Kudos

Please provide your new code! You are doing something wrong...

Former Member
0 Kudos

The error is cx_sy_move_cast_error type, where the lo_measure_dim is type of cl_uja_measure_dim and the io_dim is type of CL_UJA_DIM

former_member186338
Active Contributor
0 Kudos

Sorry, FULL code! Do you understand that I don't see your screen 🙂

former_member186338
Active Contributor
0 Kudos

Do you understand "FULL"? Do you really think that it's possible to find the issue with one line of code?

Start with simple things, try to recreate example from the link I mentioned using your names!

Former Member
0 Kudos

The error is here:

TRY.
          lo_measure_dim ?= io_dim.
          lo_dim_manager = cl_uja_bpc_admin_factory=>get_dimension_manager(
            i_appset_id = lo_measure_dim->d_appset_id
            i_application_id = lo_measure_dim->d_appl_id
            i_dimension_id = lo_measure_dim->ds_dim-dimension
          ).
        CATCH cx_sy_move_cast_error.
          lo_dim_manager = cl_uja_bpc_admin_factory=>get_dimension_manager(
            i_appset_id = io_dim->d_appset_id
            i_dimension_id = io_dim->ds_dim-dimension
          ).
      ENDTRY.

The code is in the class CL_UJA_MD_QUERY_OPT in the method set_dim

The issue that the lo_dim_manager is initial

former_member186338
Active Contributor
0 Kudos

Unfortunately you still don't understand me! Your code abstract will not help to find the issue (without declarations, variable assignments, etc).

Recommendation:

Create a new Z report and test the code from sample.

Former Member
0 Kudos

I created a z program for Example E: Read Transaction Data via RSDRI ..

I got error CX_UJ_NO_AUTH, it seems I don't have the required permissions ?

former_member186338
Active Contributor
0 Kudos

Please explain where do you write this code? Is it a badi or...

Former Member
0 Kudos

It's standalone function module ..