cancel
Showing results for 
Search instead for 
Did you mean: 

data count mismatch between CT_DATA and internal table in BADI

Former Member
0 Kudos

Hi all,

I am trying to understand why would there be different data count for CT_DATA and my internal table <lt_tx_data> in the code below. I am not restricting with any XDIM command. I run my BADI through UJK_SCRIPT_LOGIC_TESTER using *CALL_CUSTOM_LOGIC CUST_CALC_ACCT.

My data count is as follows in debug mode:

<LT_TX_DATA> Standard Table[16789x8(292)]

CT_DATA Standard Table[9259x9(332)]


break-point.
DATA: lo_dataref TYPE REF TO data.
DATA: lo_model  TYPE REF TO if_uj_model.
DATA: lo_appl TYPE REF TO cl_uja_application .

DATA: lt_appl_dim TYPE uja_t_appl_dim.
DATA: ls_appl_dim LIKE LINE OF lt_appl_dim.

DATA: lt_dim_name TYPE ujq_t_dim.
DATA: ls_dim_name LIKE LINE OF lt_dim_name.

DATA: lv_appset_id TYPE uj_appset_id VALUE 'Test_AppSet_DD'.
DATA: lv_application_id TYPE uj_appl_id VALUE 'PLANNING'.

FIELD-SYMBOLS: <lt_tx_data> TYPE STANDARD TABLE.

* Get applications dimensions
CREATE OBJECT lo_appl
  EXPORTING
    i_appset_id      = lv_appset_id
    i_application_id = lv_application_id.

REFRESH lt_appl_dim.
lo_appl->get_appl_dim(
          EXPORTING
              i_appl_id   = lv_application_id
          IMPORTING
              et_appl_dim = lt_appl_dim ).

* populate internal table for SQE call
REFRESH lt_dim_name.
LOOP AT lt_appl_dim INTO ls_appl_dim.
  ls_dim_name = ls_appl_dim-dimension.
  APPEND ls_dim_name TO lt_dim_name.
ENDLOOP.

* Get the structure of the result
TRY.
    lo_model = cl_uj_model=>get_model( lv_appset_id ).
    lo_model->create_tx_data_ref(
     EXPORTING
       i_appl_name  = lv_application_id
       i_type       = 'T'
       it_dim_name  = lt_dim_name
       if_tech_name = space
     IMPORTING
       er_data      = lo_dataref ).
  CATCH cx_uj_static_check.
ENDTRY.

ASSIGN lo_dataref->* TO <lt_tx_data>.

* Call SQE to read transaction data
TRY.
    CALL FUNCTION 'UJQ_RUN_RSDRI_QUERY'
      EXPORTING
        i_appset_id       = lv_appset_id
        i_appl_id         = lv_application_id
        it_dim_name       = lt_dim_name
        if_check_security = abap_false
      IMPORTING
        et_data           = <lt_tx_data>.
  CATCH cx_ujq_exception.

ENDTRY.

thanks in advance.

Diksha.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member200327
Active Contributor
0 Kudos

Hi Diksha,

Do you have QUERY = ON or OFF in your BAdI call? How many do you really have in that InfoCube?

Regards,

Gersh

Former Member
0 Kudos

Hi,

My query is OFF which is I guess the default value and my InfoCube count is 17308.

I am not able to see my 2010 data in neither of the tables.

Thanks,

Diksha.

former_member200327
Active Contributor
0 Kudos

Hi Diksha,

QUERY = OFF means that BPC doesn't call SQE before calling BAdI. It surprises me that you have some data in CT_DATA at all.

So, if you want to have in CT_DATA same records as when you call SQE you have to set QUERY = ON.

Regards,

Gersh

Former Member
0 Kudos

Hi Gersh,

I change my code to following

*START_BADI ztest_dd
     QUERY = ON
*END_BADI

The debug mode shows me the following count:

<LT_TX_DATA> Standard Table[16984x9(332)]

CT_DATA[] Standard Table[9454x10(372)]

Thanks for your help,

Diksha.

former_member200327
Active Contributor
0 Kudos

Hi Diksha,

I just noticed that you have check_security = abap_false in the SQE call. Do you have any member access security on that Application? If you do, can you change that parameter to abap_true?

Cheers,

Gersh