Application Development and Automation 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: 
Read only

getting data from different servers via RFC

YayatiEkbote
Contributor
0 Likes
3,688

Hello,

For a report, i need to display contents of the database table of both the clients into single report.In our landscape, i have 2 servers development and quality. In both the servers, i have same database table. If this report is executed in development or quality, it should display data of both the clients. How can i achieve it? How can i use RFC to do it? There is no BAPI for this as the data is only table specific. Do i need to write a FM with RFC enabled? If yes how do i pass the parameters to the FM?

Regards,

Yayati Ekbote

1 ACCEPTED SOLUTION
Read only

kiran_k8
Active Contributor
0 Likes
2,237

Yayati,

1.Create one rfc of type 3

2.Create a Remote enabled function module in development and also in Quality.

3.call the function like below

CALL FUNCTION 'ZGET_DATA_RFC' DESTINATION v_rfcdest

4.Within the function module write the select query

5.Pass the input paramters and output paramters to the function module as internal table.

Thanks,

K.Kiran.

5 REPLIES 5
Read only

Former Member
0 Likes
2,237

Hi Yayati,

this can be done and follow the below logic.

Create an RFC to fetch the data you need and the tables parameter will have the table which will have all the fetched data. After creating this RFC in dev move it to QA.

The create a Program and call this RFC inside the program. The program should also have logic to fetch the data from the current system. After the RFC is executed you will now have data from both the system and all you have to do is to display it.

move this program to QA as well.

The RFC destination should vary as shown below.

IF SY-SYSID EQ <Dev system id>.
  RFC destination <Quality system>.
ELSEIF SY-SYSID EQ <quality system id>.  
  RFC destination <Dev system>.
ENDIF.

Please let me know if you require further clarifications.

<removed by moderator>

Regards,

Praveenkumar T.

Edited by: Thomas Zloch on Feb 14, 2012

Read only

Former Member
0 Likes
2,237

Hi,

Ask the basis team to create RFC in SM59 (Development to QA), and import the RFC Enabled Function Module to QA, (write your select query and pass the result in export/tables/changing).

in your report use select query from DB and call the imported function module by passing Created RFC Destination and get the result in tables tab / changing / export TAB from the function module and display the result.

Regards,

Srini.

Read only

Former Member
0 Likes
2,237

Hi,

Is your data is in the same SAP system and different clients? or two different SAP systems?

thanks.

Aswath

Read only

kiran_k8
Active Contributor
0 Likes
2,238

Yayati,

1.Create one rfc of type 3

2.Create a Remote enabled function module in development and also in Quality.

3.call the function like below

CALL FUNCTION 'ZGET_DATA_RFC' DESTINATION v_rfcdest

4.Within the function module write the select query

5.Pass the input paramters and output paramters to the function module as internal table.

Thanks,

K.Kiran.

Read only

0 Likes
2,237

Thanks. Problem solved.