cancel
Showing results for 
Search instead for 
Did you mean: 

Read from Composite Provider with ABAP

xient
Explorer
0 Kudos

Hello Colleagues,

does anyone know how to read data from a Composite Provider by any ABAP Class or FM or whatever? The classic FM "RSDRI_INFOPROV_READ" for instance does not work. Further functions like FM for reading data alternativly by using a query are also outdated as they don't recognize the "@3...." at the beginning the "Infoproviders' Name".

Any help is kindly appreciated.

Saludos,

Yavuz

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Yavuz,

in order to read a composite provider from a virtual provider I wrote some source code which is doing the work. The source code is in test phase at the moment but you can adapt it to your needs.

In my case I based my VPROV in Function module copying from the famous RSDRI_VPROV_READ_TEMPLATE. I also created a class which will is actually the one meant to perform the HCPR read.

In the FM, the only thing you need to do is to instance the class and then invoke the public method READ with the parameters provided in the FM as follows:

FM SOURCE CODE:

data: l_o_hcpr   type ref to ynn_hcpr.

data: l_t_data   type ref to data.

field-symbols:

       <l_t_data> type standard table.

*--------------------------------------------------------------------*

create data l_t_data like e_t_data.

assign l_t_data->* to <l_t_data>.

if <l_t_data> is assigned.

   create object l_o_hcpr

     exporting

       i_provider = 'YOUR_COMPOSITE_PROV_NAME_HERE'.

   call method l_o_hcpr->read

     exporting

       i_th_sfc      = i_th_sfc

       i_th_sfk      = i_th_sfk

       i_t_range     = i_t_range

       i_first_call  = i_first_call

       i_packagesize = i_packagesize

*    importing

*     e_t_msg       =

     changing

       c_end_of_data = e_end_of_data

       c_t_data      = l_t_data.

   e_t_data[] = <l_t_data>[].

endif.

For this you will need to create the following class:

CLASS SOURCE CODE:

class YNN_HCPR definition

   public

   final

   create public .

public section.

   types:

     begin of l_ty_s_iobjalias,

            iobjnm   type rsiobjnm,

            fieldnm  type rsdiobjfieldnm,

            iobjtp   type rsiobjtp,

            sidalias type rsalias,

            selalias type rsalias.

   types: end of l_ty_s_iobjalias .

   types:

     l_ty_t_iobjalias type standard table of l_ty_s_iobjalias .

   data G_O_HCPR type ref to CL_RSO_HCPR .

   data G_T_DTA_PRO type RSD_T_DTA_PRO .

   data G_S_DTA type RSD_S_DTA .

   data G_TH_SFC type RSDD_TH_SFC .

   data G_TH_SFK type RSDD_TH_SFK .

   data G_T_DATA type ref to DATA .

   methods CONSTRUCTOR

     importing

       !I_PROVIDER type RSOHCPRNM .

   methods READ

     importing

       !I_TH_SFC type RSDRI_TH_SFC

       !I_TH_SFK type RSDRI_TH_SFK

       !I_T_RANGE type RSDRI_T_RANGE

       !I_FIRST_CALL type RS_BOOL

       !I_PACKAGESIZE type I

     exporting

       !E_T_MSG type RS_T_MSG

     changing

       !C_END_OF_DATA type RS_BOOL

       !C_T_DATA type ref to DATA

     exceptions

       ERROR_MAPPING_OUTPUT

       ERROR_BUILDING_SELECTIONS .

