Skip to Content
0

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

Dec 01, 2016 at 09:48 AM

103

avatar image

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.


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Vadim Kalinin Dec 04, 2016 at 11:01 AM
0

"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!

Show 3 Share
10 |10000 characters needed characters left characters exceeded

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

0

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.
0

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

0
Vadim Kalinin Dec 01, 2016 at 10:12 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

It's standalone function module ..

0
Vadim Kalinin Dec 01, 2016 at 12:27 PM
0

Please read this document and compare with you code:

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

Show 11 Share
10 |10000 characters needed characters left characters exceeded

Thank you so much Sir!!!

0

What's the issue?

0

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

0

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

0

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

0

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!

0

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

0

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

0

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

0

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.

0
Show more comments