cancel
Showing results for 
Search instead for 
Did you mean: 

Retraction using BEx Query to ECC System

Former Member
0 Kudos
198

Hi Friends !

I am trying to retract the SAP BI data to ECC and performed the below steps:

1) For this I am using the BEx query & I have checked the Advanced tab " Allow External Access to this query".

2) RFC Connection - As have only one system for both ECC & BI....Hence connectivity should not be any issue.

3) SE38 has the following code:

&----


*& Report ZTEST_BI_ECC

*&

&----


*&

*&

&----


REPORT ztest_bi_ecc.

TYPE-POOLS: slis.

DATA: g_name TYPE uname. "For Usernames

DATA: fieldcatalog TYPE slis_fieldcat_alv,

i_top_of_page TYPE slis_t_listheader,

st_top_of_page TYPE slis_listheader.

DATA: st_layout TYPE slis_layout_alv,

gd_repid LIKE sy-repid.

DATA: l_reportuid(72) TYPE c, "#EC NEEDED

l_varnt TYPE variant,

l_t_return TYPE TABLE OF bapiret2,

l_t_mdx TYPE TABLE OF bapi6111mdx,

l_t_variables TYPE TABLE OF rscrmvar,

l_t_crmvariants TYPE TABLE OF rscrmvariants,

l_s_crmvariant TYPE rscrmvariants, "#EC NEEDED*

l_t_crmvar TYPE TABLE OF rscrmvar,

l_t_crmvar_temp TYPE TABLE OF rscrmvarh,

l_t_crmvarsel TYPE TABLE OF rscrmvarp,

l_count(1) TYPE n,

l_bdcfield TYPE char16.

DATA: v_temp TYPE string,

v_lincnt TYPE string.

CONSTANTS: c_update(1) TYPE c VALUE 'S',

c_flag TYPE flag VALUE 'X'.

TYPES : BEGIN OF t_result,

text TYPE char250,

END OF t_result.

TYPES: BEGIN OF t_bwdata,

debitor TYPE /bi0/oidebitor,

fiscyear TYPE /bi0/oifiscyear,

num_payment TYPE i,

END OF t_bwdata.

DATA : i_result TYPE STANDARD TABLE OF t_result WITH HEADER LINE,

i_bwdata TYPE TABLE OF /bi0/f0fiar_c05,

i_axis1 TYPE STANDARD TABLE OF rscrmaxis,

i_cell1 TYPE STANDARD TABLE OF rscrmcell,

i_axis TYPE STANDARD TABLE OF rscrmaxis,

i_cell TYPE STANDARD TABLE OF rscrmcell,

i_days TYPE STANDARD TABLE OF rke_dat.

DATA : wa_result TYPE t_result,

wa_bwdata TYPE /bi0/f0fiar_c05,

wa_fcat TYPE slis_t_fieldcat_alv,

w_t_return TYPE bapiret2,

wa_t_crmvarsel TYPE rscrmvarp,

wa_axis TYPE rscrmaxis,

wa_axis1 TYPE rscrmaxis,

wa_cell TYPE rscrmcell.

PARAMETERS p_bw_sys TYPE fmbp_rfcdest OBLIGATORY.

PARAMETERS p_query TYPE fmbp_query OBLIGATORY.

INITIALIZATION.

gd_repid = sy-repid.

START-OF-SELECTION.

PERFORM get_bw_data.

END-OF-SELECTION.

&----


*& Form GET_BW_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_bw_data .

  • l_varnt = p_varnt.

CALL FUNCTION 'RSCRMBW_REPORT'

EXPORTING

i_mode = 'OPEN'

i_reportuid = p_query

i_repname = ' '

IMPORTING

e_reportuid = l_reportuid

TABLES

e_t_axis = i_axis1

e_t_cell = i_cell1

e_t_return = l_t_return

e_t_mdx = l_t_mdx.

IF sy-subrc = 0.

IF l_t_return[] IS NOT INITIAL.

CLEAR w_t_return.

READ TABLE l_t_return INTO w_t_return WITH KEY type = 'E'.

IF sy-subrc EQ 0.

MESSAGE e162(00) WITH w_t_return-message p_query.

ENDIF.

ENDIF.

ENDIF.

CALL FUNCTION 'RSCRMBW_FLATTEN_VIEW'

EXPORTING

i_reportuid = p_query

TABLES

e_t_mdx = l_t_mdx

e_t_return = l_t_return.

CALL FUNCTION 'RSCRMBW_REPORT'

EXPORTING

i_mode = 'START'

i_reportuid = p_query

i_repname = ' '

IMPORTING

e_reportuid = l_reportuid

TABLES

e_t_axis = i_axis1

e_t_cell = i_cell1

e_t_return = l_t_return

e_t_mdx = l_t_mdx.

IF sy-subrc = 0.

i_axis[] = i_axis1[].

i_cell[] = i_cell1[].

ENDIF.

CALL FUNCTION 'RSCRMBW_REPORT'

EXPORTING

i_mode = 'CLOSE'

i_reportuid = p_query

i_repname = ' '

IMPORTING

e_reportuid = l_reportuid

TABLES

e_t_axis = i_axis1

e_t_cell = i_cell1

e_t_return = l_t_return

e_t_mdx = l_t_mdx.

CLEAR wa_axis.

READ TABLE i_axis INTO wa_axis WITH KEY axis = '001'.

IF sy-subrc <> 0.

MESSAGE e005(fm_bp_bwret) .

ENDIF.

ENDFORM. " GET_BW_DATA

When trying to execute the code, it throws the error "Query doesnot exists". Please advise.

I have refer the following link for the requirement: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90cd1106-21b4-2d10-0695-9b1e07619...

With Regards

Rekha

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Resolved myself.

Former Member
0 Kudos

Hi Rekha,

I am trying to use the same method based on the How to document.

Also the error is same though the the Query is enabled for external access.

Can you please let me know how you resolved this issue?

Regards,

Nitin S.

Former Member
0 Kudos

Hi Nitin,

The name of the query has to be "I_"+ InfoProvider technical name + "/" + Query technical name.

Regards,

Valko