1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
DATA:
lt_result TYPE REF TO data,
lt_sel TYPE uj0_t_sel,
FIELD-SYMBOLS: <lt_result> TYPE STANDARD TABLE.
FIELD-SYMBOLS: <lt_data> TYPE STANDARD TABLE.
"设置过滤器
lt_sel = VALUE #( BASE lt_sel ( dimension = 'C_CATEGORY' option = 'EQ' sign = 'I' low = 'ACTUAL' ) ).
lt_sel = VALUE #( BASE lt_sel ( dimension = 'C_SCOPE' option = 'EQ' sign = 'I' low = 'F_NONE' ) ).
PERFORM frm_get_zbpc_model_data USING 'HUAYI_CONSOLIDATION' 'C_CONSOLIDATION' lt_sel CHANGING lt_result.
ASSIGN lt_result->* TO <lt_result>.
LOOP AT <lt_result> ASSIGNING FIELD-SYMBOL(<fs_result>).
ENDLOOP.
FORM frm_get_zbpc_model_data USING i_appset_id TYPE uj_appset_id
i_appl_id TYPE uj_appl_id
pt_sel TYPE uj0_t_sel
CHANGING pt_result TYPE REF TO data.
DATA: lt_dim_list TYPE uja_t_dim_list,
lo_query TYPE REF TO if_ujo_query,
lt_message TYPE uj0_t_message.
FIELD-SYMBOLS: <lt_query_result> TYPE STANDARD TABLE.
FREE: pt_result.
REFRESH lt_dim_list.
CALL METHOD cl_ujp_utility=>get_dim_list
EXPORTING
i_appset_id = i_appset_id
i_application_id = i_appl_id
IMPORTING
et_dim_list = lt_dim_list.
CALL METHOD cl_ujp_utility=>create_data_ref
EXPORTING
i_appset_id = i_appset_id
i_application_id = i_appl_id
i_data_type = if_uja_application_manager=>gc_type_table
IMPORTING
er_data = pt_result.
ASSIGN pt_result->* TO <lt_query_result>.
TRY.
lo_query = cl_ujo_query_factory=>get_query_adapter( i_appset_id = i_appset_id i_appl_id = i_appl_id ).
lo_query->run_rsdri_query(
EXPORTING
it_dim_name = lt_dim_list " BPC: Dimension List
it_range = pt_sel " BPC: Selection condition
if_check_security = abap_false " BPC: Generic indicator
IMPORTING
et_data = <lt_query_result>
et_message = lt_message " BPC: Messages
).
CATCH cx_ujo_read. " Exception of common read
ENDTRY.
ENDFORM.
|