protected section.

   data G_T_ALIAS type L_TY_T_IOBJALIAS .

   data G_T_EXTAB type SLIS_T_EXTAB .

   data G_R_STRUCT type ref to CL_ABAP_STRUCTDESCR .

   methods _CREATE_DATA

     importing

       !I_TH_SFC type RSDRI_TH_SFC

       !I_TH_SFK type RSDRI_TH_SFK

     exceptions

       ERROR_CREATING_DATA .

   methods _MAP_OUTPUT

     importing

       !I_T_DATA type ref to DATA

     changing

       !C_T_DATA type ref to DATA

     exceptions

       ERROR_MAPPING_OUTPUT .

   methods _ADDITIONAL_CALCULATION

     changing

       !C_T_DATA type ref to DATA .

   methods _BUILD_SELDR_TABLE

     importing

       !I_T_RANGE type RSDRI_T_RANGE

     changing

       !C_TSX_SEL type RSDD_TSX_SELDR

     exceptions

       ERROR_BUILDING_SELECTIONS .

   methods _INSTANCE_PROVIDER

     importing

       !I_PROVIDER type RSINFOPROV

       !I_PACKAGESIZE type I

     changing

       !C_O_PROV type ref to CL_RSDRC_INFOPROV

       !C_S_PROVRQ type RSDR0_TS_PROVRQ .

private section.

ENDCLASS.

CLASS YNN_HCPR IMPLEMENTATION.

* <SIGNATURE>---------------------------------------------------------------------------------------+

* | Instance Public Method YNN_HCPR->CONSTRUCTOR

* +-------------------------------------------------------------------------------------------------+

* | [--->] I_PROVIDER                     TYPE        RSOHCPRNM

* +--------------------------------------------------------------------------------------</SIGNATURE>

   method constructor.

*   Steering mus be derived at this point

     call method cl_rso_hcpr=>factory

       exporting

         i_hcprnm = i_provider

       receiving

         r_r_hcpr = g_o_hcpr.

     if g_o_hcpr is bound.

       call method g_o_hcpr->if_rsd_dta~dta_get_info

         exporting

           i_objvers        = rs_c_objvers-active

           i_myself_only    = rs_c_false

           i_with_atr_nav   = rs_c_false

           i_with_meta_iobj = rs_c_false

           i_dta_view       = if_rsd_dta=>view_infoprovider

         importing

           e_t_dta_pro      = g_t_dta_pro

           e_s_dta          = g_s_dta

         exceptions

           dta_not_found    = 1

           iobj_not_found   = 2

           objvers_invalid  = 3

           others           = 4.

       if sy-subrc <> 0.

*       Implement suitable error handling here

       endif.

     endif.

   endmethod.

* <SIGNATURE>---------------------------------------------------------------------------------------+

* | Instance Public Method YNN_HCPR->READ

* +-------------------------------------------------------------------------------------------------+

* | [--->] I_TH_SFC                       TYPE        RSDRI_TH_SFC

* | [--->] I_TH_SFK                       TYPE        RSDRI_TH_SFK

* | [--->] I_T_RANGE                      TYPE        RSDRI_T_RANGE

* | [--->] I_FIRST_CALL                   TYPE        RS_BOOL

* | [--->] I_PACKAGESIZE                  TYPE        I

* | [<---] E_T_MSG                        TYPE        RS_T_MSG

* | [<-->] C_END_OF_DATA                  TYPE        RS_BOOL

* | [<-->] C_T_DATA                       TYPE REF TO DATA

* | [EXC!] ERROR_MAPPING_OUTPUT

* | [EXC!] ERROR_BUILDING_SELECTIONS

* +--------------------------------------------------------------------------------------</SIGNATURE>

   method read.

     data:

       l_ts_provrq    type  rsdr0_ts_provrq,

*      l_returntp     type rsdrs_returntp,

       l_returobj     type rsdrs_returnobj,

       l_iprov        type ref to cl_rsdrc_infoprov,

       l_t_data       type ref to data,

       l_tsx_sel      type rsdd_tsx_seldr,

       l_tx_splitpack type rsdr0_tx_splitpack,

       l_s_range       type rsdri_s_range,

       l_s_dta_pro    type rsd_s_dta_pro,

       l_s_any        type rrrange,

       c_t_data2      type ref to data,

       l_t_any        type standard table of rrrange,

       l_total        type i,

       l_lines        type i,

       l_max_rows     type i.

     field-symbols:

       <l_t_data>  type standard table,

       <c_t_data>  type standard table,

       <c_t_data2> type standard table,

       <l_t_any>   type any table.

