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 function module to check the FMs & Tables

Former Member
0 Likes
389

Hi

I need to have a program which can either take a single FM or

multiple fm as input from selection screen or an input file with fms as

input and compare the attributes and interface of the function with the

same function module in target system.

For comparision logic, i need to have an RFC function module developed

so that it can take the input of function modules compare them with the

target system and return the function modules that have different

attributes, or interface ( import, export, tables ) etc and list of the

differences function module wise.

How do I go abt this from creation of RFC and program..i am new to RFC's.

Regards

Davinder

Hi

I need to have a program which can either take a single FM or

multiple fm as input from selection screen or an input file with fms as

input and compare the attributes and interface of the function with the

same function module in target system.

For comparision logic, i need to have an RFC function module developed

so that it can take the input of function modules compare them with the

target system and return the function modules that have different

attributes, or interface ( import, export, tables ) etc and list of the

differences function module wise.

How do I go abt this from creation of RFC and program..i am new to RFC's.

Regards

Davinder

1 REPLY 1
Read only

Former Member
0 Likes
316

while creating the FM u have to check the radio button Remote enabled module in attributes tab.

RFC wont support pass by reference so tick the check box pass by value in import export & table parameter.

in source code write ur logic.

in SE38 u have to use syntax based on ur requirement.Since u r telling tht u want return parameter u can use sRFC or aRFC.

sRFC syntax is

Call function '<FM name>' destination '<dest name>'

exporting..

importing..

tables..

create ur destination in SM59.

For aRFC.

CALL FUNCTION 'ZTEST_RFC' STARTING NEW TASK 'ADD' DESTINATION 'sap4.6'.

here also we can get return value for that u have to write special perform.

I have attached a simple program for aRFC check it.

DATA : C TYPE I.

DATA : D TYPE I.

CALL FUNCTION 'ZTEST_RFC' STARTING NEW TASK 'ADD' DESTINATION 'sap4.6'

PERFORMING RETURN_ADD ON END OF TASK

EXPORTING

A = 4

B = 6.

IF SY-SUBRC = 0.

WRITE : 'SUCCESS'.

ELSE.

WRITE :'WAIT'.

ENDIF.

WRITE D.

BREAK-POINT.

FORM RETURN_ADD USING TASKNAME.

DATA : F TYPE I VALUE 10.

RECEIVE RESULTS FROM FUNCTION 'ZTEST_RFC'

IMPORTING C = C.

D = C + F.

ENDFORM.

remaining RFC are tRFC & qRFC here we dont have return value.