Application Development 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: 

create function module with option Remote Function Call Supported (urgent)

Former Member
0 Kudos

hi,

I got an urgent requirement to create function module with <b>Processing type</b> Remote Function Call Supported option On.

Can anybody give me a detail explaination on how to create this ..

and selecting the data..

my requirement is to select matnr plant(werks) and storage location (lgort)

from mara marc mard

while retrieving data of each field from different table (i.e., matnr from mara,werks form marc , lgort from mard) i have to display messages if no record is found

i have to retrieve the data and populate it to final internal table

i have to return the no. of records retrieved also..

Plz help .. it is urgent..

i have to do it by today evening

I reward if it is helpful

regards

sree

3 REPLIES 3

Former Member
0 Kudos

In the Attributes of Function Module, you have to check the option "Remote call enabled". This will make the function RFC Enabled.

You need to trap all the messages in the internal table. For RFC calls, you should not directly raise a message in SAP. You are required to trap the Message No, Message Type and Message Contents in an internal table.

varma_narayana
Active Contributor
0 Kudos

Hi Sree..

It is same as how u create a Normal FM.

Only Differences are :

1. In the FM attributes select PROCESSING TYPE as Remote Function module

2. All the Parameters (Import / Export / .. ) must be given as PASS BY VALUE only. Bcoz Remote FM does not support Pass by REF.

REWARD IF HELPFUL.

Former Member
0 Kudos

HI,

1. In the FM attributes select PROCESSING TYPE as Remote Function module

2. All the Parameters (Import / Export / .. ) must be given as PASS BY VALUE only. Bcoz Remote FM does not support Pass by REF.

IN UR PROGRAM

CREATE A SELECTION SCREEN FOR FIELDS WHICH U WANT TO GET AND CREATE A RFC ENABLED FUNCTION MODULE AND A INTERNAL TABLE.

CREATE A MESSAGE CLASS [SE91] AND USE IT IN RFC FM.

PASS ALL THE INPUT VALUES TO RFC FM AND DISPLAY MESSAGES IN THE RFC ITSELF.

IN CODING OF FM.

CREATE A GLOBAL STRUCTURE IN FUNCTION POOL AND CREATE A TABLE OF DAT TYPE IN UR FM

USE INNER JOIN FOR SELECTING ALL FIELDS FROM DIFFERENT TABLES AS

SELECT AMATNR BWERKS C~LGORT FROM MARA AS A

INNER JOIN MARC AS B ON AMATNR = BMATNR

INNER JOIN MARD AS C ON AMATNR = CMATNR.

INTO TABLE IT_ITAB WHERE MATNR = .................

PASS UR INTERNAL FROM FM TO CALLING AREA AS A EXPORT PARAMETER FROM FM [ IT BECOMES IMPORT PARAMETER FOR CALLING AREA].

IN UR REPORT PROGRAM DECLARE A VARIABLE WHICH HOLDS NO OF RECORDS AS.

DATA : NOREC TYPE I.

LOOP AT ITAB.

WRITE:/10 ITAB-..........

.............

ENDLOOP.

DESCRIBE TABLE ITAB LINES NOREC.

WRITE:/10 NOREC 'RECORDS ARE THERE IN INTERNAL TABLE ITAB'.

................

IF HELPFUL REWARD SOME POINTS.

WITH REGARDS,

SURESH ALURI.