*--------------------------------------------------------------------*

*   Initialization

*    l_returntp = 'ABAP-TABLE'.

     assign l_t_any  to <l_t_any>.

*   Data creation

     call method me->_create_data

       exporting

         i_th_sfc            = i_th_sfc

         i_th_sfk            = i_th_sfk

       exceptions

         error_creating_data = 1

         others              = 2.

*   Buid selections table

     call method me->_build_seldr_table

       exporting

         i_t_range = i_t_range

       changing

         c_tsx_sel = l_tsx_sel.

     if sy-subrc eq 0.

       assign me->g_t_data->* to <l_t_data>.

     else.

*     Raise Exception here

       raise error_building_selections.

     endif.

*   Instance provider

     call method me->_instance_provider

       exporting

         i_provider    = me->g_s_dta-infoprov

         i_packagesize = i_packagesize

       changing

         c_o_prov      = l_iprov

         c_s_provrq    = l_ts_provrq.

*   Perform HCPR read

     while c_end_of_data ne abap_true.

       try.

           call method l_iprov->read

             exporting

               i_ts_provrq    = l_ts_provrq

               i_th_sfc       = g_th_sfc

               i_th_sfk       = g_th_sfk

               i_tsx_seldr    = l_tsx_sel

               i_exec_mode    = rsdrc_c_exec_mode-serial

             importing

               e_t_data       = <l_t_data>

               e_end_of_data  = c_end_of_data

               e_tx_splitpack = l_tx_splitpack.

           c_end_of_data = 'X'.

*          describe table <l_t_data> lines l_lines.

*          if l_max_rows <> 0.

*            l_total = l_total + l_lines.

*            if l_total >= l_max_rows.

*              c_end_of_data = rs_c_true.

*            endif.

*          endif.

         catch cx_rsdrc_illegal_input_sfc .

         catch cx_rs_msg .

         catch cx_rsdr_cube_locked .

         catch cx_rsdrc_nested_mpro .

         catch cx_rs_access_error .

         catch cx_rs_static_check .

         catch cx_static_check .

       endtry.

       if c_t_data2 is not bound.

         assign c_t_data->to <c_t_data>.

         create data c_t_data2 like <c_t_data>.

         assign c_t_data2->* to <c_t_data2>.

       endif.

       call method me->_map_output

         exporting

           i_t_data             = me->g_t_data

         changing

           c_t_data             = c_t_data2

         exceptions

           error_mapping_output = 1

           others               = 2.

       if sy-subrc <> 0.

*       Implement suitable error handling here

         raise error_mapping_output.

       else.

         append lines of <c_t_data2> to <c_t_data>.

         clear <c_t_data2>[].

       endif.

     endwhile.

*   If any additional calculation is required

     call method me->_additional_calculation

       changing

         c_t_data = c_t_data.

   endmethod.

* <SIGNATURE>---------------------------------------------------------------------------------------+

* | Instance Protected Method YNN_HCPR->_ADDITIONAL_CALCULATION

* +-------------------------------------------------------------------------------------------------+

* | [<-->] C_T_DATA                       TYPE REF TO DATA

* +--------------------------------------------------------------------------------------</SIGNATURE>

   method _additional_calculation.

*    To be redefined

   endmethod.

* <SIGNATURE>---------------------------------------------------------------------------------------+

* | Instance Protected Method YNN_HCPR->_BUILD_SELDR_TABLE

* +-------------------------------------------------------------------------------------------------+

* | [--->] I_T_RANGE                      TYPE        RSDRI_T_RANGE

* | [<-->] C_TSX_SEL                      TYPE        RSDD_TSX_SELDR

* | [EXC!] ERROR_BUILDING_SELECTIONS

