cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass memberset rules (BAS,DEP etc) to CALL METHOD lo_sqe->run_axis_query_symm

a_khanevich
Explorer
0 Kudos
1,498

Dear Experts,

I am trying to use basic BPC Data reading approach in SAP BPC 10.1 NW classic environment according to published How-to guide (How To Migrate BPC 7.x BADIs to BPC 10).
I need to read data from parent members so I use axis query (call method lo_sqe->run_axis_query_symm).

call method lo_sqe->run_axis_query_symm 
  exporting 
    it_axis   = lt_axis 
    it_slicer = lt_slicer 
  importing 
    et_data   = <lt_query_result>. 

Does anyone know how to pass memberset rules (BAS,DEP etc) to such queries?
According to Appendix B I see that "ls_member" variable has "MEMBERSET_FORMULA" parameter but I have no idea how to use it.

ls_member-dimension = 'ACCOUNT'. 
ls_member-member = 'PL110'. " <--- need something like BAS(PL_TOTAL) here
insert ls_member into table ls_axis. 
insert ls_axis into table lt_axis. 
clear ls_axis. 

Please, share your ideas.

Regards,

Oleg.

View Entire Topic
former_member186338
Active Contributor

My code sample to use scope defined in the script to query data inside badi:

DATA:     ls_axis type ujo_t_members,
          lt_axis type ujo_t_query_dim,
          lt_dim_list type uja_t_dim_list,
          ls_member type ujo_s_member,
          l_dimname TYPE uj_dim_name,
          l_member TYPE UJ_DIM_MEMBER.
          lr_data type ref to data,
          lo_sqe type ref to if_ujo_query,
          lr_rec TYPE REF TO data,
          lo_appl_mgr type ref to if_uja_application_manager.

FIELD-SYMBOLS: <ls_rec> TYPE ANY,
               <ls_cv> TYPE UJK_S_CV.
               <lt_query_result> type standard table.

    LOOP AT it_cv ASSIGNING <ls_cv>.
      l_dimname = <ls_cv>-DIMENSION.
      append l_dimname to lt_dim_list.
      LOOP AT <ls_cv>-MEMBER INTO l_member.
        ls_member-DIMENSION = l_dimname.
        ls_member-MEMBER = l_member.
        insert ls_member into table ls_axis.
      ENDLOOP.
      insert ls_axis into table lt_axis.
      clear ls_axis.
    ENDLOOP.

    TRY.
    call method cl_uja_bpc_admin_factory=>get_application_manager
    exporting
    i_appset_id = i_appset_id
    i_application_id = i_appl_id
    receiving
    ro_return = lo_appl_mgr.

    call method 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>.

    call method cl_ujo_query_factory=>get_query_adapter
    exporting
    i_appset_id = i_appset_id
    i_appl_id = i_appl_id
    receiving
    adapter = lo_sqe.

    call method lo_sqe->run_axis_query_symm
    exporting
    it_axis = lt_axis
    it_slicer = lt_slicer
    importing
    et_data = <lt_query_result>.

    CATCH
       cx_ujo_read
       cx_uj_static_check INTO lx_static.
    ENDTRY.

    CREATE DATA lr_rec LIKE LINE OF <lt_query_result>.
    ASSIGN lr_rec->* TO <ls_rec>.

    "Loop through incoming data and create a result set
    LOOP AT <lt_query_result> ASSIGNING <ls_rec>.
    " Your code here!
    ENDLOOP.

P.S. If you want to select members in APAP then look on:

cl_ujk_model=>get_children

i_parent_mbr - parent member

i_type export parameter can be:

"ALL" (children member from all levels), "DEP" (children members from one level lower than the parent), "BAS" (base members only)

a_khanevich
Explorer
0 Kudos

I am using run_axis_query_symm method in custom abap report so I don't have it_cv in my scope and I am not going to run this code via bpc badi call.
I just need to know how to correctly populate lt_axis for dimension with memberset rule like "all base members for specific parent".
For example, I want to specify somehow rule BAS(2017.TOTAL) for TIME dimension in ls_member and to get in the result rows with TIME=2017.01,2017.02...2017.12.

0 Kudos

Hi Vadim, this thread is exactly what I've been looking for 🙂 One question though - I've noticed that you're passing lt_slicer in this call:

callmethod lo_sqe->run_axis_query_symm
    exporting
    it_axis = lt_axis
    it_slicer = lt_slicer
    importing
    et_data =<lt_query_result>.

May I ask what data do you fill in there? Can you please briefly explain what is this parameter for?

Many thanks in advance!

Matus

former_member186338
Active Contributor
0 Kudos

2 matuslojan

Sorry, but I do not comment on old questions!

Please, open a new question and clearly explain, what is your issue!