BPC Read Transaction Data From Dimension

How to read the transaction data which is stored in the BPC system or in various attributes of dimension.

DATA: lv_environment_id TYPE uj_appset_id VALUE ‘TESTENV’,
lv_application_id TYPE uj_appl_id VALUE ‘TESTMODEL’,
lt_dim_list TYPE uja_t_dim_list,
lo_appl_mgr TYPE REF TO if_uja_application_manager,
lo_query TYPE REF TO if_ujo_query,
lr_data TYPE REF TO data,
lt_message TYPE uj0_t_message,
ls_application type UJA_S_APPLICATION,
ls_dimensions type UJA_s_DIMENSION.

FIELD-SYMBOLS: <lt_query_result> TYPE STANDARD TABLE.

lo_appl_mgr = cl_uja_bpc_admin_factory=>get_application_manager(
i_appset_id = lv_environment_id
i_application_id = lv_application_id ).

clear ls_application.

lo_appl_mgr->GET(
exporting
IF_WITH_MEASURES = ABAP_FALSE ” BPC: Generic indicator
IF_SUMMARY = ABAP_FALSE ” BPC: Generic indicator
importing
ES_APPLICATION = ls_application ). ” Applications table type

refresh lt_dim_list.

loop at ls_application-dimensions into ls_dimensions.
append ls_dimensions-dimension to lt_dim_list.
endloop.

lo_appl_mgr->create_data_ref(
EXPORTING
i_data_type = ‘T’
it_dim_name = lt_dim_list
if_tech_name = abap_false
if_signeddata = abap_true
IMPORTING
er_data = lr_data ).
ASSIGN lr_data->* TO <lt_query_result>.

TRY.
lo_query = cl_ujo_query_factory=>get_query_adapter(
i_appset_id = lv_environment_id
i_appl_id = lv_application_id
).

lo_query->run_rsdri_query(
EXPORTING
it_dim_name = lt_dim_list ” BPC: Dimension List
* it_range = ” BPC: Selection condition
if_check_security = ABAP_FALSE ” BPC: Generic indicator
* i_packagesize = ” BPC: Size of Returned Data Package
* i_call_badi = ABAP_TRUE
* if_db_aggregate = ABAP_TRUE ” BPC: Generic indicator
IMPORTING
et_data = <lt_query_result>
* e_end_of_data = ” BPC: Last Data Package Yes/No
* e_split_occurred = ” Result may not be completely aggregated
et_message = lt_message ” BPC: Messages
* e_stats_guid = ” BPC: Statistics Session
* e_cell_filted =
* CHANGING
* c_first_call = ” BPC: First Call Yes/No
).

* CATCH cx_ujo_read. ” Exception of common read

CATCH cx_ujo_read. ” Exception of common read

ENDTRY.

Leave a Reply

Your email address will not be published. Required fields are marked *