* +--------------------------------------------------------------------------------------</SIGNATURE>

   method _build_seldr_table.

     data:

       l_sid_used  type rs_bool,

       l_key_used  type rs_bool,

       l_new_entry type rs_bool,

       l_s_range   type rsdd_s_range,

       l_s_dta_pro type rsd_s_dta_pro,

       i_s_range    type rsdri_s_range.

     field-symbols:

       <l_sel>        type any,

       <l_sel_sign>   type rs_s_range-sign,

       <l_sel_option> type rs_s_range-opt,

       <l_sel_low>    type any,

       <l_sel_high>   type any.

     field-symbols:

       <l_sx_sel>  type rsdd_sx_seldr,

       <l_s_range> type rsdd_s_range.

     data: l_sx_sel  type rsdd_sx_seldr.

*--------------------------------------------------------------------*

     loop   at me->g_t_dta_pro

      into   l_s_dta_pro

     where ( iobjtp     ne 'DPA'  " no tehnical Infoobjects

       and   iobjtp     ne 'MTA'  " no attribute Infoobjects

       and   atrnavfl   <> 'X'    " no attribute Infoobjects

       and   atronlyfl  <> 'X'    " no attribute only Infoobjects

       and   metaiobjfl <> 'X' ). " no meta-data objects

       loop at i_t_range

       into i_s_range

       where chanm eq l_s_dta_pro-iobjnm.

         read table c_tsx_sel

              assigning <l_sx_sel>

              with table key fems = '0000' chanm = l_s_dta_pro-iobjnm.

         if sy-subrc ne 0.

           l_new_entry = rs_c_true.

           assign l_sx_sel to <l_sx_sel>.

           <l_sx_sel>-fems     = 0.

           <l_sx_sel>-chanm    = l_s_dta_pro-iobjnm.

           <l_sx_sel>-cum_used = 1.

         endif.

         clear l_s_range.

         l_s_range-sign    = i_s_range-sign.

         l_s_range-opt     = i_s_range-compop.

         l_s_range-low     = i_s_range-low.

         l_s_range-high    = i_s_range-high.

         l_s_range-keyfl   = rs_c_true.

         append l_s_range to <l_sx_sel>-range-range.

       endloop.

       if l_new_entry eq rs_c_true.

         insert <l_sx_sel> into table c_tsx_sel.

         clear: l_sx_sel, l_new_entry.

       endif.

     endloop.

     cl_rsdrc_seldr_srvs=>set_seldr_chanmid(

       changing

         c_tsx_seldr = c_tsx_sel ).

*   Set the seltype inside the seldr

     loop at c_tsx_sel

     assigning <l_sx_sel>.

*     Range conditions or key conditions

       <l_sx_sel>-seltyp = rsdd_c_seltyp-range.

       " set keyfl1 correctly  " MS 1759180

       l_key_used = rs_c_false.

       l_sid_used = rs_c_false.

       loop at <l_sx_sel>-range-range assigning <l_s_range>.

         if <l_s_range>-keyfl = rs_c_true.

           l_key_used = rs_c_true.

         else.

           l_sid_used = rs_c_true.

         endif.

       endloop.

       if l_key_used = rs_c_true and l_sid_used = rs_c_true.

         <l_sx_sel>-range-keyfl1 = rsdd_c_keyfl1-both.

       elseif l_key_used = rs_c_true.

         <l_sx_sel>-range-keyfl1 = rsdd_c_keyfl1-true.

       elseif l_sid_used = rs_c_true.

         <l_sx_sel>-range-keyfl1 = rsdd_c_keyfl1-false.

       endif.

     endloop.

   endmethod.

* <SIGNATURE>---------------------------------------------------------------------------------------+

* | Instance Protected Method YNN_HCPR->_CREATE_DATA

* +-------------------------------------------------------------------------------------------------+

* | [--->] I_TH_SFC                       TYPE        RSDRI_TH_SFC

* | [--->] I_TH_SFK                       TYPE        RSDRI_TH_SFK

* | [EXC!] ERROR_CREATING_DATA

