Remote Function Call (RFC) within a BAdI in ECC to CRM

I've a remote enabled FM in a CRM system which I want to call within a BAdI implementation of a ECC system. As a result, the CRM system is the RFC server and the ECC system is the RFC client.
The FM in CRM simply gets the relevant rows of a Z table which, of course, only exists in CRM and passes these rows to the calling program as per parameter supplied by the calling program.
Now the BAdI in ECC is for changing 'Contracts' data in SAP (transactional data) before posting the contracts in the ECC database. The business uses a transaction where a large number of contracts are processed and documents posted in the system - and when this happens the system runs through (calls) the BAdI one contract at a time.
If I call the RFC enabled FM anywhere within this BAdI, it gets the data for one contract only so it reduces a great deal of performance in regards to memory consumption, network load etc. So I want to avoid this and call the RFC FM once instead, if possible.
Is it possible to call this RFC FM once only (to load the CRM Z table data for all contracts) and store it in a global table/area within the instantiated BAdI class (visibility public) so that when the BAdI is called the second time onwards it can read the global table/area by READ TABLE WITH KEY statement and avoid the RFC call for each BAdI call?
I was also thinking about may be using ABAP Shared Memory if this is a possibility in order to avoid the repeated RFC call? But this table on the RFC server changes frequently....so it might not be a good idea? or....??
I would greatly appreciate your inputs and thoughts regarding this; it would be great to hear if someone had had a similar experience.
Cheers,
Sougata.

As the Z table is only updated via a particular program in CRM - we developed and called a RFC enabled FM in that report when its updating the Z table to update the Z table in ECC to keep it in sync.
Short term benefit but might be long term pain if the Z table in CRM is updated by another program/process/application in the future! Not to mention any table field changes in CRM has to be also made in ECC everytime which is again a pain.
This is a workaround and definitely not a full-proof solution - but I guess these days one has to shut up and deliver whatever the customer wants!

