Regarding the Remote Function Module

hi,
        Can any body can provide the brief information regarding the Remote Function Module.
1)How to create the remote function module
2)how it differ from the normal function module
3)any special features about this.
Thanks in advance

Hi
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
Function Modules;
Check this matter.
Function Modules are Global ABAP programs created by SAP for reusable purpose.they have IMPORT,EXPORT and TABLE parameters, and EXCEPTIONS to through when error occurs.
You can create them from TCode SE37.
Go through the following doc:
Function modules are cross-program, reusable procedures that are organized into function groups, and whose functions are implemented between the statements FUNCTION and ENDFUNCTION. Function modules and their interfaces are created in the Function Builder.
Function Module Interfaces
The parameter interface of a function module is defined in the Function Builder. It includes the definition of interface parameters and the specification of exceptions that can be triggered by a function module. The Function Builder automatically generates comment lines below the FUNCTION statement in the source code of the function module, which represent the interface of the function module with the following syntax:
Syntax
... [IMPORTING parameters]
[EXPORTING parameters]
[CHANGING parameters]
[TABLES table_parameters]
[{RAISING|EXCEPTIONS} exc1 exc2 ...]
The syntax and semantics of IMPORTING, EXPORTING, CHANGING, RAISING, and EXCEPTIONS mainly correspond to the definition of method interfaces with [CLASS-]METHODS. The additional option of defining table parameters using TABLES is obsolete.
Interface parameters
The interface parameters are defined on the relevant tab pages in the Function Builder.
IMPORTING parameters are input parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input parameter. The content of the actual parameter is passed to the input parameter when the call is made. The content of an input parameter for which 'pass by reference' is defined cannot be changed in the function module.
EXPORTING parameters are output parameters. When the function module is called, a suitable actual parameter can be specified for every output parameter. The content of an output parameter that is defined for 'pass by value' is transferred to the actual parameter if the function module is completed without errors. An output parameter that is defined for pass by reference is not initialized when the function module is called.
CHANGING parameters are input and output parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input or output parameter. When the function module is called, the content of the actual parameter is passed to the input/output parameter, and when the function module is completed, the content of the input/output parameter is passed to the actual parameter.
TABLES parameters are table parameters. Table parameters are obsolete CHANGING parameters that are typed as standard tables with a header line. If an internal table without a header line or a table body is passed as an actual parameter to a formal parameter of this type, an empty local header line is generated in the function module. If an internal table with a header line is used as an actual parameter, both the table body and the header line are passed to the function module. Pass by value is not possible in formal parameters defined using TABLES. Formal parameters defined with TABLES can be replaced by formal parameters defined with CHANGING. A local work area can be created for the internal table in the function module by using the addition LIKE LINE OF itab of the DATA statement.
Exceptions
The exception of a function module are defined on the Exceptions tab page in the Function Builder. Here you can select exception classes to define whether class-based exceptions are declared or non-class-based exception are defined. Class-based exceptions are represented in the above syntax by RAISING, and non-class-based exceptions are represented by EXCEPTIONS.
The addition RAISING is used to declare class-based exceptions that can be propagated from the function module to the caller. Exceptions in the categories CX_STATIC_CHECK and CX_DYNAMIC_CHECK must be explicitly declared, otherwise a propagation can lead to an interface violation. A violation of the interface leads to the treatable exception CX_SY_NO_HANDLER. Exceptions of the category CX_NO_CHECK are implicitly always declared. The declaration of exceptions of the category CX_STATIC_CHECK is statically checked in the syntax check. For exceptions of the category CX_DYNAMIC_CHECK, the check is not performed until runtime. In a function module in which class-based exceptions are declared with the RAISING addition, the statement CATCH SYSTEM-EXCEPTIONS cannot be used. Instead, the relevant treatable exceptions should be handled in a TRY control structure.
The addition EXCEPTIONS is used to define a list of non-class-based exceptions that can be triggered in the function module using the statements RAISE or MESSAGE RAISING. Exceptions defined in this way - as with formal parameters - are bound to the function module and cannot be propagated. If an exception of this type is triggered in a function module, and no return value has been assigned to it with the homonymous addition EXCEPTIONS of the CALL FUNCTION statement when the call was made, this leads to a runtime error.
Note
For new developments after release 6.10, SAP recommends that you work with class-based exceptions that are independent of the function module.
RFC is a technology which is used to access a functions (Modules) from
the remote systems.
If a function module is set as remote enabled which can be access from
the remote system via RFC.Eg: U can access the Remote enabled function modules in ur VB,Webdynpro,Java,Visual composer program.
A function module can be set as remote enabled by SE37->Go to ur FM->click the option Button "remote enabled".
But Normal function modules can not accessd from the remote system.
Good Example for RFC enabled function module is : BAPI(Business Application Programming Interface)
Note: All BAPIs are Remote enabled but not all remote enabled function modules are BAPI.
CALLING A FUNCTION MODULE:
1)In U ABAP Editor --> Click "Patter" ---> Selection Option Button "Call Function"
--> Write the Corresponding FM name --> Hit Enter
2)The appropriate import ,export Parameters will be displayed in ur editor
3)Pass the Values Here.
Also check these links.
http://www.geocities.com/victorav15/sapr3/abapfun.html
Check this link:
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
Check this link:
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
See the following links:
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db970e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
<b>Reward points for useful Answers</b>
Regards
Anji

