Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Extract data from infocube to internal table BAPI_INFOCUBE_READ_REMOTE_DATA

Former Member
0 Kudos

Hi experts,

I need to fetch data from infocube to an internal table in BW.

I am calling BAPI_INFOCUBE_READ_REMOTE_DATA and providing infocube name, characteristics(only one) and 3 key figures but not getting any data in DATA tables parameter.

Please suggest a solution or if I have to go with any other func module.

Regards,

Karthik

2 REPLIES 2

Former Member
0 Kudos

hello,

you could use FM RSDRI_INFOPROV_READ if you selecting data from the same system, but if you are transferring data from BI system to ECC then you have to use RSDRI_INFOPROV_READ_RFC and pass RFC name as parameter. Furthermore set i_resulttype value equal to 'V'. Code example:

data: lt_rfcdatav        type rsdri_t_rfcdatav ,
        ls_rfcdatav        type rsdri_s_rfcdatav,
        lt_sfc             type rsdri_t_sfc,
        lt_sfk             type rsdri_t_sfk,
        lt_field           type rsdp0_t_field,
        lv_rfccon          type TRIGGERSYS value 'RFCNAME',
        ls_sfc             type rsdri_s_sfc,
        ls_sfk             type rsdri_s_sfk,
        ls_range           type rsdri_s_range,
        lt_range           type rsdri_t_range.

  ls_sfc-chanm    = '0VERSION'.
  ls_sfc-chaalias = '0VERSION'.
  ls_sfc-orderby  = 0.
  insert ls_sfc into table lt_sfc.

  clear ls_range.
  ls_range-chanm    = '0FM_CURR'.
  ls_range-sign     = rs_c_range_sign-including.
  ls_range-compop   = rs_c_range_opt-equal.
  ls_range-low      = 'USD'.
  append ls_range to lt_range.

  if gv_closed_req is initial.

    call function 'RSAPO_CLOSE_TRANS_REQUEST' destination lv_rfccon
      exporting
        i_infocube = 'INFO CUBE NAME'.

  endif.

  call function 'RSDRI_INFOPROV_READ_RFC' destination lv_rfccon
    exporting
      i_infoprov             = 'INFO CUBE NAME'
      i_reference_date       = sy-datum
      i_save_in_table        = rs_c_false
      i_save_in_file         = rs_c_false
      i_authority_check      = rsdrc_c_authchk-none
      i_resulttype           = 'V'
    tables
      i_t_sfc                = lt_sfc
      i_t_sfk                = lt_sfk
      i_t_range              = lt_range
      e_t_rfcdatav           = lt_rfcdatav
      e_t_field              = lt_field
    exceptions
      illegal_input          = 1
      illegal_input_sfc      = 2
      illegal_input_sfk      = 3
      illegal_input_range    = 4
      illegal_input_tablesel = 5
      no_authorization       = 6
      generation_error       = 8
      illegal_download       = 9
      illegal_tablename      = 10
      data_overflow          = 12
      others                 = 13.

and then you have to loop through internal table lt_rfcdatav.

br,

dez_

0 Kudos

Hi Dez,

Many thanks, I got the data from infocube.

Regards,

Karthik