Can we write leave program syntax in RFC function module.

hello friends,
   can we write leave program syntax in RFC function module. Iam developing RFC Function module .
useful answers will be awarded..
Regards
Kanth
Edited by: Kanth on Mar 30, 2008 11:38 PM

Don't use leave program in RFC function module. You can better use EXIT or RETURN. But when developing RFC modules you should use the return structure BAPIRET2 to store message generated in the calling system. So when you use EXIT or RETURN, first give a message so the calling program knows why the RFC module was exited.

Similar Messages

  • Perform In RFC function Module

    Hi Experts,
    Can we use perform statement inside the RFC function module.
    I am working with 4.6b version.
    I am not sure about the cause of error.
    Earlier without perform it was working well.
    Now I have written perform , it is giving me error.
    What would be the cause of the error.
    Thanks In Advance
    Irfan Hussain

    Hi,
    what is the error, what it is saying. and are you sure of that.
    try to use using parameter
      PERFORM MOVE_HEADER_IN  TABLES RETURN
                              <b>USING</b> SALESDOCUMENT
                                    SALES_HEADER_IN.
    Regards
    vijay

  • RFC Function module is not working in program while Background

    Hi All,
    we have a one program in BI  system which is calling RFC function module. it is executing the program in foreground very well. Same program we have executed in background , it is not working at all. Thiis RFC function module exists in R/3 4.6c system.

    Hello Raju,
    Transactional call of a remote-capable function module specified in func using the RFC interface. You can use the addition DESTINATION to specify an individual destination in dest. If the destination has not been specified, the destination NONE is used implicitly. Character-type data objects are expected for func and dest.
    When the transactional call is made, the name of the called function, together with the destination and the actual parameters given in parameter list, are registered for the current SAP LUW in the database tables ARFCSSTATE and ARFCSDATA of the current SAP system under a unique transaction ID (abbreviated as TID, stored in a structure of type ARFCTID from the ABAP Dictionary, view using transaction SM58). Following this registration, the program making the call is continued by way of the statement CALL FUNCTION.
    When executing the COMMIT WORK statement, the function modules registered for the current SAP LUW are started in the sequence in which they were registered. The statement ROLLBACK WORKdeletes all previous registrations of the current SAP LUW.
    If the specified destination is not available for COMMIT WORK, an executable called RSARFCSE is started in the background. This attempts to start the functional modules registered for an SAP LUW in their destination, every 15 minutes up to a total of 30 times. You can make changes to these parameters using transaction SM59. If the destination does not become available within the given time, this is noted in the database table ARFCSDATA as a CPICERR entry. By default, this entry in database table ARFCSSTATE is deleted after 8 days.
    Thanks and Regards,
    SAP Shori

  • How to create RFC function module and how to call this function module

    Hi,
    i want to know step for creating RFC function module and then How to  use this function module from some other sap system.
    Thnaks,
    jigar

    Jigar,
    To implement a remote function module in ABAP, perform the following steps:
    Register the module as remotely callable in the RFC server system.
    In the function module Administration screen (transaction code SE37), set the field Can be called via REMOTE CALL. Registering a module as remote causes an RFC stub to be generated for it.
    Write the code for the function module.
    Create the destinations.....................
    Displaying, Maintaining and Testing Destinations
    To display, create or modify destinations, choose Tools ® Administration ® Administration ® Network ® RFC destinations or enter transaction code SM59.
    Remote Destinations are stored in table RFCDES. The RFCDES table describes logical destinations for remote function calls.
    It is not possible to maintain the RFCDES table directly.
    You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® AcceleratedSAP ® Customizing ® Execute Project ® SAP Reference IMG.
    In the Implementation Guide, expand the following hierarchy structure:
    Basis
    Application Link Enabling (ALE)
    Sending and Receiving Systems
    Systems in Network
    Define Target Systems for RFC Calls
    Displaying Destinations
    The initial screen for this transaction displays a tree:
    Different connection types (i.e. partner systems or programs) are possible. For further information, see Types of Destinations.
    To display all information for a given destination, double-click it, or place the cursor on it and press F2 .
    To search for a destination, press the Find button and specify your selection. You get a list of all entries matching your selection. Place the cursor on the one you want, and press F2 or simply double-click the destination. All information for the given entry appears.
    Creating Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    All available connection types are explained in Types of Destinations.
    To create a new RFC destination, press the Create button. A new screen is displayed with empty fields for you to fill in.
    If you want to create a new destination
    As you create a remote destination, you can specify a particular application server or a group of servers for a balanced distribution of system load.
    For details of the destination parameters, see Entering Destination Parameters.
    Changing Existing Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    You can display all information for a given destination by double-clicking it or pressing F2 on it.
    To change an existing destination, double-click it, or place the cursor on it and press the Change button.
    For details of the destination parameters, see Entering Destination Parameters.
    Testing Destinations
    To test a destination, choose the appropriate function from the Test menu.
    Connection (also available via the Test connection pushbutton)
    Authorization (checks logon data)
    Local network (provides a list of application servers)
    You can use the CALL FUNCTION statement to call remote functions, just as you would call local function modules. However, you must include an additional DESTINATION clause to define where the function should run:
    CALL FUNCTION RemoteFunction
    DESTINATION Dest
    EXPORTING
    f1 =...
    f2 =...
    IMPORTING
    f3 =...
    TABLES
    t1 =...
    EXCEPTIONS......
    The field Dest can be either a literal or a variable: its value is a logical destination (for example, "hw1071_53") known to the local SAP System. Logical destinations are defined in the RFCDES table (or the TRFCD table in R/2 Systems) via transaction sm59 or the following menu path: Tools ® Administration, Administration ® Network ® RFC destinations. You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® Customizing ® Enterprise IMG. In the Implementation Guide, you can then choose Cross-application components ® ALE ® Communication ® Define RFC destination.
    The remote function call concept, for example, allows you to access a function module in an R/2 System from an ABAP program in an R/3 System. If you want to read a customer record from your R/2 System’s database, create a remotely callable function module in the R/2 environment which retrieves customer records. Call this function from your R/3 System using a remote function call and listing the destination for the target R/2 System:
    Pls. reward if useful

  • Call RFC Function Module and return 1000 records at a time

    I would like to call a Remote Enabled Function Module from a non SAP system.  This function module will select data from the database and return it to the calling program.
    Suppose there are 100,000 records that need to be returned, but the calling module would like the data in chunks of 1000 records.  Therefore the calling program would call the FM 100 times. 
    How do I code the function module to know on each subsequent call to grab the next chunk of 1000 records? 
    Let me know if additional information is needed.
    Thanks,
    Aaron

    Hello,
    Here is how you can go for this issue:
    1. Create one RFC function module with following parameter. These parameters are with respective of chunking logic.
         Import: Package Size
         Export: Total number of records
         Changing: chunk count
    Implement following logic:
    1. First of you need to know how many chunks you need to fetch for that get the count of total number of records. This is one  
        time activity so you better maintain one flag import parameter will be set to 'X' only first call.
    2. Get the number of chunk using total number of records / chunk size for e.g. 1000 / 100 so chunk count = 10.
    3. Define internal chunk counter in function module which will be used to locate the correct chunk depending on the chunk
        counter value sent from calling program.
    4. Send first call with package size 100 and chunk count = 1, execute select statement and increment internal
        chunk count check if chunk count = internal chunk count in current case chunk count = 1 so exit select statement and return
        with first chunk.
    5. Send second call with package size 100 and chunk count = 2. Execute select statement and check chunk count with internal
        chunk counter, in current case it will be 1 so skip that data and go for next chunk of 100 records increment internal chunk  
        counter. In this case it will match with external chunk count = 2. load output table with that data and return to calling program.
    6. Repeat step 4 until you reach last chunk.
    You need to use SELECT...ENDSELECT with PACKAGE SIZE addition so for every loop it will return number of records mentioned in package size.
    Hope this helps.
    Thanks,
    Augustin.

  • Problem while calling an RFC Function Module in Background

    Hello,
    I have created a RFC function module for reading data from an external DB system. The FM calls an external RFC program (coded in C++ using RFC SDK), which delivers the required data. This external program is maintainged as an TCP RFC Connection in SM59.
    Further I have created a report, that calls the RFC function module to get the data from the external RFC programm.
    My problem is, when I call the report in foreground, everything works OK, the RFC connection works and data can be read from the external program.
    However, when I schedule the report to run in background as a job, the report is stating in the protocoll that there was a problem calling the defined RFC connection (although the connection is working properly at that time).
    More funny is, this particular problem with running in background occurs only in the productive system, in test and development system the report works correctly also while running as a job in background.
    Can you suggest the solution to this problem? Could it be something with authorisations or server settings?
    I will be on holiday for the next 6 weeks, so take your time to answer .
    Regards,
    Dusan.
    Edited by: Julius Bussche on Jan 22, 2009 7:19 PM
    Please read the forum rules about u r g e n t ...

    This is an external RFC server program, not a remote enabled ABAP RFC function module as the others seem to be assuming, right?
    Is it possible that your DEV and QAS systems only have one application server, but the PROD has many and dedicated one(s) for processing low priority background jobs?
    It might be that the target server of your TCP connection is not this BTC instance, and your RFC server is returning the data "locally" - so, into nirvana...
    Just guessing, but might be worth checking.
    Cheers,
    Julius

  • Backgroung job failing becuase RFC function module is running in Dialog

    Hi,
    I have a program which is calling a RFC function module. I am running this program in background as a job. Now this function module which is in other system is running in Dialog and giving a time out error and the job is failing becuase of that.
    I tried call fucntion 'test' in background task
        destination 'XVZ'
    tables
       test = 'test'.
    But this is not working, i can still see this function module running in Dialog in SM50. Any suggestion?
    Thanks,
    Shweta

    Hi !
    RFC-Called function-modules are running in a dialog workprocess of the
    target system (they could not run in a batch proecess !!).
    That means the do have the same "Timeout" limitations than any other
    Dialog-Process.
    What you can do:
    - The Dialog "Timeout" could ce increased by your SAP-BASIS
    - If they could not - you should "shorten" the LUWs in the target-funktion.
      ...means - put a COMMIT WORK an any point the work is done.
      After a COMMIT WORK the "Timeout" Counter beginns at 0 !
    Hope that helped....
    Reward points would be nice...

  • Debugging RFC function module from ECC to CRM

    Hi All,
    My requirement is to debug an RFC function module present in CRM(7.0) system from ECC(6.0) system. A report program in ECC will call CRM custom FM. I found many posts in SDN with the same issue and tried to implement suggestions provided there. But I couldn't succeed. The approach I followed is:
    I logged in to ECC report program and kept an external breakpoint just before the function module call.
    I logged in to CRM system, opened the function module and kept an external breakpoint there.
    In both the systems I provided the dialogue userid( id through which I log in to SAPGUI) in the system->settings->debugging option.
    In CRM I activated the external break point in  transaction SRDEBUG.
    Now when I execute the report program in ECC, control stops at the breakpoint. If I press F5 at the function call, control is not going to the external break point set in the CRM FM. I am getting output of FM directly.
    I tried with different settings like turning on the check box for IP matching and session breakpoint active immediate, switching to classic debugger etc. I also tried to provide the RFC user id instead of dialogue user but system throws exception saying only dialogue userids are allowed. I found that by inserting an infinite loop statement, control goes inside the RFC CRM FM but I prefer not to change the code.
    Please let me know if I missed anything.
    Thanks and Regards,
    Naren

    Hi,
    Debug RFC calls
    When an RFC function module is called it is usually not possible to debug the call, using the below techniques we can achieve the same. For this example we are calling an RFC enabled FM in ECC system from CRM system.
    Scenario 1: Calling a custom RFC FM
    STEP 1: Add an infinite loop in the remote custom Function Module (adding a u201CDO. ENDDO.u201D statement at the start of the FM would be enough).
    STEP 2: Execute your program in the CRM system. The execution stops at the RFC call, because of the infinite loop.
    STEP 3: Now login to the ECC system and go to transaction SM51 select the process which is executing the RFC and navigate to the menu: u201CProgram/Session->Program->Debuggingu201D this triggers the debugger session in a separate window.
    Scenario 2: Calling a Standard RFC FM
    When we are debugging a standard program we cannot add the infinite loop, hence we cannot go to SM51 and debug the work process. The RFC destination for the ECC system has a User specified, the RFC function module gets executed using this users credentials. Usually the basis team set up the RFC user as non Dialog user, this does not allow debugging. Contact your Basis team and get this changed to a dialog user enabling you to debug RFC function calls via the normal debugger.
    Note: User name configured in the RFC destination (transaction SM59) 
    Note: User type for the RFC User (transaction SU01D)
    Hope this will be helpful..

  • Get interface of RFC function modules in a remote system

    Hi,
    my goal is to write a report which checks if DDIC structures in two systems fit together when I use RFC`s.
    I have the destination and the name of the RFC.
    Can somebody tell me if I can get a list of the Importing/Exporting Parameters of this RFC? Maybe even with a typedescribtion?
    Thanks for you help.
    Best regards
    Lars
    Edited by: Lars-Eric Biewald  on May 21, 2008 8:39 AM

    Hello ,
    Thank you for your quick help.
    Here I have 3 ECC 6 system .
    1 Central systen
    2 Slave system
    Data will be updated to 2 slave system using RFC function module .
    We've already the SAP address, Client, User name , Password.. of the remote system
    So here how we will create RFC in SM59 to be used in the RFC call ?
    We will transfer the username, password , client in the RFC function module/..
    Here I do not know how to create RFC connection in SM59 and how to use them in ABAP
    Could you please help me ????
    Thanks

  • Calling RFC Function module from JAVA

    Hi All,
       We have created a RFC Function Module for Billing Plan tab in Sales order (BDC). The function Module contains BDC. When we are running the same function module in SAP it is working fine. But when the FM is called in Java , it is allowing only maximum of 5 entries , when we trying to insert at 6th position in billing plan tab, we are getting an error.
    Can any one help on this.
    Points will be rewarded for helpful answers.
    Thanks & Regards,
    Kiran I

    I think the problem is because of the number of lines displayed on the screen in the BDC session in the Billing Plan.
    You might have to add the page down logic to your BDC program.

  • Standard Component in CRM that will call RFC Function Module

    HI all,
    Is there any Standard Component in CRM that will call RFC Function Module from ECC and that called RFC FM should Fetch the data from ECC.

    You can call RFC from different places, like programs, function modules, web dynpros, classes...
    So you just have to have appropriate RFC on ERP side and call it from CRM side. To call it you use the following statement...
          CALL FUNCTION 'YOUR RFC FUNCTION'
            DESTINATION i_dest "name of server
            EXPORTING
              your export parameters
            IMPORTING
              your import parameters
    Regards.

  • RFC Function Module Configuration

    Hi Experts,
                 I have created an RFC function module which pushes data from R/3 system to XI. I need to configure this RFC in SM59. I am having XI server details and R/3 server details. Anyone can help me how to configure this and what kind of connection i have to use. so that data is pushed  to XI system. we are having a bunch of RFC's in our project. we need to create configuration for all the RFCs.
                  and what is Program ID?
                  Please give me the sequence of steps for configuration.my mail id is [email protected]
                  Points will be awarded for all the answers.
    Thanks & Regards,
    Poorna.

    hi poorna,
                  step 1- first go to the transaction sm59 and here you can
                            create a destination for R/3 to R/3 server type 3.
                  step 2- Now give the IP address for the another R/3 system (XI) here
                             and the system no will be 00 (default).
                   step 3- press save. now go to the second tab logon/ security
                               here declared the clind no, language , user name and
                             password.
                   step 4- press save and then check the test connection.
    Do reward if usefull.
    regards,
    vijay

  • RFC function module with call transaction  and Import memory ID

    Hi,
    I am calling RFC function module from R/3 which exists in BW.
    In BW stand alone function module works fine.
    When I am Calling from R/3 it is not working,
    Can you tell me is it because of the below code, And suggest if any corrections required.
    I am calling the call transaction and using EXPORT memory iD inside the program
    and IMPORT in after that.
    And populating RFC table's table  " p_i_tcode_user" finally.
    set parameter id 'TCD' field p_tcode.
    call transaction 'Z_BW_RSUSR002' AND SKIP FIRST SCREEN.
      ENDIF.
    get the final user data from submitted program
    import gt_users_complete from memory id tcode_userid.
    LOOP AT gt_users_complete.
          lwa_tcode_user-tcode =  p_tcode.
          lwa_tcode_user-uname = gt_users_complete-Bname.
          APPEND lwa_tcode_user TO p_i_tcode_user.
    ENDLOOP.
    Thanks,
    Veerendra.

    HI,
       Can you just exaplin it clearly plz..
    Thanks
    Mahesh

  • Where should i call the rfc function module? in xi or in r/3

    where should i call the rfc function module?
    for the synch scenario: file < -- >  xi <---> rfc
    i know the type of rfc is tcp/ip; but i'm not sure with the followings,
    and with some trials i can not even see any message via rwb even all the setting
    can be activated without errors.
    where should i create the rfc destination? in r/3 or xi
    where should i call the rfc via abap program? in r/3 or xi
    i guess the calling program should belong to the different server with the rfc itself....
    so confused....
    Thanks for your reply!!
    Jun

    if i create the destination in xi point to r/3, then i call the rfc use the destination in r/3 right ?
    The call doesnt use the destination in R3. XI has the RFC destination which is just used to connect to the R3 system
    but where i need to create the fm via se37? in xi or r/3 ?
    In R3
    Regards,
    Prateek

  • RFC Function module needed for getting table details in APO from R/3

    Hi,
    I need a RFC function module where I can write a query from R/3 to access APO server database table and get the necessary records.
    Regards
    Mac

    Possible ways
    1. Call fm RFC_READ_TABLE and give destination and table name ( But i am not sure how it will work SCIF enviornment of APO)
    or
    2. Create a custom function module in APO side and call from R/3 side using destnation option

Maybe you are looking for

  • Database out of memory error getting Web Intelligence prompts

    The following code generates an exception for a particular web intelligence report object ID: m_engines = (ReportEngines)m_entSession.getService("ReportEngines"); m_widocRepEngine = (ReportEngine)m_engines.getService(ReportEngines.ReportEngineType.WI

  • Do you have this bug ?

    Hi boys ! (and girls ? really ?) I've installed (with success) the MAX preview version of Flash Catalyst (I feel like a lucky boy). But it's quite impossible to use it because I can't resize any elements as rectangle for example or components. It's t

  • HT1296 How do I get outlook to automatically update to my iphone?

    I want new appts that are added to my outlook desktop calendar to automatically update to my iphone calendar.

  • How to make MIME obj public Urgent !

    Hi, I am working on a bsp with an html MIME object with controls_ie6.css and controls_nn6.css objects. I want to make them public because of firewall issues. I currently have the following code and i am not able to lunch the page properly. <htmlb:con

  • Getting an error of limit of 500 photos for published album when trying to upload to Flickr

    I'm trying to upload to my Flickr Pro account and I am now getting an error message saying: "You may put a maxiumum of 500 photos in this published album. Only the first 500 photos will be added to this published album. If you want to publish more ph