SAP BPC Read Master Data

How to read the master data from the SAP BPC…

Yes, please use the following code to get master data in BPC 10.0. Notice the use of the “SEL_ALL_ATTR” method below. By passing the “Y” to the INC_TXT parameter, it will bring the description as well.

data: lv_appset_id type uj_appset_id value ‘TESTENV’,
lv_dim_name type uj_dim_name value ‘TESTMODEL’,
lt_attr_list type uja_t_attr_name,
lt_member type uja_t_dim_member,
lr_data type ref to data,
lo_query type ref to if_uja_md_query,
lo_md_reader type ref to if_uja_md_reader.

field-symbols: <lth_data> type hashed table,
<lt_data> type STANDARD TABLE,
<ls_data> type any.

lo_md_reader = cl_uja_bpc_admin_factory=>get_masterdata_reader(
i_appset_id = lv_appset_id
i_dimension_id = lv_dim_name ).

lo_query = cl_uja_bpc_admin_factory=>get_masterdata_query(
i_appset_id = lv_appset_id
i_dimension_id = lv_dim_name ).

* you can select all attributes using this method.

lo_query->select_all_attr(
IF_INC_NON_DISPLAY = ‘Y’
* IF_INC_GENERATE = space
IF_INC_TXT = ‘Y’
* IF_INC_SLT = space
).

lo_query->set_sel_members(
exporting
it_members = lt_member ).

lo_md_reader->read(
exporting
io_read_opt = lo_query
if_return_hash = abap_true
importing
er_data = lr_data ).

assign lr_data->* to <lth_data>.

Leave a Reply

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