Similar Messages

  • Error in calling the Remote Function Module

    Hi all,
    I am trying to call the Remote function Module which is in CRM  from ECC .
    But we are not able to detect the function module as it is showing the error as Function Module not found.
    Can anybody help us in calling the Remote Function Module .
    Regards,
    Madhavi

    Please check the foll 2 things :
    RFC radio button clicked in se37 for that FM
    RFC connection established with the remote server in SM59
    Thanks

  • Regarding the obsolute function modules

    Hi All,
    below function module are obsolute in 4.6c ,what are the new function modules in ECC 6.0.
    1.GRAPH_RECEIVE
    2.GRAPH_SET_CUA_STATUS
    already i search in sdn but i didnt get exact answer................
    plz help me.....
    Regards,
    Madhu

    Hi
    Though these function modules are set to obsolete,they are still maintained and supported by SAP and can be used in your application further.  They are set as obsolete in order to avoid the usage in new development projects.       When starting new developments it is recommended to use class 'cl_gui_chart_engine' .
    Hope this is helpful.

  • Regarding the RFC Function Module call from PI

    Hi All,
    I am working on one File to RFC interface, in which File adapter picks the file, this file data has to goto  2 function modules in SAP system. For this i added 2 Inbound interfaces in INTERFACE DETERMINATION and I developed 2 RECEIVER AGREEMENTS. In 2 RECEIVER AGREEMENTS i added single receiver RFC Communication Channel.
    Now i want assurance that once 1 st function module will execute completely, then only my second function module should be called. Is there any setting that i can do to make this sync?????.
    what is the use of  Send 'Confirm Transaction' in receiver RFC Communication Channel under Adavanced Mode.
    Thanks,
    Balu

    Hi,
    As per you requirement I would suggest to change your scenario as File To Proxy. It will much more easier and 100% sure to process second BAPI only after first gets successful inside the proxy.
    Pass the data from file adapter to inbound proxy and then inside proxy code you first call the first BAPI and use commit wrok. Once commit work is successful then you call the second BAPI otherwise rollback the changes.
    Example:
    Call First_BAPI
    <pass the data to it's import export parameters>
    Commit work.
    if sy-subrc =0.
    Call Second_BAPI.
    <pass the data to it's import export parameters>
    Commit work.
    endif.
    Note: If you are not very much comfortable with ABAP the discuss this with your ABAP team mate.
    Regards,
    Sarvesh

  • Remote Function module to wait for the response.

    Hi .
    i just created the remote function module to call the webmethod by putting the parameters in tables (tab) for webmethods to pick the data from RFC and parameters in changing (tab) to collect the reponse from webmethods ,i just want to know if this is the right way of creating the RFC for webmethods and the RFC need to wait for certain time until it should get the response from webmethods.
    can any body guide me in this on how i can make the rfc to wait untill it will get the response from webmethods.
    waiting for your response.
    regards.
    Varma

    Hi Jaswanth,
    FM used to upload the data from the non sap system to the SAP sytem is the GUI_UPLOAD ans GUI_DOWLOAD is downloading the data from SAP to the presentation server .This file can be xls,tab or space deliminatior ettxt fiel.
    I think this was your requirement.
    Pooja

  • Remote function module to wait untill the response came from webmethods

    hi all.
    here i have got a situation that the remote function module created in SAP-R/3 to wait untill the response came from webmethods :
    i have created the remote function module by assigning one structure in tables(tab) and 3 parameters in changing tab just to collect the messages return from webmethods
    so this rfc will be called by webmethods and pick the structure data and then it wll return 3 variables back to rfc.
    here the rfc need to wait untill the response came from webmethods.
    so can any body suggest me on what source code do i need to write in RFC

    Hi Naina,
    Normally RFC are synchronous, they do have return parameter as export parameter.
    If return parameter is missing then , you can create Wrapper RFC.
    Wrapper RFC:
    It is nothing but you just  create BAPI in SE37 transaction with Return parameter as export parameter and make it remote enabled by clicking on Radio button.
    Under source code, CALL BAPI which XI has to call.
    Thats it!
    I hope this helps.
    Let me know if any help required.

  • Remote Function Module problem

    Hi Experts,
    I have written a Se38 progarm to execute a remote function module, so as to send some data out of the system. The receiving system is an XI system. Pls see below the code and the load at the XI end, I donno why and what mistake am I doing in the se38 program part, as a result of which, only part of the data is getting send to XI.
    REPORT ZRFC_ADAPTER.
    Data: it_final1 type standard table of zrfc_str with header line .
    it_final1-NAME = 'ARNAB'.
    it_final1-ADDRESS = 'ADDRESS'.
    it_final1-EMAIL = 'EMAIL'.
    it_final1-ID = 'ID'.
    CALL FUNCTION 'ZRFC_XI'
    IN BACKGROUND TASK DESTINATION
    'R32XIRFC'
    EXPORTING
    username = sy-uname
    tables
    it_final = it_final1 .
    break-point.
    COMMIT WORK.
    Clear it_final1.
    I have seen in debugging mode, after removing the "
    IN BACKGROUND TASK DESTINATION
    'R32XIRFC'", that the internal table " it_final1 " is working fine......
    The structure used in remote Function Module is
    IT_FINAL LIKE ZRFC_STR -- in tables parameter. and the structure of ZRFC_STR is as follows!
    NAME ZNAME CHAR 14
    ADDRESS ZADDRESS CHAR 40
    TELEPHONE ZTEL CHAR 20
    EMAIL ZEMAIL CHAR 40
    ID ZID CHAR 10
    Note that , apart from a COMMIT WORK statement, there is no other coding done in the SOURCE CODE part of the remote Function Module.
    The load in XI is showing as
    <?xml version="1.0" encoding="UTF-8" ?>
    <rfc:ZRFC_XI xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    <USERNAME>RETAILDEV</USERNAME>
    <IT_FINAL>
    <item>
    <NAME>ARNAB</NAME>
    <ADDRESS>EMAIL</ADDRESS>
    <EMAIL />
    <ID />
    </item>
    </IT_FINAL>
    </rfc:ZRFC_XI>
    Note that EMAIL is actually a content of field EMAIL and not ADDRESS. But I donno why, it is behaving like this,,
    Pls note, this RFC has been imported completely in integration repository of XI, so we dont have to worry about any settings change or activities, left pending in XI.
    I am very sure, something is missing in the se38 code, pls suggest!!
    Regards,
    Arnab .

    Hi Arnab,
    I am having really doubt that there is problem in field mapping.
    COuld you please check the following.
    In the FM structure contains 5 fields as follows,
    NAME ZNAME CHAR 14
    ADDRESS ZADDRESS CHAR 40
    TELEPHONE ZTEL CHAR 20
    EMAIL ZEMAIL CHAR 40
    ID ZID CHAR 10
    In the Internal Table it has got 4 fields. Check the Mapping properly
    and data on each field.
    t_final1-NAME = 'ARNAB'.
    it_final1-ADDRESS = 'ADDRESS'.
    it_final1-EMAIL = 'EMAIL'.
    it_final1-ID = 'ID'.
    Thanks & Regards,
    Nagaraj Kalbavi

  • Export and Import Strings To/From Remote Function Modules

    Hi,
    I am building a Web Application in which the user can enter very large string (unlimited) and we want to store that value in the backend. So i need to create Remote function module which can take large strings, store it in backend and when queired export the strings to the calling web application.
    The Remote function module is allowing me to create "Import" and "Export" parameter with type String....but it is not allowing the String type "Table" parameter. I am kind of stuck now as i want to import and export multiple records of type String.
    Can anyone suggest an altenative?
    Regards,
    Kumar.

    Hi,
    To have a table parameter with string type fields, Goto SE11 and under data types, create a structure with the required fields of type string.
    Then u can use this structure to refer to the table parameter and declare it as
    p_tab like ZSTRUCTURE in the tables tab.
    Regards,
    Vik

  • Regarding Remote function module ARCHIV_CONNECTION_INSERT

    Hi All,
    Can any give me more detial about remote function  module ARCHIV_CONNECTION_INSERT . So i have requirement that our client is archiving document from Commonstore. So want to create custom function module for TOA01 ( ZTOA01 ) and add a maintanance field. if data is archived maitaianance field should be flagged and next time when he is archivig document he dont want to give date. so only unflagged document should be archived.
    so can any one help me how to overcome this requirement as this is urgent.
    Thanks in advance.
    Best Regards,
    zubera

    Go to SAP Service Marketplace (service.sap.com) and SAP Notes Search. Put in the note number 758278 and hit display.
    However to be able to access service marketplace you need a s-user registered for the company you are working for. Please contact your basis team to find out what user is available to you.
    Regards,
    Michael

  • Regarding Remote Function Module RFC_READ_TABLE

    HI,
    Can any one please let me know that whether Remote function Module RFC_READ_TABLE work in uni code system.
    In notes 382318 stated some problem regarding the Long run structure and security problem.
    So please let me know how to overcome this problem.
    Please reply. it is urgent.
    Thanks in advance.
    Best Regds,
    zubera

    Go to SAP Service Marketplace (service.sap.com) and SAP Notes Search. Put in the note number 758278 and hit display.
    However to be able to access service marketplace you need a s-user registered for the company you are working for. Please contact your basis team to find out what user is available to you.
    Regards,
    Michael

  • What is the exact syntax for calling remote function module.

    Hi to all
    1.....what is the exact syntax for calling remote function module.?
    Thanks and regards,
    k.swaminath reddy

    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^

  • RFC Error While Invoking A Remote Function Module.

    I am invoking A remote function module while invoking it get  an exception when i see the error logs
    com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException:      Screen output without connection to user.                           , error key: RFC_ERROR_SYSTEM_FAILURE at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClassExecutable.execute(DynamicRFCModelClassExecutable.java:101) at... [see details]
    can anyone pls tell me what the error is..
    regards
    Nilesh Taunk.

    Hi Nilesh Taunk,
    You can go through the following steps
    -o JCO Exceptions 1. http://help.sap.com/saphelp_nw04s/helpdata/en/f6/daea401675752ae10000000a155106/frameset.htm
    -o JCO Exceptions 2. http://help.sap.com/saphelp_nw04/helpdata/en/f6/e002416225f023e10000000a155106/frameset.htm
    -o Restart of the J2EE instance and try re-importing the RFC model. Sometimes it helps.
    -o Logon into WebDynpro Content Administrator as a J2EE Admin and check if the JCO Connections and User /pwd of your application is correct. You can <b>ping </b>or <b>test your JCO connections</b>. if something is wrong, enter the values again for JCO n retest them.
    -o Try undeploying or removing the complete application and redeploy it.
    Tu undeploy please go to
    Go to <b>Visual Admin -> Server -> Services -> Deploy ->
    </b>
    Under Runtime Tab
    select the server, open the tree , you would find the webdypro list there.
    Now select an application, first stop it, remove it and redeploy if necessary.
    Let us know if you could solve the problem or not, gud luck!
    Rgds,
    Sreenivas.

  • Remote function module - stub program

    hi,
      i have created a remote function module that can be called by non-sap system (Biztalk).
    They are asking about stub program ,how to create that .please suggest.
      i searched in sap help portal , i found out that we can create that from fucntion module  -> display -> utilities -> RFC interface program , but i can't findout the option our sap version is ECC6.0

    hi!
    please checkout the link http://help.sap.com/saphelp_nw70/helpdata/en/7c/a4f1b3c59aef4f8ea3c32cda0c0486/frameset.htm
    kind regards
    Peter
    Edited by: Peter Lintner on Jul 20, 2009 12:38 PM

  • Invoking  Remote Function Module.

    Hi
    I am invoking a remote function module from a web dynpro application(External Appln ).
    The FM contains the following code snippet
    first it inserts the parameters passed into a table
    and then the code is
    SUBMIT <report name > with parameter passing.
    when i comment out the Submit statement and invoke the function module the parameters get populated in the table..but when i enable the SUBMIT statement the same set of parameters dont even get populated in the table. and i get the following exception in the logs of SAP J2ee appln server .
    WDDynamicRFCExecuteException:      Screen output without connection to user.                           , error key: RFC_ERROR_SYSTEM_FAILURE
    i am not able to find a solution to this problem .
    Please help.
    regards
    Nilesh Taunk.

    HI
    GOOD
    GO THROUGH THIS LINKS,THEY MIGHT HELP YOU TO GIVE YOU SOME MORE IDEA.
    Re: RFC Error While Invoking A Remote Function Module.
    RFC Error While Invoking A Remote Function Module.
    http://sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5303c390-0201-0010-e0b2-bfae018377f0
    THANKS
    MRUTYUN

  • Invoking a Remote function module for every 5days

    Hi Experts,
    How to invoke a remote function module in R/3 from XI for every 5days?
    After invoking tht i need to post data to a FTP server! Could any one tell me how to achive this
    Thnx
    RAMS

    Hi Ram,
                 If your scenario is R3 -- > XI -- > FILE .
    My suggestion is to go for ABAP Client proxies. It is fast and we can move huge data .
                 1. Generate abap proxy from Outbound interface from R3system .
                  2. Write ABAP  report , call  RFC , fill TABLE structure of abap and send to XI ( IS) . then according to the Receiver determination . It will create flate file .
                3. Schedule report  once in 5 days .
                     Please refer how to work with abap client proxy   and steps to activae  
    How do you activate ABAP Proxies?
    /people/vijaya.kumari2/blog/2006/01/26/how-do-you-activate-abap-proxies
    ABAP Proxy Runtime
    http://help.sap.com/saphelp_nw04/helpdata/en/02/265c3cf311070ae10000000a114084/frameset.htm
    ABAP CLIENT PROXY
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1387proxies [original link is broken] [original link is broken] [original link is broken] .
    Assign points if u found helpful
    Regards.,
    V.Rangarajan
    Message was edited by:
            ranga rajan

Maybe you are looking for

  • Audio no longer works with external display

    Before Yosemite, I could plug my computer to a HDTV through a HDMI cable, and then hook up my audio to a stereo, so I could watch TV shows. After upgrading to Yosemite, my audio no longer work when connected to a HDTV. Any help?

  • New contacts created on iphone 4s will not sync to outlook 2010

    all my updates are installed. but the contacts I create on the 4S will not sync to outlook 2010. anyone knows how to solve this?

  • Rebate: How to define Slab wise rebate

    DEAR SD GURUS n EXPERTS, Currently we are using a simple rebate system. Where we create the Material or Product Group wise Rebate Agreement for a customer --> Sales Order --> Delivery --> Billing than enter the Payment in the the Rebate agreement, Ge

  • Regarding to import siri in iphone 4

    hello,      sir i m using iphone4 with OS4.1 n i m in india for 1 year n i had unlock it with geneva turbo sim... n i want to import siri on tht so wat can i do..?s please give me an helpful regard...                                                  

  • At the time of new confg. IT 2006 not coming by default

    At the time of new configuration In pa 30 Info type 2006 .Cick on create option System not showing Leaves in this . i have to mentioned leaves manually. Table  V_550P and T559V already maintained. IT 2006 not taking leaves by default.