* +--------------------------------------------------------------------------------------</SIGNATURE>

   method _create_data.

     data: l_s_sfk   type rsdd_s_sfk,

           l_s_sfc   type rsdd_s_sfc,

           l_s_alias type l_ty_s_iobjalias,

           l_s_data  type ref to data,

           l_v_sfc   type rs_bool,

           l_v_sfk   type rs_bool.

     field-symbols:

       <ls_dta_pro> type rsd_s_dta_pro,

       <l_s_data>   type any.

*--------------------------------------------------------------------*

     loop at me->g_t_dta_pro

     assigning <ls_dta_pro>

      where ( iobjtp     ne 'DPA'  " no tehnical Infoobjects

        and   iobjtp     ne 'MTA'  " no attribute Infoobjects

        and   atrnavfl   <> 'X'    " no attribute Infoobjects

        and   atronlyfl  <> 'X'    " no attribute only Infoobjects

        and   metaiobjfl <> 'X' ). " no meta-data objects

       clear: l_v_sfc, l_v_sfk.

       case <ls_dta_pro>-iobjtp.

         when rsd_c_objtp-keyfigure or rsd_c_objtp-meta.

           read table i_th_sfk

           transporting no fields

           with key kyfnm = <ls_dta_pro>-iobjnm.

           if sy-subrc eq 0.

             move <ls_dta_pro>-iobjnm   to l_s_sfk-kyfnm.

             move <ls_dta_pro>-iobjtp   to l_s_sfk-iobjtp.

             move 'SUM'                 to l_s_sfk-aggrgen.

             move rsdd_c_cum-select     to l_s_sfk-cum_used.

             l_s_sfk-value_returnnm  = cl_rsdrc_sfc_srvs=>get_returnnm_key( i_chanm = <ls_dta_pro>-iobjnm ).

             insert l_s_sfk into table me->g_th_sfk.

             l_v_sfk = abap_true.

           endif.

         when others.

           read table i_th_sfc

           transporting no fields

           with key chanm = <ls_dta_pro>-iobjnm.

           if sy-subrc eq 0.

             move-corresponding <ls_dta_pro> to l_s_sfc.

             move rs_c_true                  to l_s_sfc-fems0.

             move rsdd_c_cum-select          to l_s_sfc-cum_used.

             move <ls_dta_pro>-iobjnm        to l_s_sfc-chanm.

             move 'X'                        to l_s_sfc-keyret.

             l_s_sfc-keyreturnnm = cl_rsdrc_sfc_srvs=>get_returnnm_key( i_chanm = <ls_dta_pro>-iobjnm ).

             move rs_c_true                  to l_s_sfc-keyret.

             move rsdd_c_retfl-true          to l_s_sfc-keyret_0.

             insert l_s_sfc into table me->g_th_sfc.

             l_v_sfc = abap_true.

           endif.

       endcase.

       if l_v_sfc eq abap_true

       or l_v_sfk eq abap_true.

*       Get fieldnames for generated structure

         l_s_alias-iobjnm    = <ls_dta_pro>-iobjnm.

         l_s_alias-fieldnm   = <ls_dta_pro>-fieldnm.

         l_s_alias-iobjtp    = <ls_dta_pro>-iobjtp.

         l_s_alias-sidalias  = cl_rsdrc_sfc_srvs=>get_returnnm_key( i_chanm = <ls_dta_pro>-iobjnm ).

         l_s_alias-selalias  = cl_rsdrc_sfc_srvs=>get_returnnm_key( i_chanm = <ls_dta_pro>-iobjnm ).

         append l_s_alias to me->g_t_alias.

       endif.

     endloop.

     call method cl_rsdrc_sfc_srvs=>set_sfc_chanmid

       changing

         c_th_sfc = me->g_th_sfc.

     call method cl_rsdrc_sfc_srvs=>set_sfk_kyfnmid

       changing

         c_th_sfk = me->g_th_sfk.

     call method cl_rsdrc_sfc_srvs=>build_struct_type

       exporting

         i_th_sfc        = me->g_th_sfc

         i_th_sfk        = me->g_th_sfk

         i_add_fems      = rs_c_false

       receiving

         r_r_structdescr = g_r_struct.

     create data l_s_data type handle me->g_r_struct.

     assign l_s_data->* to <l_s_data>.

     if <l_s_data> is assigned.

       create data me->g_t_data like standard table of <l_s_data> with default key.

     else.

       raise error_creating_data.

     endif.

   endmethod.

