读取BPC维度数据

 1 DATA lo_version_mgr TYPE REF TO if_uja_dim_tdh_version_manager.
 2 DATA g_keydate      TYPE uj_date.
 3 DATA l_dateto       TYPE uj_date.
 4 DATA lo_md_query    TYPE REF TO if_uja_md_query.
 5 DATA ls_sel         TYPE uj0_s_sel.
 6 DATA lt_sel         TYPE uj0_t_sel.
 7 DATA lt_data        TYPE REF TO data.
 8 DATA lo_md_reader   TYPE REF TO if_uja_md_reader.
 9 
10 
11 CREATE OBJECT lo_version_mgr TYPE cl_ujaa_dimension_tdh_version
12   EXPORTING
13     i_appset_id      = 'ENVIRONMENTSHELL'
14     i_dimension_name = 'ACCOUNT'.
15 
16 lo_version_mgr->get_current_version(
17     EXPORTING
18       i_current_date = g_keydate
19     IMPORTING
20       e_current_dateto = l_dateto
21       ).
22 
23 " 获取主数据查询实例
24 CALL METHOD cl_uja_bpc_admin_factory=>get_masterdata_query
25   EXPORTING
26     i_appset_id    = 'ENVIRONMENTSHELL'
27     i_dimension_id = 'ACCOUNT'
28   RECEIVING
29     ro_result      = lo_md_query.
30 
31 " 查询条件
32 CLEAR: ls_sel.
33 ls_sel-dimension = 'ACCOUNT'.
34 ls_sel-attribute = 'RATETYPE'.
35 ls_sel-sign      = uj00_cs_range-sign_i.
36 ls_sel-option    = uj00_cs_range-option_eq.
37 ls_sel-low       = 'AVG'.
38 APPEND ls_sel TO lt_sel.
39 
40 " 设置查询条件
41 CALL METHOD lo_md_query->set_sel
42   EXPORTING
43     it_sel = lt_sel.
44 
45 CREATE OBJECT lo_md_reader TYPE cl_ujam_master_data_reader
46   EXPORTING
47     iv_appset    = 'ENVIRONMENTSHELL'
48     iv_dimension = 'ACCOUNT'.
49 
50 " 读取数据
51 CALL METHOD lo_md_reader->read
52   EXPORTING
53     io_read_opt = lo_md_query
54   IMPORTING
55     er_data     = lt_data.

查询结果:

 

posted @ 2020-07-17 14:29  北斗星君  阅读(19)  评论(0编辑  收藏