Escolar Documentos
Profissional Documentos
Cultura Documentos
Applies to:
SAP BIW 3.5 and BI7.0. For more information, visit the Business Intelligence homepage.
Summary
This Document provides step by step solution How to fetch data from ECC System Directly in Bex Query using RRI using real time example with all relevant details. Author: Vipul Goyal
Author Bio
Vipul Goyal is working as SAP BI Consultant in Accenture Services Private Ltd and having Extensive experience in implementation of BI projects specializing in HR/SCM areas.
Fetching Data Directly from ECC System in BEX Query using RRI
Table of Contents
Purpose............................................................................................................................................................... 3 Features .............................................................................................................................................................. 3 Assumptions ....................................................................................................................................................... 3 The Step By Step Solution.................................................................................................................................. 4 Output Demo: ..................................................................................................................................................... 9 Related Content ................................................................................................................................................ 10 Disclaimer and Liability Notice .......................................................................................................................... 11
Fetching Data Directly from ECC System in BEX Query using RRI
Purpose
This Content provides a robust functionality that enables the end user to execute any remote application without actually logging into remote system. The Advanced applications that this content helps to achieve are: 1. To display data from R/3 (or any SAP system) system at BW side based on the report value. 2. End user should be able to fetch the data from R/3 (or any SAP system) for display based on the ABAP report (developed in BW) without actually logging in the R/3 system. 3. At query level, any large volume of data that physically cant be extracted and stored to BW side can be fetched at runtime.
Features
RFC connection is set up between BW system and R/3 (or any SAP system) system through an ABAP program written at BW-side in SE-38 and data is fetched at runtime during query execution.
Assumptions
Reader is aware of following things; 1. Basic understanding of RFC fundamentals. 2. ABAP experience and know how to make custom function modules. 3. RRI functionalityProcess Plan The example explained here gives the insight into how to fetch data from R/3 system at runtime for any characteristic result in Query Output. In brief, course summary, are fetched from R/3 system for Course Id present in Query output through A RRI. The following steps explain the process: Create an ABAP program YTEST_RFC (or any custom defined name) in se-38.. This code can be used to fetch data from R/3 system at runtime, for any characteristic value in Query Output through RRI (or in start routine, in update rules for any object). Create a RRI on query to jump to the Local ABAP program (YTEST_RFC). In the program call a remote function module (ZFM_REMOTE_SYSTEM) by passing Course and CourseType as parameters. (Check the below ABAP code to know how to call remote function module). The function module gives back Course Description and comments, Link and Url Details for that Material.
Fetching Data Directly from ECC System in BEX Query using RRI
3. Choose Assignment Details. The Field Assignments dialog box appears. It will display all the fields those are being used in our query. So from the list that appears; select the fields you want to transfer to the target report. In this case Course is being passed and make sure it is passed as parameter in selection type as shown below: Make type as delete for all others
Fetching Data Directly from ECC System in BEX Query using RRI
4. Create an ABAP program YTEST_RFC (or any custom defined name) in se-38.This program can be
used to fetch data from R/3 system at runtime, for any characteristic value in Query Output through RRI In the program call a remote function module (ZFM_REMOTE_SYSTEM) with fields that are being selected above in STEP 2 as parameters. (Check the below ABAP code to know how to call remote function module). CODE TO MAKE AN RFC CALL TO REMOTE FUNCTION MODULE( ZFM_REMOTE_SYSTEM )
*&---------------------------------------------------------------------* *& Report YTEST_RFC *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT YTEST_RFC LINE-COUNT 65(8) LINE-SIZE 132. TABLES:/BI0/PTRAINING. *TO GET VALUES PASSED FROM REPORT INTO LOCAL PARAMETERS(LT_PARAM FOR COURSE AND LT_CTYPE FOR COURSE TYPE)* *Choose number of parameters depending upon number of field values sent from report( Here it is two)* SELECTION-SCREEN BEGIN OF LINE. PARAMETERS: LT_PARAM TYPE /BI0/PTRAINING-TRAINING NO-DISPLAY, LT_CTYPE TYPE /BI0/PTRAINING-TRAINOTYPE NO-DISPLAY . SELECTION-SCREEN END OF LINE. SELECTION-SCREEN SKIP. data:E_TXTLINE TYPE STRING, E_LINK TYPE STRING,
Fetching Data Directly from ECC System in BEX Query using RRI
E_URL
TYPE
STRING.
heresystem
*Output after execution of FM at remote system IMPORTING E_TXTLINE = E_TXTLINE Course Description and comments E_LINK = E_LINK E_URL = E_URL EXCEPTIONS SYSTEM_FAILURE = 1 COMMUNICATION_FAILURE = 2. write: 'Report Starts For', LT_PARAM. if e_txtline is initial. write: / 'no comments availiable'. else. WRITE: / E_TXTLINE. ENDIF. WRITE: /,/ 'Link:', E_LINK, /,/ 'URL:',E_URL. CLEAR E_TXTLINE. WRITE:/,/ ' Report Ends'. 5. Now in the remote system(or R/3 source system) create a remote function module ZFM_REMOTE_SYSTEM.
6. Select the same import parameters as being passed from ABAP program above and make settings as shown in screen shot below:
Fetching Data Directly from ECC System in BEX Query using RRI
Fetching Data Directly from ECC System in BEX Query using RRI
clear l_tabnr. select single linktxt tabnr from hrp1061 into (E_LINK,l_tabnr) where PLVAR = '01' and OTYPE = I_OTYPE and OBJID = I_OBJID. select * into table E_URL_DETAILS from hrt1061 where tabnr = l_tabnr. ENDFUNCTION.
Fetching Data Directly from ECC System in BEX Query using RRI
Output Demo:
Below is report output from where get details about the ID selected directly from R/3 system by clicking on the particular ID.
Following is window that will open while double clicking on the id seleted giving all the details for the id as shown:
Fetching Data Directly from ECC System in BEX Query using RRI
Related Content
1. Whenever remote function call is made, the remote system asks for user id or password before login to the system. Now suppose the end user dont have the access or wants to avoid this Login, BW system should be made trusted system with Remote system (Transaction-SM59). Please follow this link for more details on it: http://help.sap.com/saphelp_nw04/helpdata/en/22/042671488911d189490000e829fbbd/frameset.htm 2. The above code is basically developed for RRI, but the same can be used in VirtualProviders with Function Modules. In the Function Module for the Remote Cube you can write this code. Please follow this link for more details: VirtualProviders with Function Modules 3. For more details on RRI and various Features of RRI please go the Below Link Report-Report Interface 4. For more information, visit the Business Intelligence homepage.
Fetching Data Directly from ECC System in BEX Query using RRI