Similar Messages

  • CATCHABLE EXCEPTIONS in the remote function call (RFC)

    Please tell me what are the CATCHABLE EXCEPTIONS in the remote function call (RFC) and to which exception class do they belong????
    Thanks in advance.
    Dinesh Dhiman

    HI,
    With external function calls, the EXCEPTIONS addition of the CALL FUNCTION command can be used to assign return values to the exceptions defined in the interface of the called function module. Class-based exceptions cannot be propagated to the caller from a remotely-called function module, and have the effect of an exception that cannot be handled.
    As well as the exceptions defined in the interface of the called function module, an external function call can also have the following predefined exceptions:
    The <b>SYSTEM_FAILURE</b> exception is the response to a runtime error that occurs when the remotely-called function module is executed.
    The <b>COMMUNICATION_FA</b>ILURE exception occurs when the connection to the partner system cannot be established or if the connection is lost during communication.
    Note
    We strongly recommend that you assign a return value to both these exceptions for every RFC, and that you handle this return value, as otherwise a runtime error will occur in the exception situations in question.
    Regards,
    Sesh

  • Remote function call (RFC) for WS_DELIVERY_UPDATE fails w/o error message

    Dear Experts,
    Iu2019m using WS_DELIVERY_UPDATE to post goods issue against outgoing delivery. SE37 works fine.
    RFC call from external program with the same parameters fails without returning any message.
    It aborts during call and after that it becomes invalid.
    Also calling BAPI_TRANSACTION_COMMIT does not help.
    Any idea why SE37 works fine but RFC fails?
    Anything I am missing?
    Many thanks
    Regards
    JW

    There could be many reasons, I'd suggest to get your Basis admin involved. Take a look at the ABAP dump (ST22), update termination (SM13) or RFC errors (SM58). Although I doubt you'll find something inside SAP, since it seems that RFC call itself fails.
    This function is not a BAPI, so BAPI_TRANSACTION_COMMIT won't do any good. All it does is COMMIT WORK actually.

  • An error occurred when executing a REMOTE FUNCTION CALL.

    Dear all,
    We have two syetms called DXD and GRD , we have a remote enabled function module in the DXD system , when i am trying to call this Function module from
    GRD system it is going for the short dump, and giving the follwing error,
    <b>Error analysis
        An error occurred when executing a REMOTE FUNCTION CALL.
        It was logged under the name "RFC_NO_AUTHORITY"
        on the called page.</b>
    But i do have the access for the DXD system also, i am really struggling to solve this problem, if any lights are there to help me , i will be thank full for then,
    some body suggested for me that we need to maintain the Trusted system tables in the target system.
    Thanks & regards
    Satya.

    first u( user id ) have to get the Authorizations to use RFC ?
    object will be  like S_RFC or some thing like this.
    when u get this kind of error just call /NSU53 then u will come to know which Authorization Object is missing from ur User Profile.
    Regards
    Prabhu

  • Data error (invalid data type 17) in a Remote Function Call

    Hi,
    I am passing 2 select-option tables to RFC.
    Tables have structures -
       Table1  SIGN(C1)
                   OPTION(C2)
                   HIGH(C6)
                   LOW(C6)
       Table2  SIGN(C1)
                   OPTION(C2)
                   HIGH(C20)
                   LOW(C20)
    At the destination side, I have created two table types which have same structure.
    But when I call the RFC , program terminates with error - "Data error (invalid data type 17) in a Remote Function Call"
      Not able to understand the reason for this error. Please help.
    Thanks,
    Sujeet

    Hi,
    check out this example
    [LINK|http://abap.googlar.eu/viewtopic.php?f=5&t=28]
    You have several ranges that you can use like RANGE_AUF.
    Function example:
    FUNCTION zexemple.
    *"*"Interface local:
    *"  IMPORTING
    *"     REFERENCE(R_HORA) TYPE  FLAG
    *"     REFERENCE(R_DIA_1) TYPE  FLAG
    *"     REFERENCE(P_IDOC) TYPE  FLAG
    *"  EXPORTING
    *"     REFERENCE(MSG) TYPE  CHAR255
    *"  TABLES
    *"      T_OIFSPBL STRUCTURE  OIFSPBL
    *"      SL_PBLNR STRUCTURE  RANGE_PBLNR
    *"      SL_MATNR STRUCTURE  RANGE_MATNR
    *"      SL_HORA STRUCTURE  RANGE_UZEIT
    *"      T_ERROS STRUCTURE  ZARSTRING
    ENDFUNCTION.
    Report:
    SELECT-OPTIONS: sl_pblnr FOR oirbpblb-pblnr,
                                  sl_matnr FOR a361-matnr.
    ~
    Final question:
    You are passing the values using TABLES and not IMPORTING right?

  • Remote Function Call

    Hi,
    I am very much new to RFC, Can anyone help me to suggest some ideas for the following scenario.
    1. For the created PA30 screen using webdynpro, i have to create RFC.
    2. BAsed on the input from the system and the screen i have to write RFC.
    3. Through the RFC i have to update the Tables.
    Thanks ,
    Vijay
    Moderator message : Spec dumping is not allowed, search for available information.  Thread locked.
    Edited by: Vinod Kumar on Aug 9, 2011 10:28 AM

    Hi..,
    CALL FUNCTION - RFC
    Syntax Forms
    Synchroner RFC
    1. CALL FUNCTION func DESTINATION dest
                         parameter_list.
    Asynchroner RFC
    2. CALL FUNCTION func STARTING NEW TASK task
                    [DESTINATION {dest|{IN GROUP {group|DEFAULT}}}]
                    parameter_list
                    [{PERFORMING subr}|{CALLING meth} ON END OF TASK].
    Transaktionaler RFC
    3. CALL FUNCTION func IN BACKGROUND TASK
                         [DESTINATION dest]
                         parameter_list
                         [AS SEPARATE UNIT].
    <b>The destination contains the connection parameters for remote function calls. It contains the connection type, the target system and the partner program. Connections that affect SAP systems exclusively can be agreed as trustedsystems. RFC destinations are managed using transaction code SM59. </b>
    regards,
    sai ramesh

  • Automatic remote login at remote function call

    Hello,
    we have three systems, development, testing and productiv. I want to do a remote function call on the repective other system. But I always get a login window where you have to insert your password for that system. Is there a possibility to do this automatically? Thanks.
    Cheers, Lars.

    or else in SM59 double click on your destination server and in logon/security tab and give ur username and password and try

  • The webdynpro/ABAP (WDA) calling RFC enabled FM of other ECC systems

    The webdynpro/ABAP (WDA) has problem calling RFC enabled FM of other ECC systems.
    WDA expects all the ABAPs, RFC FMs  of remote system(DEV, QA..) to reside inside its own instance.
    It is hard to transport and maintain these ABAPs FMs into a portal ABAP WDA instance.
    Proxy generation at WDA client:
    =======================
    1. If we can make an XI enable  an ABAP or RFC enabled FM of the remote ECC,
    I think the XI proxy classes can be generated at the client WDA system.
    Other options?
    How do I do it?  Can you give some tips.
    2. How do I manually code the RFC Call to BAPI/FM from Webdynpro controller or other interface?
    I am stuck with the above as the webservice option is not available at our ECC server.  It does not have a java engine installed for webservice to be available.
    Can you help on the above 2 options?

    Hi Mike ,
    <b><b> Answer of 2.</b></b>
    How do I manually code the RFC Call to BAPI/FM from Webdynpro controller or other interface?
    I am doing same thing for my current SRM implementation.I am taking data to SRM server from another R/3 server .
    This is solution I have used
    1) First of all I have made ABAP connection in SM59 .
    Go to SM59 .In ABAP Connection creat ABAP connection with system with which u want communicate .
    Eg I am connection with Systems PB1.
    So i developed Connection call PB1CLNT800.
    2) In my requirement I have taken data in my context from another r/3,
    I have give called RFC in my supply function of node.
    Call to RFC is as usual.
    In my case,
    CALL FUNCTION 'RFC_MATNR'
    DESTINATION 'PB1CLNT800'
    TABLES
    IT_MATNR = IT_MATNR.
    Onwards I have read my itab IT_MATNR and populated data to context.
    Hope solution will serve your purpose.
    Give point if it works .If any problem i have other ways.
    Cheers
    Parry B

  • CALL_FUNCTION_REMOTE_ERROR when calling a remote function call through PI

    Hello.  Thanks in advance for your perspective on this.
    We are developing an interface that runs in an R/3 system and is suppossed to perform a lookup in another R/3 system via a PI 7.0 system.
    Here's what we are trying to do, let's call these systems "A", "B", "C" respectively.
    R/3  ->  PI   -> R/3
    The R/3 system (A) executes code, which calls this function module like this:
          CALL FUNCTION 'Z_CHK_MAT' DESTINATION 'XI_RFCADAPTER'
            EXPORTING
              iv_region           = lv_region
              iv_matnr            = ls_matnr-matnr
            IMPORTING
              ev_flg_is_purchased = e_flg_is_purchased.
    This code, is set via the "DESTINATION" parameter to use the RFC destination 'XI_RFCADAPTER'.  This destination, points to the PI (B) system above.
    Anyhow, we're getting a short dump in the R/3 (A) system, which is like this:
    CALL_FUNCTION_REMOTE_ERROR
    "JCO.Server could not find server function 'Z_CHK_MAT'"
    From my analysis, I believe this is because the remote function module Z_CHK_MAT does not exist, in the PI (B) system.
    Our developer, believes this should just "pass through" the PI (B) system, and call the function module in the R/3 (C) system.
    Any insight on this?  In this scenario, does this Function Module need to exist in the PI abap side?  Can you give perspective / guidance on this?
    Thanks a lot
    Steve

    No need to exist in PI ABAP side.
    Just make sure that:
    1. as Michal said, you import it in Integration Repository (and use it in your configurations);
    2. the RFC Destination type that points to XI is of type T, not 3;
    3. both the RFC Destination & the Sender RFC Adapter (and only them) are using the same Program Id.
    Regards,
    Henrique.

  • Refresh a report list after remote function call

    Hi,
    My customer has a report listing invoices. A non-SAP program calls a remote function creating an invoice with BAPI. My customer wants the list to be refreshed after the invoice is created via RFC or to refresh the list in specified time intervals.
    Is there any way to accomplish that task?
    thanks,

    ... or OO, integrate like this
    DATA:      ok_code LIKE sy-ucomm.
    *       CLASS lcl_event_handler DEFINITION
    CLASS lcl_event_handler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS: on_finished FOR EVENT finished OF cl_gui_timer.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    CLASS lcl_event_handler IMPLEMENTATION.
      METHOD on_finished.
    * Start Timer again
        gr_gui_timer->interval = pa_autow.
        CALL METHOD gr_gui_timer->run.
    * cause PAI
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = gc_cmd_refresh.
      ENDMETHOD.                    "on_finished
    DATA:
      gr_gui_timer               TYPE REF TO cl_gui_timer,
      gr_event_handler           TYPE REF TO lcl_event_handler,
      gs_vtyp                    like ts_vtyp.
    *======================================================================*
    *= Selection screen                          =*
    *======================================================================*
    PARAMETERS:
      pa_autow TYPE flag DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK date.
    *&      Form  init_autorefresh
    *       Timer starten oder stoppen
    FORM init_autorefresh .
      IF pa_autow IS NOT INITIAL.
        CREATE OBJECT gr_gui_timer.
        SET HANDLER gr_event_handler->on_finished FOR gr_gui_timer.
        gr_gui_timer->interval = pa_autow.
        CALL METHOD gr_gui_timer->run.
      ELSEIF gr_gui_timer IS BOUND.
        gr_gui_timer->cancel( ).
      ENDIF.
    ENDFORM.                    " init_autorefresh
    Regards,
    Clemens

  • Defining Dynamic structure in Remote Function module(RFC)

    Team,
    I got a requirement, where I need to create a dynamic structure and dynamic table in the exporting tab of Function module(RFC).
    Say, I have sales request(4 fields) and sales quotation(5 fields).
    Depending on the importing parameter, If it sales request I need to export 4 fields as a structure and if in the importing parameter it is sales quotation then I need to pass 5 fields as a structure.
    Any help please??
    Thanks,
    Sai

    Hi Manu,
    Those are dummy functions.
    Check out
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/047ab790-0201-0010-a9b1-e612f8b71dcd
    (page 14)
    regards,
    Edgar

  • Remote function module (RFC)

    Hi
    In one of the issue, remote enabled FM 'RFC_CALCULATE_TAXES_DOC' is called from SAP
    CALL FM 'RFC_CALCULATE_TAXES_DOC' DESTINATION 'ABCD'     (ABCD is other system - sabrix)
    Can anybody tell me the logic (there is no code in FM) , whether FM with this name is there in other system which is called from SAP, (How processing occurs in case of remote FM).
    And how to see what processsing is being done in other system. ?
    And why there is no code in this FM in sap?
    Thanks and Regards
    Manu

    Hi Manu,
    Those are dummy functions.
    Check out
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/047ab790-0201-0010-a9b1-e612f8b71dcd
    (page 14)
    regards,
    Edgar

  • AS3/BlazeDS remote function calls

    We have a pure as3 - no flex - project which connects to server-side Java.  The actionscript will, upon interaction from the user, invoke a Java function on the server side, which will then broadcast out a message to all users.  This works when testing locally, but when we put the project onto a remote server, the actionscript code will no longer invoke the Java function.
    We are unsure as to why this is: the service xml files are the same, and the files are in the correct locations.  In the BlazeDS admin console, whenever we try to call that Java function, it is incrementing the InvocationFaultCount variable for the specified destination.  Any suggestions why it won't work online, but will on the local machine?
    thanks

    Hello Case,
    The approach in NCo for this purpose is to use RfcCustomDestination, as already recognized by you. Thus you can challenge the user for his personal password and set those credentials for the logon. Best variant is to provide a repository user and password in the configured destination so that metadata is then read with a user that is restricted to metadata lookup permissions only.
    In case the infrastructure would issue a token for the logged on user, one could imagine that with such a token and trust between the ABAP system and the NCo application could do some kind of SSO. However, NCo runtime is not prepared so far to allow such a setup.
    Best regards,
    Markus

  • Generate Idoc from Remote function call

    Hi,
    Earlier i have done RFC which is been called with JCO and and sends datastream as well xml.
    Now my doubt, is it possiible to generate the idoc for external application through RFC call from JCO?
    if so, can anyone send me appropriate links or advice on the subject!
    My main concern is i can generate the idoc through RFC call basing on the calling parameters,,, but how to pass the idoc structure for them?
    for XML i used Export: E_XML     TYPE     STRING
    for data stream: ITAB     LIKE     ZSTR_ITAB.
    Any inputs will be of great helpfull...

    Assigned resultant idoc structure to the Table parameter of type EDIDD in created BAPI.

  • How to make a dynamic function call from within a package procedure

    Hi:
    I need to call a function dynamically (name and parameters determined at run time, but return value is known:always an integer). I can build the call and place it in a dynamic sql using dbms_sql. But the function is inside a package and is not public.
    So, if I issue:
    dbms_sql.parse( cur,'SELECT '||call||' FROM dual', dbms_sql.v7 )
    where call is "DOS(234,'V')"
    I get:
    ORA-00904: "DOS": invalid identifier
    If I make the function ("DOS") public and "call" equals "pack.DOS(234,'V')", it works fine, but I don't want to make it public.
    Is there a solution?
    Thanks in advance
    RuBeck

    Hi, Kamal:
    Calling from outside of the owner package is not possible if it is not public.The calls are from inside the package. It looks like the dynamic select is executed "outside" the package, so the private function is unknown
    Make it available in the package headerLooks like it's the only solution
    How often this will be executed?This is a library for loading files into tables and executing dynamic validation procedures.
    Here's an example of the mechanics:
    create or replace package mypack as
         function one return number ; -- public function
         procedure execute_it( p_name VARCHAR2 ) ;
    end ;
    create or replace package body mypack as
    function one return number is
    begin
    return 1 ;
    end ;
    function two( i number, s varchar2 ) return number is -- private function
    begin
    return 2 ;
    end ;
    procedure execute_it( p_name VARCHAR2 ) is
    select_str VARCHAR2( 1000 ) ;
    v_num NUMBER ;
    cur NUMBER ;
    nf NUMBER ;
    begin
    select_str := 'SELECT '||p_name||' FROM dual' ;
    cur := dbms_sql.open_cursor ;
    dbms_sql.parse( cur,select_str,dbms_sql.v7 ) ;
    dbms_sql.define_column( cur,1, v_num ) ;
    nf := dbms_sql.execute( cur ) ;
    IF dbms_sql.fetch_rows( cur ) = 0 THEN
    RAISE no_data_found ;
    END IF ;
    dbms_sql.column_value( cur, 1, v_numero ) ;
    dbms_output.put_line( p_name||' returns '||v_num ) ;
    dbms_sql.close_cursor( cur ) ;
    end ;
    end ;
    begin
    mypack.execute_it( 'mypack.one' ) ; -- Call public function: Works fine
    mypack.execute_it( 'two(234,''v'')' ) ; -- Call private function: error 0904
    end ;
    Thanks for your hints
    RuBeck
    PS: The indentation is lost when I post the message! I wrote it indented!