* <SIGNATURE>---------------------------------------------------------------------------------------+

* | Instance Protected Method YNN_HCPR->_INSTANCE_PROVIDER

* +-------------------------------------------------------------------------------------------------+

* | [--->] I_PROVIDER                     TYPE        RSINFOPROV

* | [--->] I_PACKAGESIZE                  TYPE        I

* | [<-->] C_O_PROV                       TYPE REF TO CL_RSDRC_INFOPROV

* | [<-->] C_S_PROVRQ                     TYPE        RSDR0_TS_PROVRQ

* +--------------------------------------------------------------------------------------</SIGNATURE>

   method _instance_provider.

     data: l_returntp  type rsdrs_returntp,

           l_returobj  type rsdrs_returnobj,

           i_returnobj type rsdrs_returnobj.

     data: l_ts_provrq    type  rsdr0_ts_provrq.

*--------------------------------------------------------------------*

     call method cl_rsdrc_provrq_srvs=>get_provrq

       exporting

         i_infoprov  = i_provider

       receiving

         r_ts_provrq = c_s_provrq.

     try.

         create object c_o_prov

           exporting

             i_infoprov           = i_provider

             i_srdate             = sy-datum

             i_no_ncum_handling   = rs_c_true

             i_use_db_aggregation = rs_c_true

             i_use_aggr_cubes     = rs_c_true

*           i_packagesize        = i_packagesize

             i_maxrows            = i_packagesize

             i_returntp           = rsdrs_c_returntp-itab

             i_returnobj          = i_returnobj

             i_authority_check    = rsdrc_c_authchk-read

             i_show_report        = rs_c_false

             i_show_plan          = rs_c_false

             i_caller             = rsdrs_c_caller-rsdri

             i_curr_conversion    = space

             i_allow_trex         = rs_c_false.

       catch cx_rsdrc_illegal_input_sfc .

     endtry.

   endmethod.

* <SIGNATURE>---------------------------------------------------------------------------------------+

* | Instance Protected Method YNN_HCPR->_MAP_OUTPUT

* +-------------------------------------------------------------------------------------------------+

* | [--->] I_T_DATA                       TYPE REF TO DATA

* | [<-->] C_T_DATA                       TYPE REF TO DATA

* | [EXC!] ERROR_MAPPING_OUTPUT

* +--------------------------------------------------------------------------------------</SIGNATURE>

   method _map_output.

     data: c_s_data  type ref to data,

           l_s_alias type l_ty_s_iobjalias.

     field-symbols:

       <i_t_data> type standard table,

       <c_t_data> type standard table,

       <c_s_data> type any,

       <i_s_data> type any,

       <source>   type any,

       <target>   type any.

*--------------------------------------------------------------------*

     assign:

       i_t_data->* to <i_t_data>,

       c_t_data->* to <c_t_data>.

     create data c_s_data like line of <c_t_data>.

     assign c_s_data->* to <c_s_data>.

     loop at <i_t_data>

     assigning <i_s_data>.

       loop at me->g_t_alias

       into l_s_alias.

         assign component:

          l_s_alias-sidalias of structure <i_s_data> to <source>,

          l_s_alias-sidalias of structure <c_s_data> to <target>.

         if sy-subrc eq 0.

           <target> = <source>.

         endif.

       endloop.

       append <c_s_data> to <c_t_data>.

     endloop.

   endmethod.

