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

RFC fm

Former Member
0 Likes
1,422

Hi,

My requirement is to connect from one client say dev to fix on fail client from my program and compare data for a table in both the environment.

My program will run on dev client. Now the problem is how can i connect to the other client and how can i read the table data on the other client?

<REMOVED BY MODERATOR>

Rgds,

Harikrishna

Edited by: Alvaro Tejada Galindo on Feb 22, 2008 10:01 AM

Hi,

My requirement is to connect from one client say dev to fix on fail client from my program and compare data for a table in both the environment.

My program will run on dev client. Now the problem is how can i connect to the other client and how can i read the table data on the other client?

<REMOVED BY MODERATOR>

Rgds,

Harikrishna

Edited by: Alvaro Tejada Galindo on Feb 22, 2008 10:01 AM

10 REPLIES 10
Read only

matt
Active Contributor
0 Likes
1,390

You need to first understand the difference between a client and an instance.

To read from a different client use the addition CLIENT-SPECIFIED.

To read from a different instance - well the title of your post suggests you know the answer - use RFM fm.

matt

msg to Alvaro Tejada Galindo - thanks, it was irritating!

Read only

Former Member
0 Likes
1,390

Hi,

Thanks for the reply.

I am not sure what you mean by an instance, but i need to connect to one of the other client using an RFC fm. But what i want to know is the RFC fm which can be used to connect to the other system. Also once connected, how can i pass the select query to read the data from the other table.

Rgds,

Harikrishna

Read only

Former Member
0 Likes
1,390

msg to Alvaro Tejada Galindo - thanks, it was irritating!

Matthew...Did I do something that bothers you? Please tell me...

Blag.

Read only

matt
Active Contributor
0 Likes
1,390

NO! Absolutely not! I was thanking you for your modification of the original post!

matt

Read only

matt
Active Contributor
0 Likes
1,390

The definitions and difference between CLIENT and INSTANCE is very basic stuff.

An instance is like D50. Or P50. It can contain many clients - 010, 050. An instance has one set of programs, and one set of db tables. Some of those db tables are client specific. The have a field of MANDT. Every record in the table has a value for MANDT, which specified the field.

If you want to read data from another client in the same instance, you just use the CLIENT-SPECIFIED addition of SELECT.

If you want to read from another instance, you have to use RFC enable function modules. If in your instance C50, you have a FM called Z_MY_FUNCTION_MODULE which is RFC enabled, and returns the value 5, then, from an ABAP in any instance which has access to C50 (as defined by your network, and setup in SM59), you can write "CALL 'Z_MY_FUNCTION_MODULE' DEST C50". The Z_MY_FUNCTION_MODULE must exist in the the destination - in this case C50. But it doesn't have to exist anywhere else.

matt

Read only

Former Member
0 Likes
1,390

Sorry man -:) I misread you post... -;)

Greetings,

Blag.

Read only

Former Member
0 Likes
1,390

Harikrishna,

For this, you can create a Z func module in ur existing system. You have to call another FM in this func module that is 'Remote enabled'. So if your present system is DS1100 and the system from which you retrieve the data is DS2100; then follow the steps as given below:

1. Create a func module ZTEST1 in your DS1100. In this func module, make a Call to the ZTEST2 fm that you have created in DS2100. This call to ZTEST2 fm should contain a Destination keyword too where you specify the Destination as 'DS2100'. This way the control goes over to the DS2100 system to fetch data.

2. Now create a ZTEST2 fm in your DS2100 system. Make this fm as 'Remote-enabled'. This fm should contain the Select conditions from the table you want to retrieve the data from.

Do let me know for any issues.

Thanks

Aradhana.

Read only

0 Likes
1,390

Aradhana,

But do you think if it will work, since with what logon credentials will it goto the other client? don't we need to pass the user name, password?

Rgds,

Harikrishna.

Read only

0 Likes
1,390

Harikrishna,

I dont think you will have a problem with the user credentials. I had a similar requirement and it works fine, you just need to specify the destination as the other client. Write a test program and you will find that you dont need to give the user name to access the other system. Let me know if you face any issues.

Thanks

Aradhana.

Read only

ThomasZloch
Active Contributor
0 Likes
1,390

no need to write a Z-function, calling RFC_READ_TABLE with addition DESTINATION does the job.

you have to maintain the DESTINATION via SM59 first (type 3), you need name or IP address of the other box. if you leave logon information blank, you will be asked for it every time you use this connection. so you need a logon in the other box as well, with authorization S_RFC.

more info at help.sap.com

Greetings

Thomas