cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

what is the exact syntax for calling remote function module.

Former Member
0 Likes
1,134

Hi to all

1.....what is the exact syntax for calling remote function module.?

Thanks and regards,

k.swaminath reddy

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Likes

hi

good

Lets do simple example where you will first create a RFC in one server (say A) and create normal program in othere server (say B). Finally you will call the RFC in A from B.

Do the following steps for creating RFC in server A.

1. log on to server A

2. go to se37

3. Edit -> function groups-> create function group and give the function group name (say ZGRP).

4. create a FM ( say Z_TEST_RFC) in se37 providing the function group which is created just now.

5. go to attribute tab -> choose remote-enabled module from processing type.

so that your FM will become RFC.

6. provide the import parameter in import tab.

we will provide only two import parameters.

- parameter name : P_NUM1, typing: TYPE, associated type : I & check the pass value (all the parameters of RFC must pass by value).

- parameter name : P_NUM2, typing: TYPE, associated type : I & check the pass value

7. provide the export parameter in export tab.

parameter name : P_SUM, typing: TYPE, associated type : I & check the pass value

8. write the given simple code in source code tab.

FUNCTION Z_TEST_RFC.

P_TOT = P_NUM1 + P_NUM2.

ENDFUNCTION.

Do the following steps for creating ABAP program which will call the RFC in server B.

1. se38 - > creat a program.

2. write the given simple code.

data tot type i.

call function 'Z_TEST_RFC' destination 'XXXXXX'

exporting

p_num1 = 10

p_num2 = 15

importing

p_tot = tot.

write tot.

please note that XXXXXX is RFC connection which is avialable in sm59 transaction in server A.

-go to sm59 - > abap connection (list of RFC connection configurations are avialable). choose server B connection and replace it of XXXXXX in the code.

finally you can execute the normal abap program that will call the RFC and display the result.

reward point if helpful.

thanks

mrutyun^

Former Member
0 Likes

CALL FUNCTION 'funcation module name'

DESTINATION 'rfc destination name'

exporting

importing

others..

Former Member
0 Likes

Hi,

The syntax is same as you call any normal FM.Just one addition you will have to pass the RFC destination also with the RFC FM Like

DESTINATION rfc_sys in the below RFC FM.

CALL FUNCTION 'RFC_READ_TABLE'

DESTINATION rfc_sys

EXPORTING

query_table = p_kc_ykat1050

TABLES

OPTIONS = z_option

data = pit_ykat1050

EXCEPTIONS

table_not_available = 1

table_without_data = 2

option_not_valid = 3

field_not_valid = 4

not_authorized = 5

data_buffer_exceeded = 6

OTHERS = 7.