cancel
Showing results for 
Search instead for 
Did you mean: 

Retraction SAP BI to ECC

Former Member
0 Kudos

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 (2)

Answers (2)

Former Member
0 Kudos

Resolved myself.

satya_r
Explorer
0 Kudos

Hi Rekha,

I also tried to implement same code but were unsuccessful.Can you please provide the solution. While executing the code a window comes which asks for BW system, query name. After entering the parameters when I executed the code no response. Window remains as it is.

Kindly provide the solution as this is a requirement from our client.

Former Member
0 Kudos

Hi all,

I m also stuck with same issue.please share the solution

Former Member
0 Kudos

Hi Rekha,

Have you save the query after you made changes(i mean "allow external access to the query). please save the query and open it again.

check the query name in the program also. even you have one to one mapping between your systems, please check RFC connection once.

Regards,

Venkatesh

Former Member
0 Kudos

Hi Venkatesh !

Thanks for replying.

1) Have you save the query after you made changes(i mean "allow external access to the query). please save the query and open it again - YES

2) check the query name in the program also. - I have use parameter to enter the query name.

3) even you have one to one mapping between your systems, please check RFC connection once. - As we have one system both for ECC & BW, RFC is not required.

Please advise. You can share your email id for further communication.

Regards

Rekha

Former Member
0 Kudos

Hi Friends !

Any advise you can provide?

With Regards

Rekha