ENDCLASS.


I appologize for the hardcoded bits. Take into account that the source code is not in the best standard since it's just meant to be a proof of concept thing. I think it can help you on your concern anyway. I hope it helps.


Salva.

0 Kudos

Hello!

Salvador, does it work? Why you just did not use RSDRI_INFOPROV_READ?

0 Kudos

Error in the line   <l_sx_sel>-***_used = 1.

Is it <l_sx_sel>-cum_used = 1?

0 Kudos

error in the line create data l_t_data like e_t_data.

doesnt know what is e_t_data.

Former Member
0 Kudos

Hi,

for me RSDRI_INFOPROV_READ does not work. That's why I developed this class.

Former Member
0 Kudos

I am afraid that the forum has a kind of "swearing" filter or something.

As a result the field "c-u-m_used" (without hypen) is replaced by "***" in order to avoid any non appropriated word.

Please check the abap structure  rsdd_sx_seldr.

Former Member
0 Kudos

Hi Vladimir,

How are you creating your FM?

You should create it as a copy of FM RSDRI_VPROV_READ_TEMPLATE.

Then E_T_DATA should be recognized.

Thanks.

0 Kudos

What you mean doesn't work? No data? Errors?

Former Member
0 Kudos

I get SY_SUBRC = 11 and obviously no data.

I am not sure but probablythe reason is that I designed my composite provider in Hana studio.

Maybe if you model it in BW workbench you can still use RSDRI_INFOPROV_READ, but just guessing.

Thanks.

0 Kudos

Can I ask you - why do you use

create object l_o_hcpr

      exporting

        i_provider = 'YOUR_COMPOSITE_PROV_NAME_HERE'.


Why constant? You have I_INFOPROV in import section of the FM.

Former Member
0 Kudos

Is not a constant, it's just a string for you to identify where you need to put your HCPR name.

In fact my case, is pretty dynamic, I will need to derive the HCPR name depending on selections, since the read to the HCPR will be from a VPROV or MPROV in my case. therefore I_INFOPROV is definitely not something that I can trust on.


This class is a prototype for a specific purpose, I would suggest you to check it and take the parts that may be interesting for your. At the moment I can confirm that is working as expected.


Regards.

0 Kudos

Hello!

I tried to use your FM and had difficulties. Can you send me program where you call FM? What type of  E_T_DATA do you use? I could not found structure of composite provider.

Former Member
0 Kudos

Hi Vladimir,

The FM is invoked when reading the Virtual Provider as specified in my first post. You will find there the instructions to create it.



Salvador Cobos wrote:

Hi Yavuz,

in order to read a composite provider from a virtual provider I wrote some source code which is doing the work. The source code is in test phase at the moment but you can adapt it to your needs.

In my case I based my VPROV in Function module copying from the famous RSDRI_VPROV_READ_TEMPLATE. I also created a class which will is actually the one meant to perform the HCPR read.

In the FM, the only thing you need to do is to instance the class and then invoke the public method READ with the parameters provided in the FM as follows:

Thanks.

xient
Explorer
0 Kudos

Hi Salva,

thank you for your effort. Consuming data directly from a Composite was an interesting question in 2013. Nowadays I prefer using CalcViews and retrieving data directly with new ABAP for HANA SQL Statements or other new ways.

The path you find is nice but honestly to me a too big effort to reach to relevant data. If the user has only BW 7.3 without using HANA Studio etc. than your logic is really necessary.

Kind regards,

Yavuz

Former Member
0 Kudos

Please read the thread.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi all!

We are on BW 7.4 SP04.

But I can´t find the class CL_RSDRC_INFOPROV.

Am I too stupid to search? 😉

Regards

Peter

Former Member
0 Kudos

In any case,

the vey core of the HCPR read is to use CL_RSDRC_INFOPROV->READ method.

The class I wrote simplyfies the usage since the I_T_RANGE table for selections is not valid anymore and the SCF and SCK tables are also different.

Thanks.