‎2007 Jun 21 9:58 AM
hi,
i am trying to create one rfc function module, and i am trying to assingn one table of type zstrcture, and it is giving the information, "Only tables with simple line structure are allowed in rfc". any body can solve my problem.
‎2007 Jun 21 10:01 AM
Hi mukka,
I think you r creating table from a deep structure,and i think rfc enabled FM does not allow deep structures.
Can you make your question a little clear.
Regards,
Nikhil Moghe
‎2007 Jun 21 10:02 AM
Hi
What is the structure of your Ztable? have you included some structures in it
Try to define the TABLES paramters for the fun module to use along with export AND import PARAMETERS
RFC (Remote Function Call) is similar to the general SAP fun module: except that in the attributes you click the radio button: RFC enabled;
and you will be passing an Import parameter DESTINATION to it.
Other code and usage will be similar to any fun module;
Have a look at any fun module in SE37 to understand better about the different components of Fun modules;
Refer this link:
http://help.sap.com/saphelp_nw04/helpdata/en/22/042518488911d189490000e829fbbd/frameset.htm
check out the following link it might help you
http://help.sap.com/printdocu/core/Print46c/de/data/pdf/BCFESDE2/BCFESDE2.pdf
Reward points for useful Answers
Regards
Anji
‎2007 Jun 21 10:04 AM
Hi,
RFC ( Remote Function calls )
A remote function call is a call to a function module running in a system different from the caller's. The remote function can also be called from within the same system (as a remote call).
RFC consists of two interfaces : A calling interface for ABAP Programs and a calling interface for Non-SAP programs.
Any ABAP program can call a remote function using the CALL FUNCTION...DESTINATION statement. The DESTINATION parameter tells the SAP System that the called function runs in a system other than the caller's.
RFC CLIENT and RFC SERVER
RFC client is the instance that calls up the Remote Function Call to execute the function that is provided by an RFC server.
The RFC Interface takes care of :-
- Converting all parameter data to the representation needed in the remote system
Calling the communication routines needed to talk to the remote system.
Handling communications errors, and notifying the caller, if desired ( using EXCEPTIONS paramater of the CALL FUNCTION).
Calling Remote function modules
You can use the CALL FUNCTION statement to call remote functions by including an additional DESTINATION clause.
CALL FUNCTION remotefunction
DESTINATION dest
EXPORTING f1 =
IMPORTING f2 =
TABLES t1 =
EXCEPTIONS
The field dest can be either a literal or a variable. Logical destinations are defined in the RFCDES table via transaction SM59 or via the menu path: Tools ->Administration,Administration->Network->RFC destinations.
Calling remote functions locally i.e. call a remote function within the same system )
The two options to do this are
CALL FUNCTION...DESTINATION = 'NONE'
CALL FUNCTION... [no DESTINATION used]
Calling remote function modules BACK :-
The remote function can invoke its own caller (if the caller is itself a function module), or any function module loaded with the caller.
You can trigger this call-back mechanism using
CALL FUNCTION... DESTINATION 'BACK.
Types of RFCs
Synchronous RFC The calling program continues the execution only after the called function is complete.
Asynchronous RFC - The calling program continues the execution without waiting for return from the called function.
Eg: CALL FUNCTION remotefunction STARTING NEW TASK taskname.
Transactional RFC - The called function module is executed exactly once in the RFC server system.Each function call is seen as a transaction in the target system. Transactional RFCs use the suffix IN BACKGROUND TASK .
Eg : CALL FUNCTION remotefunction IN BACKGROUND TASK
Writing remote function modules
In the function module attributes tab (transaction code SE37), set the processing type as Remote-enabled module to create a remote function module.
Write the code for the function module.
Define the destination of the RFC server in the RFC client system that calls the remote function ( via SM59 transaction).
Declaring Parameters: All parameter fields for a remote function module must be defined as reference fields, that is, like ABAP Dictionary fields.
Exceptions: The system raises COMMUNICATION_FAILURE and SYSTEM_FAILURE internally. You can raise exceptions in a remote function just as you would in a locally called function.
Debugging Remote function calls
It is not possible to debug a remote function call to another system.
However, when testing ABAP-to-ABAP RFC calls, you can use the ABAP debugger to monitor the execution of the RFC function in the remote system.
With remote calls, the ABAP debugger (including the debugging interface) runs on the local system. Data values and other run information for the remote function are passed in from the remote system.
Please checkout the below URL
http://help.sap.com/saphelp_nw04/helpdata/en/22/042537488911d189490000e829fbbd/frameset.htm
Regards