12-15-2008 12:15 PM
Subject modified by moderator. Please try to make it meaningful in future
Hi,
Say there are 2 system A and B, connected through RFC. From A, I want to query a table of B. How do I do it? Can I do it through the direct Select statement?
Thanks for your answers.
Edited by: Matt on Dec 15, 2008 2:06 PM - changed subject
12-15-2008 12:17 PM
Hi,
Create an RFC function module with the required select querry.
Regards,
Vartika
12-15-2008 12:21 PM
Thnaks for your answer. But this would require 2 steps. One is to create a FM in one system(A), other is to execute the report in another system(B). So i want to know if it can be done from the report alone, in only one system(B).
12-15-2008 12:23 PM
12-15-2008 12:23 PM
Make a FM in system A and call it like this. Put your select query in it for DB of system B
CALL FUNCTION 'XYZ' DESTINATION B
12-15-2008 12:28 PM
hi...
you have to Create a function module with RFC enable .
and A and B are different server
then you have to use key word DESTINATION
here is the sample code i used in my program .
CASE sy-sysid.
WHEN 'DVH'.
CONCATENATE 'DVC' 'CLNT' '025' INTO wf_dest.
WHEN 'QAH'.
CONCATENATE 'QAC' 'CLNT' '129' INTO wf_dest.
WHEN 'SUH'.
CONCATENATE 'SUC' 'CLNT' '222' INTO wf_dest.
WHEN 'PRH'.
CONCATENATE 'PRC' 'CLNT' '222' INTO wf_dest.
WHEN OTHERS.
ENDCASE.
CLEAR fs_actemp.
LOOP AT int_actemp INTO fs_actemp WHERE vdsk1 <> ''.
CLEAR int_lfa1_inp[].
CLEAR fs_lfa1_inp.
fs_lfa1_inp-lifnr = fs_actemp-vdsk1.
APPEND fs_lfa1_inp TO int_lfa1_inp.
CALL FUNCTION 'ZSMP_GET_VENDOR_NAME' DESTINATION wf_dest
TABLES
tlfa1 = int_lfa1_inp.
CLEAR fs_lfa1_inp.
READ TABLE int_lfa1_inp INTO fs_lfa1_inp INDEX 1.
fs_actemp-name1 = fs_lfa1_inp-name1.
MODIFY int_actemp FROM fs_actemp TRANSPORTING name1 WHERE vdsk1 = fs_actemp-vdsk1.
CLEAR fs_actemp.
ENDLOOP.
regards,
chinnaiya
12-15-2008 12:47 PM
Hello Shweta,
you can use Function module RFC_READ_TABLE. You need to know the IP of your target sytem.
Regards
Arindam