Maybe you are looking for

  • Problem with Notes (in Office function)

    Hi there Be gentle as this is my first post I can see the Notes Icon (Applications/Office/Notes) - yet when I select Notes, the screen slightly flashes and I have no access to the Notes I cant tell if it is synchronising with PC Sync and my Notes on

  • Multiple Address Book entries from iPhone

    When I add a single contact using iPhone (3GS, Ver 4.1) as it syncs to MobileMe, anywhere from 1 to 9 additional copies of the exact same contact card are created. Of course they're propagated throughout my various Macs and iPad, as well as MobileMe.

  • Is there a norwegian dictionary in pages? If not, will apple ever make one?

    Hi! Since I'm norwegian, I often write texts and articles in Norwegian on my Mac. I currently have pages, but it bothers me that it always corrects my texts to swedish or english. So my question is, is there a norwegian dictionary for pages that I ha

  • Scheduling dates In Orders.

    Dear SAP Gurus, I have maintenance plan in which in scheduling parameter I  gave late completion Tolerance as 10% and early completion tolerance as 10%.Call Horizon is 90% and Scheduling period is 12 Months.The maintenances plan will be scheduled and

  • Sap India support for Certification sucks...

    n india SAP sucks It allows only MNC to be certified and cleary shows the attitude of the SAP india to give the money to Siemens who charges 3 lakhs for nothing.. They dont speak properly nor give any full information to people who call They say that